Skip to content

Commit f92666e

Browse files
authored
Merge pull request #13682 from gforney/master
modify the windows sundials and hypre build scripts so they are consistent with the linux/osx build scripts
2 parents c4663a4 + 46b3634 commit f92666e

File tree

11 files changed

+185
-48
lines changed

11 files changed

+185
-48
lines changed

Build/Scripts/HYPRE/build_hypre.bat

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ set LIB_TAG=v2.32.0
66
set LIB_DIR=%LIB_TAG%
77

88

9-
::*** placehoder for parsing options
9+
::*** parse options
10+
11+
set clean_hypre=
1012

1113
call :getopts %*
1214
if %stopscript% == 1 exit /b
@@ -28,34 +30,43 @@ cd %FIREMODELS%
2830
set FIREMODELS=%CD%
2931
cd %CURDIR%
3032

33+
set INSTALLDIR=%FIREMODELS%\libs\hypre\%LIB_DIR%
34+
35+
::*** erase install directory if clean option was specified
36+
37+
if "x%clean_hypre%" == "x" goto endif1
38+
if exist %INSTALLDIR% rmdir /s /q %INSTALLDIR%
39+
:endif1
40+
3141
::*** if hypre library directory exists exit and use it
3242

33-
set INSTALLDIR=%FIREMODELS%\libs\hypre\%LIB_DIR%
34-
if not exist %INSTALLDIR% goto endif1
43+
if not exist %INSTALLDIR% goto endif2
3544
set HYPRE_HOME=%INSTALLDIR%
3645
set buildstatus=prebuilt
3746
goto eof
38-
:endif1
39-
40-
::*** if directory pointed to by HYPRE_HOME exists exit and use it
41-
42-
if "x%HYPRE_HOME%" == "x" goto endif2
43-
if not exist %HYPRE_HOME% goto endif2
44-
set buildstatus=prebuilt
45-
goto eof
4647
:endif2
4748

48-
::*** if hypre repo does not exist exit and build fds without it
49+
::*** if hypre repo exists build library
4950

5051
set LIB_REPO=%FIREMODELS%\hypre
51-
if exist %LIB_REPO% goto endif3
52+
if exist %LIB_REPO% goto buildlib
53+
54+
::*** if directory pointed to by HYPRE_HOME exists exit and use it
55+
:: if it doesn't exist then exit and build fds without the hypre library
56+
57+
if "x%HYPRE_HOME%" == "x" goto else4
58+
if not exist %HYPRE_HOME% goto else4
59+
set buildstatus=prebuilt
60+
goto endif4
61+
:else4
5262
set HYPRE_HOME=
5363
set buildstatus=norepo
54-
goto eof
55-
:endif3
64+
:endif4
65+
goto eof
5666

5767
::*** if we've gotten this far the prebuilt libraries do not exist, the repo does exist so build the hypre library
5868

69+
:buildlib
5970
cd %CURDIR%
6071

6172
echo.
@@ -92,15 +103,13 @@ git checkout %LIB_TAG%
92103
echo.
93104
echo ----------------------------------------------------------
94105
echo ----------------------------------------------------------
95-
echo modify HYPRE_config.h.cmake.in file
106+
echo changing HYPRE_FMANGLE 0 to HYPRE_FMANGLE 4
107+
echo in the file HYPRE_config.h.cmake.in
96108
echo ----------------------------------------------------------
97109
echo ----------------------------------------------------------
98110
echo.
99-
echo change HYPRE_FMANGLE line to #define HYPRE_FMANGLE 4
100-
echo after saving file, press enter
101-
notepad %LIB_REPO%\src\config\HYPRE_config.h.cmake.in
111+
powershell -Command "(Get-Content %LIB_REPO%\src\config\HYPRE_config.h.cmake.in) -replace 'HYPRE_FMANGLE 0', 'HYPRE_FMANGLE 4' | Set-Content %LIB_REPO%\src\config\HYPRE_config.h.cmake.in"
102112

103-
pause
104113
cd %CURDIR%
105114

106115
echo.
@@ -143,7 +152,7 @@ call make install
143152

144153
echo.
145154
set HYPRE_HOME=%INSTALLDIR%
146-
echo Hypre library version %LIB_TAG% built in %INSTALLDIR%
155+
echo The Hypre library version %LIB_TAG% was built and installed in %INSTALLDIR%
147156
echo.
148157

