source: trunk/environment/ew_nt.cmd @ 7941

Revision 7941, 6.5 KB checked in by baker, 5 months ago (diff)

add newline to end of file

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1@Echo Off
2
3PushD .
4
5@Rem Set environment variables used by Earthworm modules at run-time
6@Rem ---------------------------------------------------------------
7Set EW_INSTALLATION=INST_UNKNOWN
8Set EW_HOME=C:\earthworm
9Set EW_VERSION=earthworm_7.10
10Set EW_BITS=32
11
12Set EW_RUN_DIR=%EW_HOME%\run_working
13Set EW_PARAMS=%EW_RUN_DIR%\params\
14Set EW_LOG=%EW_RUN_DIR%\log\
15Set EW_DATA_DIR=%EW_RUN_DIR%\data\
16Set SYS_NAME=%COMPUTERNAME%
17Set EW_INST_ID=%EW_INSTALLATION%
18
19@Rem Enable the appropriate commands below to build from a Windows Command
20@Rem Prompt window.  If you run a Microsoft Visual Studio or Intel Parallel
21@Rem Studio command-line tool from the Windows Start menu to do the build,
22@Rem you will not have to enable any commands here; the command-line tools
23@Rem run the appropriate commands for you.  See the inline comments below.
24
25@Rem The minimum required Microsoft Visual Studio is VS2015, Update 3.
26@Rem Microsoft Visual Studio Community (formerly Express) Editions are available
27@Rem for no cost.
28
29@Rem A Fortran compiler is optional.  The minimum Intel Fortran compiler version
30@Rem that supports Visual Studio 2015 is 15.0.4.221 (Composer/Parallel Studio XE
31@Rem 2015, Update 4).  Intel Fortran requires a license.
32
33@Rem To compile the Fortran modules, set FC to the Fortran compiler command
34
35@Rem Note: If Intel Fortran is installed, the Fortran environment setup will
36@Rem also set up the Visual Studio environment.
37
38@Rem The default is not to compile any Fortran modules
39Set FC=
40@Rem The Intel Fortran compiler command is ifort
41@Rem Set FC=ifort
42
43If "%EW_BITS%" == "32" ( Goto SETUP_START )
44If "%EW_BITS%" == "64" ( Goto SETUP_START )
45@Echo Error: EW_BITS must be 32 or 64
46@Exit /B 1
47
48:SETUP_START
49
50If "%FC%" == "" ( Goto SETUP_MSVC )
51
52@Rem Set up the Fortran compilation environment
53@Rem ------------------------------------------
54
55:SETUP_FC
56
57If NOT "%FC%" == "ifort" ( Goto END_IFORT )
58
59@Rem Set up Intel Fortran compilation environment
60@Rem --------------------------------------------
61
62Set target=
63If "%EW_BITS%" == "32" ( Set target=ia32    )
64If "%EW_BITS%" == "64" ( Set target=intel64 )
65
66@Rem Intel Parallel Studio (formerly Composer) XE 2015 Update 4 for Windows
67@Rem From the Start menu, select IA-32 Visual Studio 2015 mode,
68@Rem which will execute the following command; SDK 8.1 will be used
69@Rem Call "C:\Program Files (x86)\Intel\Composer XE 2015\bin\ifortvars.bat" %target%
70@Rem Intel Parallel Studio XE 2016 for Windows
71@Rem Call "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\bin\ifortvars.bat" %target%
72
73@Rem Define the Intel Fortran compiler options
74@Rem Extra run-time checks: /check:bounds,uninit
75@Rem ifort version 15 introduced the /Qinit option; older compilers complain, but ignore it
76@Rem ifort complains about comments past column 72; /warn:truncated_source is pretty useless
77@Rem Set FFLAGS=/nologo /O3 /Qinit:snan /Qinit:arrays /extend-source /warn:truncated_source /fpe-all:0 /check:bounds,uninit /Qdiag-disable:8290 /traceback
78Set FFLAGS=/nologo /O3 /Qinit:snan /Qinit:arrays /extend-source /warn:truncated_source /fpe-all:0 /Qdiag-disable:8290 /traceback
79
80@Rem FC_MAIN_IS_C is not necessary for MSVC
81@Rem Set FC_MAIN_IS_C=-nofor-main
82
83:END_IFORT
84
85@Rem Make sure the Fortran compiler is usable
86If NOT "%FC%" == "" (
87   where %FC% >NUL
88   If %ERRORLEVEL% NEQ 0 (
89      @Set FC=
90   )
91)
92
93@Rem The Intel Fortran compiler setup scripts also set up the MSVC environment
94If "%FC%" == "ifort" Goto :SETUP_END
95
96@Rem Set up Visual C++ compilation environment
97@Rem -----------------------------------------
98
99@Rem * Earthworm requires the C99 inttypes.h header and round() in math.h
100@Rem   The minimum MSVC++ version is 18.0 (Visual Studio 2013/12.0)
101@Rem * Earthworm requires the C99 size_t "z" format modifier
102@Rem   The minimum MSVC++ version is 19.0 (Visual Studio 2015/14.0)
103
104:SETUP_MSVC
105
106Set target=
107If "%EW_BITS%" == "32" ( Set target=x86   )
108If "%EW_BITS%" == "64" ( Set target=amd64 )
109
110@Rem From the Start menu, select VS2015 x64 Native Tools Command Prompt,
111@Rem which will execute the following command; SDK 8.1 will be used
112@Rem Call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %target%
113@Rem Call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %target%
114
115@Rem End of compiler(s) setup
116@Rem ------------------------
117
118:SETUP_END
119
120@Rem Set the path
121@Rem ------------
122Set PATH=%EW_HOME%\%EW_VERSION%\bin;%PATH%
123
124@Rem Set the INCLUDE path
125@Rem --------------------
126@Rem Include "include_win" directory for "NtWin32.Mak" file
127Set INCLUDE=%EW_HOME%\%EW_VERSION%\include;%EW_HOME%\%EW_VERSION%\include_win;%INCLUDE%
128@Rem Set the include MySQL path
129@Rem Set INCLUDE=%EW_HOME%\%EW_VERSION%\src\archiving\mole\mysql-connector-c-6.0.2\include;%INCLUDE%
130@Rem If you want to compile ew2moledb with another MySQL library, then
131@Rem Set the INCLUDE variable with your own mysql include dir and
132@Rem copy the library file mysqlclient.lib to the directory
133@Rem %EW_HOME%\%EW_VERSION%\src\archiving\mole\mysql-connector-c-build\lib
134
135@Rem Set the LIB (library) path
136@Rem --------------------------
137Set WIN_FLUSH_OBJ=commode.obj
138Set LIB=%EW_HOME%\%EW_VERSION%\lib;%LIB%
139
140@Rem Set C compiler flags here
141@Rem -------------------------
142
143Set GLOBALFLAGS=/D_WINNT /D_INTEL
144@Rem The /Od flag configures build for no optimization
145@Rem Remove /Od for default optimization; add /Ox for maximum optimization
146Set GLOBALFLAGS=%GLOBALFLAGS% /Od
147@Rem Define WIN32_LEAN_AND_MEAN (required) to disable #include <winsock.h> in windows.h
148@Rem otherwise winsock2.h fails (https://blogs.msdn.microsoft.com/oldnewthing/20091130-00/?p=15863)
149Set GLOBALFLAGS=%GLOBALFLAGS% /DWIN32_LEAN_AND_MEAN
150@Rem Define _CRT_SECURE_NO_DEPRECATE and _CRT_SECURE_NO_WARNINGS to suppress deprecation warnings
151Set GLOBALFLAGS=%GLOBALFLAGS% /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS
152@Rem Define _WINSOCK_DEPRECATED_NO_WARNINGS to suppress deprecation warnings
153Set GLOBALFLAGS=%GLOBALFLAGS% /D_WINSOCK_DEPRECATED_NO_WARNINGS
154@Rem Define _USE_32BIT_TIME_T for 32-bit-sized 'time_t' type (not supported on 64-bit builds)
155If "%EW_BITS%" == "32" ( Set GLOBALFLAGS=%GLOBALFLAGS% /D_USE_32BIT_TIME_T )
156Set CFLAGS=%GLOBALFLAGS%
157
158@Rem Set environment variables for Glass compilation
159@Rem -----------------------------------------------
160Set GLASS_DIR=%EW_HOME%\%EW_VERSION%\src\seismic_processing\glass
161
162@Rem Earthworm uses UTC
163@Rem ------------------
164Set TZ=GMT
165
166@Rem Set INIT, the path to the tools.ini file
167@Rem ----------------------------------------
168@Rem Used by nmake to set global compiler switches
169Set INIT=%EW_HOME%\%EW_VERSION%\environment
170
171PopD
Note: See TracBrowser for help on using the repository browser.