@@ -6,7 +6,9 @@ set LIB_TAG=v2.32.0
66set LIB_DIR = %LIB_TAG%
77
88
9- :: *** placehoder for parsing options
9+ :: *** parse options
10+
11+ set clean_hypre =
1012
1113call :getopts %*
1214if %stopscript% == 1 exit /b
@@ -28,34 +30,43 @@ cd %FIREMODELS%
2830set FIREMODELS = %CD%
2931cd %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
5051set 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
5970cd %CURDIR%
6071
6172echo .
@@ -92,15 +103,13 @@ git checkout %LIB_TAG%
92103echo .
93104echo ----------------------------------------------------------
94105echo ----------------------------------------------------------
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
96108echo ----------------------------------------------------------
97109echo ----------------------------------------------------------
98110echo .
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
104113cd %CURDIR%
105114
106115echo .
@@ -143,7 +152,7 @@ call make install
143152
144153echo .
145154set 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%
147156echo .
148157
149158cd %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:: -------------------------------------------------------------
211229echo build hypre
212230echo .
213- echo -help - display this message
231+ echo --clean-hypre - force build of hypre library
232+ echo --help - display this message
214233exit /b
215234
216235:eof
217236echo .
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 .
0 commit comments