Skip to content

Commit 112f432

Browse files
authored
Merge pull request #13689 from gforney/master
add --clean-fds option to 3rd party library build scripts, fix a typo in sundials build script
2 parents b718fb4 + ee56541 commit 112f432

File tree

11 files changed

+81
-30
lines changed

11 files changed

+81
-30
lines changed

Build/Scripts/HYPRE/build_hypre.bat

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if %stopscript% == 1 exit /b
1818
set abort=0
1919
set buildstatus=
2020
call :is_file_installed cmake || set abort=1
21-
call :is_file_installed gcc || set abort=1
21+
call :is_file_installed make || set abort=1
2222
if %abort% == 1 exit /b
2323

2424
set CURDIR=%CD%
@@ -72,7 +72,7 @@ cd %CURDIR%
7272
echo.
7373
echo ----------------------------------------------------------
7474
echo ----------------------------------------------------------
75-
echo building Hypre library version %LIB_TAG%
75+
echo building hypre library version %LIB_TAG%
7676
echo ----------------------------------------------------------
7777
echo ----------------------------------------------------------
7878
echo.
@@ -152,7 +152,7 @@ call make install
152152

153153
echo.
154154
set HYPRE_HOME=%INSTALLDIR%
155-
echo The Hypre library version %LIB_TAG% was built and installed in %INSTALLDIR%
155+
echo The hypre library version %LIB_TAG% was built and installed in %INSTALLDIR%
156156
echo.
157157

158158
echo ----------------------------------------------------------
@@ -246,7 +246,7 @@ exit /b
246246
:eof
247247
echo.
248248
echo.
249-
if "%buildstatus%" == "norepo" echo The Hypre git repo does not exist, The Hypre library was not built. FDS will be built without it.
250-
if "%buildstatus%" == "prebuilt" echo The Hypre library was not built. FDS will be built using the
251-
if "%buildstatus%" == "prebuilt" echo Hypre library in %HYPRE_HOME%
249+
if "%buildstatus%" == "norepo" echo The hypre git repo does not exist, The hypre library was not built. FDS will be built without it.
250+
if "%buildstatus%" == "prebuilt" echo The hypre library exists. Skipping hypre build. FDS will be built using the
251+
if "%buildstatus%" == "prebuilt" echo hypre library in %HYPRE_HOME%
252252
echo.

Build/Scripts/SUNDIALS/build_sundials.bat

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ if %stopscript% == 1 exit /b
1616
set abort=0
1717
set buildstatus=
1818
call :is_file_installed cmake || set abort=1
19-
call :is_file_installed gcc || set abort=1
19+
call :is_file_installed make || set abort=1
2020
if %abort% == 1 exit /b
2121

2222
set CURDIR=%CD%
@@ -56,7 +56,7 @@ if not exist %SUNDIALS_HOME% goto else4
5656
set buildstatus=prebuilt
5757
goto endif4
5858
:else4
59-
set build_status=norepo
59+
set buildstatus=norepo
6060
:endif4
6161
goto eof
6262

@@ -69,7 +69,7 @@ set buildstatus=build
6969
echo.
7070
echo ----------------------------------------------------------
7171
echo ----------------------------------------------------------
72-
echo building Sundials library version %LIB_TAG%
72+
echo building sundials library version %LIB_TAG%
7373
echo ----------------------------------------------------------
7474
echo ----------------------------------------------------------
7575
echo.
@@ -153,7 +153,7 @@ echo setting SUNDIALS_HOME environment variable to %INSTALLDIR%
153153
set SUNDIALS_HOME=%INSTALLDIR%
154154
echo.
155155

156-
echo The Sundials library version %LIB_TAG% was built and installed in %INSTALLDIR%
156+
echo The sundials library version %LIB_TAG% was built and installed in %INSTALLDIR%
157157
echo.
158158

159159
echo ----------------------------------------------------------
@@ -246,7 +246,7 @@ exit /b
246246

247247
:eof
248248
echo.
249-
if "%buildstatus%" == "norepo" echo The Sundials git repo does not exist, The Sundials library was not built. FDS will be built without it.
250-
if "%buildstatus%" == "prebuilt" echo The Sundials library was not built. FDS will be built using the
251-
if "%buildstatus%" == "prebuilt" echo Sundials library in %SUNDIALS_HOME%
249+
if "%buildstatus%" == "norepo" echo The sundials git repo does not exist, The sundials library was not built. FDS will be built without it.
250+
if "%buildstatus%" == "prebuilt" echo The sundials library exists. Skipping sundials build. FDS will be built using the
251+
if "%buildstatus%" == "prebuilt" echo sundials library in %SUNDIALS_HOME%
252252
echo.