149158
cd %CURDIR%
@@ -157,6 +166,15 @@ goto eof
157166
if (%1)==() exit /b
158167
set valid=0
159168
set arg=%1
169+
if /I "%1" EQU "--clean-hypre" (
170+
set clean_hypre=1
171+
set valid=1
172+
)
173+
if /I "%1" EQU "--help" (
174+
call :usage
175+
set stopscript=1
176+
exit /b
177+
)
160178
if /I "%1" EQU "-help" (
161179
call :usage
162180
set stopscript=1
@@ -210,10 +228,14 @@ exit /b
210228
:: -------------------------------------------------------------
211229
echo build hypre
212230
echo.
213-
echo -help - display this message
231+
echo --clean-hypre - force build of hypre library
232+
echo --help - display this message
214233
exit /b
215234

216235
:eof
217236
echo.
218-
if "%buildstatus%" == "norepo" echo HYPRE library not built, The hypre git repo does not exist
219-
if "%buildstatus%" == "prebuilt" echo HYPRE library not built. It exists in %HYPRE_HOME%
237+
echo.
238+
if "%buildstatus%" == "norepo" echo The Hypre git repo does not exist, The Hypre library was not built. FDS will be built without it.
239+
if "%buildstatus%" == "prebuilt" echo The Hypre library was not built. FDS will be built using the
240+
if "%buildstatus%" == "prebuilt" echo Hypre library in %HYPRE_HOME%
241+
echo.

Build/Scripts/SUNDIALS/build_sundials.bat

Lines changed: 42 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ set LIB_TAG=v6.7.0
55

66
set LIB_DIR=%LIB_TAG%
77

8-
::*** placehoder for parsing options
8+
::*** parse options
99

10+
set clean_sundials=
1011
call :getopts %*
1112
if %stopscript% == 1 exit /b
1213

@@ -27,34 +28,41 @@ cd %FIREMODELS%
2728
set FIREMODELS=%CD%
2829
cd %CURDIR%
2930

31+
set INSTALLDIR=%FIREMODELS%\libs\sundials\%LIB_DIR%
32+
33+
::*** erase directory if it exists and clean option was specified
34+
35+
if "x%clean_sundials%" == "x" goto endif1
36+
if exist %INSTALLDIR% rmdir /s /q %INSTALLDIR%
37+
:endif1
38+
3039
::*** if sundials library directory exists exit and use it
3140

32-
set INSTALLDIR=%FIREMODELS%\libs\sundials\%LIB_DIR%
33-
if not exist %INSTALLDIR% goto endif1
41+
if not exist %INSTALLDIR% goto endif2
3442
set SUNDIALS_HOME=%INSTALLDIR%
3543
set buildstatus=prebuilt
3644
goto eof
37-
:endif1
38-
39-
::*** if directory pointed to by SUNDIALS_HOME exists exit and use it
40-
41-
if "x%SUNDIALS_HOME%" == "x" goto endif2
42-
if not exist %SUNDIALS_HOME% goto endif2
43-
set buildstatus=prebuilt
44-
goto eof
4545
:endif2
4646

47-
::*** if sundials repo does not exist exit and build fds without it
47+
::*** sundials library doesn't exist, if sundials repo exists build sundials library
4848

4949
set LIB_REPO=%FIREMODELS%\sundials
50-
if exist %LIB_REPO% goto endif3
51-
set SUNDIALS_HOME=
52-
set buildstatus=norepo
53-
goto eof
54-
:endif3
50+
if exist %LIB_REPO% goto buildlib
51+
52+
::*** if directory pointed to by SUNDIALS_HOME exists exit and use it
53+
54+
if "x%SUNDIALS_HOME%" == "x" goto else4
55+
if not exist %SUNDIALS_HOME% goto else4
56+
set buildstatus=prebuilt
57+
goto endif4
58+
:else4
59+
set build_status=norepo
60+
:endif4
61+
goto eof
5562

5663
::*** if we've gotten this far the prebuilt libraries do not exist, the repo does exist so build the sundials library
5764

65+
:buildlib
5866
cd %LIB_REPO%
5967

6068
set buildstatus=build
@@ -145,9 +153,7 @@ echo setting SUNDIALS_HOME environment variable to %INSTALLDIR%
145153
set SUNDIALS_HOME=%INSTALLDIR%
146154
echo.
147155

148-
echo sundials version %LIB_TAG% installed in %INSTALLDIR%
149-
echo ----------------------------------------------------------
150-
echo ----------------------------------------------------------
156+
echo The Sundials library version %LIB_TAG% was built and installed in %INSTALLDIR%
151157
echo.
152158

153159
cd %CURDIR%
@@ -161,7 +167,16 @@ goto eof
161167
if (%1)==() exit /b
162168
set valid=0
163169
set arg=%1
164-
if /I "%1" EQU "-help" (
170+
if /I "%1" EQU "--clean-sundials" (
171+
set clean_sundials=1
172+
set valid=1
173+
)
174+
if /I "%1" EQU "--help" (
175+
call :usage
176+
set stopscript=1
177+
exit /b
178+
)
179+
if /I "%1" EQU "-help" (
165180
call :usage
166181
set stopscript=1
167182
exit /b
@@ -214,10 +229,13 @@ exit /b
214229
:: -------------------------------------------------------------
215230
echo build sundials
216231
echo.
217-
echo -help - display this message
232+
echo --clean-sundials - force build of sundials library
233+
echo --help - display this message
218234
exit /b
219235

220236
:eof
221237
echo.
222-
if "%buildstatus%" == "norepo" echo Sundials library not built, The sundials git repo does not exist
223-
if "%buildstatus%" == "prebuilt" echo Sundials library not built. It exists in %SUNDIALS_HOME%
238+
if "%buildstatus%" == "norepo" echo The Sundials git repo does not exist, The Sundials library was not built. FDS will be built without it.
239+
if "%buildstatus%" == "prebuilt" echo The Sundials library was not built. FDS will be built using the
240+
if "%buildstatus%" == "prebuilt" echo Sundials library in %SUNDIALS_HOME%
241+
echo.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
@echo off
2+
3+
set clean_hypre=
4+
set clean_sundials=
5+
set FDS_BUILDDIR=%CD%
6+
7+
call :getopts %*
8+
if %stopscript% == 1 exit /b
9+
10+
11+
goto eof
12+
13+
:: -------------------------------------------------------------
14+
:getopts
15+
:: -------------------------------------------------------------
16+
set stopscript=0
17+
if (%1)==() exit /b
18+
set valid=0
19+
set arg=%1
20+
if /I "%1" EQU "--clean-hypre" (
21+
set clean_hypre=--clean-hypre
22+
set valid=1
23+
)
24+
if /I "%1" EQU "bot" (
25+
set valid=1
26+
)
27+
if /I "%1" EQU "--clean-sundials" (
28+
set clean_sundials=--clean-sundials
29+
set valid=1
30+
)
31+
if /I "%1" EQU "--clean-all" (
32+
set clean_hypre=--clean-hypre
33+
set clean_sundials=--clean-sundials
34+
set valid=1
35+
)
36+
if /I "%1" EQU "-help" (
37+
call :usage
38+
set stopscript=1
39+
exit /b
40+
)
41+
shift
42+
if %valid% == 0 (
43+
echo.
44+
echo ***Error: the input argument %arg% is invalid
45+
echo.
46+
echo Usage:
47+
call :usage
48+
set stopscript=1
49+
exit /b
50+
)
51+
if not (%1)==() goto getopts
52+
exit /b
53+
54+
:: -------------------------------------------------------------
55+
:usage
56+
:: -------------------------------------------------------------
57+
echo build 3rd party libraries
58+
echo.
59+
echo --clean-all - rebuild all libraries
60+
echo --clean-hypre - rebuild hypre library
61+
echo --clean-sundials - rebuild sundials library
62+
echo -help - display this message
63+
exit /b
64+
65+
:eof
66+
67+
set CURDIR_3RDPARTY=%CD%
68+
set SCRIPTDIR=%~dp0
69+
cd %SCRIPTDIR%
70+
SET SCRIPTDIR=%CD%
71+
72+
cd %SCRIPTDIR%\HYPRE
73+
call build_hypre %clean_hypre%
74+
75+
cd %SCRIPTDIR%\SUNDIALS
76+
call build_sundials %clean_sundials%
77+
78+
cd %CURDIR_3RDPARTY%

Build/Scripts/build_thirdparty_libs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ ARG=""
1414
# Loop through the options
1515
while [[ $# -gt 0 ]]; do
1616
case "$1" in
17+
--clean-all)
18+
clean_hypre=true
19+
clean_sundials=true
20+
shift
21+
;;
1722
--clean-hypre)
1823
clean_hypre=true # Set the flag to true when --clean-hypre is used
1924
shift

Build/impi_intel_win/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

Build/impi_intel_win_db/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building debug FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

Build/impi_intel_win_dv/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building DV FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

Build/impi_intel_win_openmp/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

Build/impi_intel_win_openmp_db/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building debug OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

Build/impi_intel_win_openmp_dv/make_fds.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ if x%arg1% == xbot goto endif1
88
call ..\Scripts\setup_intel_compilers.bat
99
:endif1
1010

11+
::call ..\Scripts\build_thirdparty_libs %*
12+
1113
Title Building dv OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET%
1214

1315
make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%

0 commit comments

Comments
 (0)