diff --git a/Build/Scripts/HYPRE/build_hypre.bat b/Build/Scripts/HYPRE/build_hypre.bat index 6722859ea20..ac4fc68d4fa 100644 --- a/Build/Scripts/HYPRE/build_hypre.bat +++ b/Build/Scripts/HYPRE/build_hypre.bat @@ -1,71 +1,95 @@ @echo off -set HYPREVERSION=2.31.0 -set HYPRETAG=v2.31.0 +set LIB_TAG=v2.32.0 + +::*** library and tag name are the same + +set LIB_DIR=%LIB_TAG% + + +::*** placehoder for parsing options call :getopts %* if %stopscript% == 1 exit /b -set have_setx=1 -call :have_program setx || set have_setx=0 +::*** make sure cmake and gcc are installed set abort=0 +set buildstatus= call :is_file_installed cmake || set abort=1 call :is_file_installed gcc || set abort=1 if %abort% == 1 exit /b set CURDIR=%CD% +::*** define root directory where fds repo and libs directories are located + set FIREMODELS=..\..\..\.. cd %FIREMODELS% set FIREMODELS=%CD% cd %CURDIR% -set LIBS=%FIREMODELS%\libs -if not exist %LIBS% mkdir %LIBS% -if not exist %LIBS% echo failed to create %LIBS% directory -if not exist %LIBS% exit +::*** if hypre library directory exists exit and use it + +set INSTALLDIR=%FIREMODELS%\libs\hypre\%LIB_DIR% +if not exist %INSTALLDIR% goto endif1 + set HYPRE_HOME=%INSTALLDIR% + set buildstatus=prebuilt + goto eof +:endif1 + +::*** if directory pointed to by HYPRE_HOME exists exit and use it + +if "x%HYPRE_HOME%" == "x" goto endif2 + if not exist %HYPRE_HOME% goto endif2 + set buildstatus=prebuilt + goto eof +:endif2 + +::*** if hypre repo does not exist exit and build fds without it + +set LIB_REPO=%FIREMODELS%\hypre +if exist %LIB_REPO% goto endif3 + set HYPRE_HOME= + set buildstatus=norepo + goto eof +:endif3 -cd %LIBS% -set LIBS=%CD% -if not exist %LIBS%\hypre mkdir %LIBS%\hypre -if not exist %LIBS%\hypre echo failed to create %LIBS%\hypre directory -if not exist %LIBS%\hypre exit +::*** if we've gotten this far the prebuilt libraries do not exist, the repo does exist so build the hypre library -set INSTALLDIR=%LIBS%\hypre\%HYPREVERSION% cd %CURDIR% +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo setting up Intel compilers +echo building Hypre library version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. -call %FIREMODELS%\fds\Build\Scripts\setup_intel_compilers.bat - -cd %CURDIR% - -set HYPRE=%FIREMODELS%\hypre -:: clone hypre repo (at same level as fds, smv etc repos) if it doesn't exist -if exist %HYPRE% goto endif1 +set buildstatus=build +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo cloning hypre from https://github.com/LLNL/hypre.git +echo setting up Intel compilers echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. +call %FIREMODELS%\fds\Build\Scripts\setup_intel_compilers.bat + +cd %CURDIR% - cd %FIREMODELS% - git clone https://github.com/hypre-space/hypre.git - cd hypre +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo checking out tag %HYPRETAG% +echo checking out tag %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. - git checkout %HYPRETAG% +cd %LIB_REPO% +git checkout %LIB_REPO%\src\config\HYPRE_config.h.cmake.in +git checkout %LIB_TAG% +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo modify HYPRE_config.h.cmake.in file @@ -74,12 +98,12 @@ echo ---------------------------------------------------------- echo. echo change HYPRE_FMANGLE line to #define HYPRE_FMANGLE 4 echo after saving file, press enter - notepad %HYPRE%\src\config\HYPRE_config.h.cmake.in +notepad %LIB_REPO%\src\config\HYPRE_config.h.cmake.in - pause - cd %CURDIR% -:endif1 +pause +cd %CURDIR% +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo cleaning hypre repo @@ -87,60 +111,39 @@ echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. -cd %HYPRE% -set HYPRE=%CD% +cd %LIB_REPO% git clean -dxf -:: configure hypre +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo configuring hypre version %HYPRETAG% +echo configuring hypre version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. -set BUILDDIR=%HYPRE%\src\cmbuild +set BUILDDIR=%LIB_REPO%\src\cmbuild cd %BUILDDIR% cmake ..\ ^ -G "MinGW Makefiles" ^ -DCMAKE_INSTALL_PREFIX="%INSTALLDIR%" ^ -DCMAKE_C_COMPILER=icx ^ -DCMAKE_C_FLAGS="/DWIN32 -O3 /fp:precise" ^ --DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" +-DCMAKE_MSVC_RUNTIME_LIBRARY="MultiThreaded" ^ +-DCMAKE_INSTALL_LIBDIR="lib" -:: build and install hypre +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo building and installing hypre version %HYPRETAG% +echo building and installing hypre version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. call make install -if %have_setx% == 0 goto else_setx -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo setting HYPRE_HOME environment variable to %INSTALLDIR% -setx HYPRE_HOME %INSTALLDIR% -echo note: the environment variable HYPRE_HOME takes effect after opening a new command shell -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- echo. -goto endif_setx -:else_setx -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo set environment variable HYPRE_HOME to %INSTALLDIR% -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo. -:endif_setx - -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo hypre version %HYPRETAG% installed in %INSTALLDIR% -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- +set HYPRE_HOME=%INSTALLDIR% +echo Hypre library version %LIB_TAG% built in %INSTALLDIR% echo. cd %CURDIR% @@ -210,4 +213,7 @@ echo. echo -help - display this message exit /b -:eof \ No newline at end of file +:eof +echo. +if "%buildstatus%" == "norepo" echo HYPRE library not built, The hypre git repo does not exist +if "%buildstatus%" == "prebuilt" echo HYPRE library not built. It exists in %HYPRE_HOME% diff --git a/Build/Scripts/SUNDIALS/build_sundials.bat b/Build/Scripts/SUNDIALS/build_sundials.bat index 71a5a37e0b7..ac78a83e298 100644 --- a/Build/Scripts/SUNDIALS/build_sundials.bat +++ b/Build/Scripts/SUNDIALS/build_sundials.bat @@ -1,72 +1,83 @@ @echo off -set SUNDIALSVERSION=6.7.0 -set SUNDIALSTAG=v6.7.0 +set LIB_TAG=v6.7.0 + +::*** library and tag name are the same + +set LIB_DIR=%LIB_TAG% + +::*** placehoder for parsing options call :getopts %* if %stopscript% == 1 exit /b -set have_setx=1 -call :have_program setx || set have_setx=0 +::*** make sure cmake and gcc are installed set abort=0 +set buildstatus= call :is_file_installed cmake || set abort=1 call :is_file_installed gcc || set abort=1 if %abort% == 1 exit /b set CURDIR=%CD% + +::*** define root directory where fds repo and libs directories are located + set FIREMODELS=..\..\..\.. cd %FIREMODELS% set FIREMODELS=%CD% cd %CURDIR% -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo setting up Intel compilers -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo. -call %FIREMODELS%\fds\Build\Scripts\setup_intel_compilers.bat +::*** if sundials library directory exists exit and use it -cd %CURDIR% +set INSTALLDIR=%FIREMODELS%\libs\sundials\%LIB_DIR% +if not exist %INSTALLDIR% goto endif1 + set SUNDIALS_HOME=%INSTALLDIR% + set buildstatus=prebuilt + goto eof +:endif1 -set LIBS=%FIREMODELS%\libs -if not exist %LIBS% mkdir %LIBS% -if not exist %LIBS% echo failed to create %LIBS% directory -if not exist %LIBS% exit - -cd %LIBS% -if not exist %LIBS%\sundials mkdir %LIBS%\sundials -if not exist %LIBS%\sundials echo failed to create %LIBS%\sundials directory -if not exist %LIBS%\sundials exit -set LIBS=%CD% -set INSTALLDIR=%LIBS%\sundials\%SUNDIALSVERSION% -cd %CURDIR% +::*** if directory pointed to by SUNDIALS_HOME exists exit and use it + +if "x%SUNDIALS_HOME%" == "x" goto endif2 + if not exist %SUNDIALS_HOME% goto endif2 + set buildstatus=prebuilt + goto eof +:endif2 +::*** if sundials repo does not exist exit and build fds without it -set SUNDIALS=%FIREMODELS%\sundials +set LIB_REPO=%FIREMODELS%\sundials +if exist %LIB_REPO% goto endif3 + set SUNDIALS_HOME= + set buildstatus=norepo + goto eof +:endif3 -:: clone sundials repo (at same level as fds, smv etc repos) if it doesn't exist -if exist %SUNDIALS% goto endif1 +::*** if we've gotten this far the prebuilt libraries do not exist, the repo does exist so build the sundials library + +cd %LIB_REPO% + +set buildstatus=build +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo cloning sundials from https://github.com/LLNL/sundials.git +echo building Sundials library version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. - cd %FIREMODELS% - git clone https://github.com/LLNL/sundials.git - cd sundials +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo checking out version %SUNDIALSTAG% +echo setting up Intel compilers echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. - git checkout %SUNDIALSTAG% - cd %CURDIR% -:endif1 +call %FIREMODELS%\fds\Build\Scripts\setup_intel_compilers.bat + +git checkout %LIB_TAG% +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo cleaning sundials repo @@ -74,15 +85,16 @@ echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. -cd %SUNDIALS% -set SUNDIALS=%CD% -set BUILDDIR=%SUNDIALS%\BUILDDIR +cd %LIB_REPO% +set BUILDDIR=%LIB_REPO%\BUILDDIR git clean -dxf mkdir %BUILDDIR% cd %BUILDDIR% -:: configure sundials +::*** configure sundials + +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo configuring sundials version %SUNDIALSTAG% @@ -102,48 +114,38 @@ cmake ..\ ^ -DEXAMPLES_ENABLE_F2003=OFF ^ -DENABLE_OPENMP=ON ^ -DBUILD_SHARED_LIBS=OFF ^ +-DCMAKE_INSTALL_LIBDIR="lib" ^ -DCMAKE_C_FLAGS_RELEASE="${CMAKE_C_FLAGS_RELEASE} /MT" ^ -DCMAKE_C_FLAGS_DEBUG="${CMAKE_C_FLAGS_DEBUG} /MTd" -:: build and install sundials +::*** build and install sundials + +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo building sundials version %SUNDIALSTAG% +echo building sundials version %LIB_TAG% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. call make +echo. echo ---------------------------------------------------------- echo ---------------------------------------------------------- -echo installing sundials version %SUNDIALSTAG% in %INSTALLDIR% +echo installing sundials version %LIB_TAG% in %INSTALLDIR% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. call make install -if %have_setx% == 0 goto else_setx -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo setting SUNDIALS_HOME environment variable to %INSTALLDIR% -setx SUNDIALS_HOME %INSTALLDIR% -echo note: the environment variable SUNDIALS_HOME takes effect after opening a new command shell -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- echo. -goto endif_setx -:else_setx -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo set environment variable SUNDIALS_HOME to %INSTALLDIR% echo ---------------------------------------------------------- echo ---------------------------------------------------------- +echo setting SUNDIALS_HOME environment variable to %INSTALLDIR% +set SUNDIALS_HOME=%INSTALLDIR% echo. -:endif_setx -echo ---------------------------------------------------------- -echo ---------------------------------------------------------- -echo sundials version %SUNDIALSTAG% installed in %INSTALLDIR% +echo sundials version %LIB_TAG% installed in %INSTALLDIR% echo ---------------------------------------------------------- echo ---------------------------------------------------------- echo. @@ -215,4 +217,7 @@ echo. echo -help - display this message exit /b -:eof \ No newline at end of file +:eof +echo. +if "%buildstatus%" == "norepo" echo Sundials library not built, The sundials git repo does not exist +if "%buildstatus%" == "prebuilt" echo Sundials library not built. It exists in %SUNDIALS_HOME%