Build/Scripts/build_thirdparty_libs.bat

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
set clean_hypre=
44
set clean_sundials=
5+
set clean_fds=
6+
set stopscript=0
57
set FDS_BUILDDIR=%CD%
68

79
call :getopts %*
810
if %stopscript% == 1 exit /b
911

10-
1112
goto eof
1213

1314
:: -------------------------------------------------------------
@@ -17,6 +18,10 @@ goto eof
1718
if (%1)==() exit /b
1819
set valid=0
1920
set arg=%1
21+
if /I "%1" EQU "--clean-fds" (
22+
set clean_fds=--clean-fds
23+
set valid=1
24+
)
2025
if /I "%1" EQU "--clean-hypre" (
2126
set clean_hypre=--clean-hypre
2227
set valid=1
@@ -29,6 +34,7 @@ goto eof
2934
set valid=1
3035
)
3136
if /I "%1" EQU "--clean-all" (
37+
set clean_fds=--clean-fds
3238
set clean_hypre=--clean-hypre
3339
set clean_sundials=--clean-sundials
3440
set valid=1
@@ -38,6 +44,11 @@ goto eof
3844
set stopscript=1
3945
exit /b
4046
)
47+
if /I "%1" EQU "--help" (
48+
call :usage
49+
set stopscript=1
50+
exit /b
51+
)
4152
shift
4253
if %valid% == 0 (
4354
echo.
@@ -56,15 +67,23 @@ exit /b
5667
:: -------------------------------------------------------------
5768
echo build 3rd party libraries
5869
echo.
59-
echo --clean-all - rebuild all libraries
70+
echo --clean-all - rebuild all libraries, remove .obj and .mod files from the fds build directory
71+
echo --clean-fds - remove .obj and .mod files from the fds build directory
6072
echo --clean-hypre - rebuild hypre library
6173
echo --clean-sundials - rebuild sundials library
62-
echo -help - display this message
74+
echo --help - display this message
6375
exit /b
6476

6577
:eof
6678

6779
set CURDIR_3RDPARTY=%CD%
80+
81+
if "x%clean_fds%" == "x" goto endif1
82+
echo.
83+
echo removing .obj and .mod files from %CD%
84+
erase *.obj *.mod > Nul 2> Nul
85+
:endif1
86+
6887
set SCRIPTDIR=%~dp0
6988
cd %SCRIPTDIR%
7089
SET SCRIPTDIR=%CD%

Build/Scripts/build_thirdparty_libs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ fi
77

88
echo "FIREMODELS=$FIREMODELS"
99

10+
clean_fds=false
1011
clean_hypre=false
1112
clean_sundials=false
1213
ARG=""
@@ -15,10 +16,15 @@ ARG=""
1516
while [[ $# -gt 0 ]]; do
1617
case "$1" in
1718
--clean-all)
19+
clean_fds=true
1820
clean_hypre=true
1921
clean_sundials=true
2022
shift
2123
;;
24+
--clean-fds)
25+
clean_fds=true
26+
shift
27+
;;
2228
--clean-hypre)
2329
clean_hypre=true # Set the flag to true when --clean-hypre is used
2430
shift
@@ -41,6 +47,11 @@ done
4147
# Trim leading spaces from ARG, if necessary
4248
ARG="${ARG#"${ARG%%[![:space:]]*}"}"
4349

50+
if [ "$clean_fds" = true ]; then
51+
echo "Option --clean-fds is set."
52+
rm *.o *.mod >& /dev/null
53+
fi
54+
4455
if [ "$clean_hypre" = true ]; then
4556
echo "Option --clean-hypre is set."
4657
fi

Build/impi_intel_win/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

Build/impi_intel_win_db/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

Build/impi_intel_win_dv/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

Build/impi_intel_win_openmp/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

Build/impi_intel_win_openmp_db/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

Build/impi_intel_win_openmp_dv/make_fds.bat

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
@echo off
22
set arg1=%1
33

4+
:: build hypre and/or sundials libraries if necessary
5+
6+
call ..\Scripts\build_thirdparty_libs %*
7+
if %stopscript% == 1 exit /b
8+
49
for %%I in (.) do set TARGET=%%~nxI
510

611
:: setup compiler environment
712
if x%arg1% == xbot goto endif1
813
call ..\Scripts\setup_intel_compilers.bat
914
:endif1
1015

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

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

0 commit comments

Comments
 (0)