diff --git a/Build/Scripts/HYPRE/build_hypre.bat b/Build/Scripts/HYPRE/build_hypre.bat index 9261502d22a..bca01ee108d 100644 --- a/Build/Scripts/HYPRE/build_hypre.bat +++ b/Build/Scripts/HYPRE/build_hypre.bat @@ -18,7 +18,7 @@ if %stopscript% == 1 exit /b set abort=0 set buildstatus= call :is_file_installed cmake || set abort=1 -call :is_file_installed gcc || set abort=1 +call :is_file_installed make || set abort=1 if %abort% == 1 exit /b set CURDIR=%CD% @@ -72,7 +72,7 @@ cd %CURDIR% echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo building Hypre library version %LIB_TAG% +echo building hypre library version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. @@ -152,7 +152,7 @@ call make install echo. set HYPRE_HOME=%INSTALLDIR% -echo The Hypre library version %LIB_TAG% was built and installed in %INSTALLDIR% +echo The hypre library version %LIB_TAG% was built and installed in %INSTALLDIR% echo. echo ---------------------------------------------------------- @@ -246,7 +246,7 @@ exit /b :eof echo. echo. -if "%buildstatus%" == "norepo" echo The Hypre git repo does not exist, The Hypre library was not built. FDS will be built without it. -if "%buildstatus%" == "prebuilt" echo The Hypre library was not built. FDS will be built using the -if "%buildstatus%" == "prebuilt" echo Hypre library in %HYPRE_HOME% +if "%buildstatus%" == "norepo" echo The hypre git repo does not exist, The hypre library was not built. FDS will be built without it. +if "%buildstatus%" == "prebuilt" echo The hypre library exists. Skipping hypre build. FDS will be built using the +if "%buildstatus%" == "prebuilt" echo hypre library in %HYPRE_HOME% echo. diff --git a/Build/Scripts/SUNDIALS/build_sundials.bat b/Build/Scripts/SUNDIALS/build_sundials.bat index 65380cc1ff8..078f91136ef 100644 --- a/Build/Scripts/SUNDIALS/build_sundials.bat +++ b/Build/Scripts/SUNDIALS/build_sundials.bat @@ -16,7 +16,7 @@ if %stopscript% == 1 exit /b set abort=0 set buildstatus= call :is_file_installed cmake || set abort=1 -call :is_file_installed gcc || set abort=1 +call :is_file_installed make || set abort=1 if %abort% == 1 exit /b set CURDIR=%CD% @@ -56,7 +56,7 @@ if not exist %SUNDIALS_HOME% goto else4 set buildstatus=prebuilt goto endif4 :else4 - set build_status=norepo + set buildstatus=norepo :endif4 goto eof @@ -69,7 +69,7 @@ set buildstatus=build echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo building Sundials library version %LIB_TAG% +echo building sundials library version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. @@ -153,7 +153,7 @@ echo setting SUNDIALS_HOME environment variable to %INSTALLDIR% set SUNDIALS_HOME=%INSTALLDIR% echo. -echo The Sundials library version %LIB_TAG% was built and installed in %INSTALLDIR% +echo The sundials library version %LIB_TAG% was built and installed in %INSTALLDIR% echo. echo ---------------------------------------------------------- @@ -246,7 +246,7 @@ exit /b :eof echo. -if "%buildstatus%" == "norepo" echo The Sundials git repo does not exist, The Sundials library was not built. FDS will be built without it. -if "%buildstatus%" == "prebuilt" echo The Sundials library was not built. FDS will be built using the -if "%buildstatus%" == "prebuilt" echo Sundials library in %SUNDIALS_HOME% +if "%buildstatus%" == "norepo" echo The sundials git repo does not exist, The sundials library was not built. FDS will be built without it. +if "%buildstatus%" == "prebuilt" echo The sundials library exists. Skipping sundials build. FDS will be built using the +if "%buildstatus%" == "prebuilt" echo sundials library in %SUNDIALS_HOME% echo. diff --git a/Build/Scripts/build_thirdparty_libs.bat b/Build/Scripts/build_thirdparty_libs.bat index fe68f36c25b..08387e9b3ff 100644 --- a/Build/Scripts/build_thirdparty_libs.bat +++ b/Build/Scripts/build_thirdparty_libs.bat @@ -2,12 +2,13 @@ set clean_hypre= set clean_sundials= +set clean_fds= +set stopscript=0 set FDS_BUILDDIR=%CD% call :getopts %* if %stopscript% == 1 exit /b - goto eof :: ------------------------------------------------------------- @@ -17,6 +18,10 @@ goto eof if (%1)==() exit /b set valid=0 set arg=%1 + if /I "%1" EQU "--clean-fds" ( + set clean_fds=--clean-fds + set valid=1 + ) if /I "%1" EQU "--clean-hypre" ( set clean_hypre=--clean-hypre set valid=1 @@ -29,6 +34,7 @@ goto eof set valid=1 ) if /I "%1" EQU "--clean-all" ( + set clean_fds=--clean-fds set clean_hypre=--clean-hypre set clean_sundials=--clean-sundials set valid=1 @@ -38,6 +44,11 @@ goto eof set stopscript=1 exit /b ) + if /I "%1" EQU "--help" ( + call :usage + set stopscript=1 + exit /b + ) shift if %valid% == 0 ( echo. @@ -56,15 +67,23 @@ exit /b :: ------------------------------------------------------------- echo build 3rd party libraries echo. -echo --clean-all - rebuild all libraries +echo --clean-all - rebuild all libraries, remove .obj and .mod files from the fds build directory +echo --clean-fds - remove .obj and .mod files from the fds build directory echo --clean-hypre - rebuild hypre library echo --clean-sundials - rebuild sundials library -echo -help - display this message +echo --help - display this message exit /b :eof set CURDIR_3RDPARTY=%CD% + +if "x%clean_fds%" == "x" goto endif1 + echo. + echo removing .obj and .mod files from %CD% + erase *.obj *.mod > Nul 2> Nul +:endif1 + set SCRIPTDIR=%~dp0 cd %SCRIPTDIR% SET SCRIPTDIR=%CD% diff --git a/Build/Scripts/build_thirdparty_libs.sh b/Build/Scripts/build_thirdparty_libs.sh index 03226b8b82d..3a8e6c4aae8 100755 --- a/Build/Scripts/build_thirdparty_libs.sh +++ b/Build/Scripts/build_thirdparty_libs.sh @@ -7,6 +7,7 @@ fi echo "FIREMODELS=$FIREMODELS" +clean_fds=false clean_hypre=false clean_sundials=false ARG="" @@ -15,10 +16,15 @@ ARG="" while [[ $# -gt 0 ]]; do case "$1" in --clean-all) + clean_fds=true clean_hypre=true clean_sundials=true shift ;; + --clean-fds) + clean_fds=true + shift + ;; --clean-hypre) clean_hypre=true # Set the flag to true when --clean-hypre is used shift @@ -41,6 +47,11 @@ done # Trim leading spaces from ARG, if necessary ARG="${ARG#"${ARG%%[![:space:]]*}"}" +if [ "$clean_fds" = true ]; then + echo "Option --clean-fds is set." + rm *.o *.mod >& /dev/null +fi + if [ "$clean_hypre" = true ]; then echo "Option --clean-hypre is set." fi diff --git a/Build/impi_intel_win/make_fds.bat b/Build/impi_intel_win/make_fds.bat index 19668a1f8b6..050bf75486d 100644 --- a/Build/impi_intel_win/make_fds.bat +++ b/Build/impi_intel_win/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_db/make_fds.bat b/Build/impi_intel_win_db/make_fds.bat index 5eb6cfb11fd..ed0de466dc6 100644 --- a/Build/impi_intel_win_db/make_fds.bat +++ b/Build/impi_intel_win_db/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building debug FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_dv/make_fds.bat b/Build/impi_intel_win_dv/make_fds.bat index 2f8dc8cd080..4110afc2138 100644 --- a/Build/impi_intel_win_dv/make_fds.bat +++ b/Build/impi_intel_win_dv/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building DV FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_openmp/make_fds.bat b/Build/impi_intel_win_openmp/make_fds.bat index cde89571f39..70275cab254 100644 --- a/Build/impi_intel_win_openmp/make_fds.bat +++ b/Build/impi_intel_win_openmp/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_openmp_db/make_fds.bat b/Build/impi_intel_win_openmp_db/make_fds.bat index a040474b9c9..4d8649e1e68 100644 --- a/Build/impi_intel_win_openmp_db/make_fds.bat +++ b/Build/impi_intel_win_openmp_db/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building debug OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_openmp_dv/make_fds.bat b/Build/impi_intel_win_openmp_dv/make_fds.bat index e9babd4cbe7..ef84f8cea85 100644 --- a/Build/impi_intel_win_openmp_dv/make_fds.bat +++ b/Build/impi_intel_win_openmp_dv/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building dv OpenMP FDS (Intel MPI/%INTEL_IFORT% OpenMP) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET% diff --git a/Build/impi_intel_win_vt/make_fds.bat b/Build/impi_intel_win_vt/make_fds.bat index 19668a1f8b6..050bf75486d 100644 --- a/Build/impi_intel_win_vt/make_fds.bat +++ b/Build/impi_intel_win_vt/make_fds.bat @@ -1,6 +1,11 @@ @echo off set arg1=%1 +:: build hypre and/or sundials libraries if necessary + +call ..\Scripts\build_thirdparty_libs %* +if %stopscript% == 1 exit /b + for %%I in (.) do set TARGET=%%~nxI :: setup compiler environment @@ -8,8 +13,6 @@ if x%arg1% == xbot goto endif1 call ..\Scripts\setup_intel_compilers.bat :endif1 -::call ..\Scripts\build_thirdparty_libs %* - Title Building FDS (Intel MPI/%INTEL_IFORT%) for 64 bit Windows %TARGET% make SHELL="%ComSpec%" VPATH="../../Source" -f ..\makefile %TARGET%