source: trunk/environment/ew_nt.cmd @ 7952

Revision 7952, 6.5 KB checked in by baker, 3 months ago (diff)

move APPVER from tools.ini to ew_nt.cmd and document its purpose; delete uneeded tools.ini

  • 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_TARGET
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:SETUP_TARGET
116
117@Rem Set the target Windows OS version to Windows 7
118@Rem and the target SDK version to 8.1 for Win32.Mak
119@Rem -----------------------------------------------
120Set APPVER=6.1
121
122@Rem End of compiler(s) setup
123@Rem ------------------------
124
125@Rem Set the path
126@Rem ------------
127Set PATH=%EW_HOME%\%EW_VERSION%\bin;%PATH%
128
129@Rem Set the INCLUDE path
130@Rem --------------------
131@Rem Include "include_win" directory for "NtWin32.Mak" file
132Set INCLUDE=%EW_HOME%\%EW_VERSION%\include;%EW_HOME%\%EW_VERSION%\include_win;%INCLUDE%
133@Rem Set the include MySQL path
134@Rem Set INCLUDE=%EW_HOME%\%EW_VERSION%\src\archiving\mole\mysql-connector-c-6.0.2\include;%INCLUDE%
135@Rem If you want to compile ew2moledb with another MySQL library, then
136@Rem Set the INCLUDE variable with your own mysql include dir and
137@Rem copy the library file mysqlclient.lib to the directory
138@Rem %EW_HOME%\%EW_VERSION%\src\archiving\mole\mysql-connector-c-build\lib
139
140@Rem Set the LIB (library) path
141@Rem --------------------------
142Set WIN_FLUSH_OBJ=commode.obj
143Set LIB=%EW_HOME%\%EW_VERSION%\lib;%LIB%
144
145@Rem Set C compiler flags here
146@Rem -------------------------
147
148Set GLOBALFLAGS=/D_WINNT /D_INTEL
149@Rem The /Od flag configures build for no optimization
150@Rem Remove /Od for default optimization; add /Ox for maximum optimization
151Set GLOBALFLAGS=%GLOBALFLAGS% /Od
152@Rem Define WIN32_LEAN_AND_MEAN (required) to disable #include <winsock.h> in windows.h
153@Rem otherwise winsock2.h fails (https://blogs.msdn.microsoft.com/oldnewthing/20091130-00/?p=15863)
154Set GLOBALFLAGS=%GLOBALFLAGS% /DWIN32_LEAN_AND_MEAN
155@Rem Define _CRT_SECURE_NO_DEPRECATE and _CRT_SECURE_NO_WARNINGS to suppress deprecation warnings
156Set GLOBALFLAGS=%GLOBALFLAGS% /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS
157@Rem Define _WINSOCK_DEPRECATED_NO_WARNINGS to suppress deprecation warnings
158Set GLOBALFLAGS=%GLOBALFLAGS% /D_WINSOCK_DEPRECATED_NO_WARNINGS
159@Rem Define _USE_32BIT_TIME_T for 32-bit-sized 'time_t' type (not supported on 64-bit builds)
160If "%EW_BITS%" == "32" ( Set GLOBALFLAGS=%GLOBALFLAGS% /D_USE_32BIT_TIME_T )
161Set CFLAGS=%GLOBALFLAGS%
162
163@Rem Set environment variables for Glass compilation
164@Rem -----------------------------------------------
165Set GLASS_DIR=%EW_HOME%\%EW_VERSION%\src\seismic_processing\glass
166
167@Rem Earthworm uses UTC
168@Rem ------------------
169Set TZ=GMT
170
171PopD
Note: See TracBrowser for help on using the repository browser.