diff --git a/Build/Scripts/SUNDIALS/build_sundials.sh b/Build/Scripts/SUNDIALS/build_sundials.sh new file mode 100755 index 00000000000..3c4bc1934c2 --- /dev/null +++ b/Build/Scripts/SUNDIALS/build_sundials.sh @@ -0,0 +1,51 @@ +#!/bin/bash +CONFMAKE=$1 +CLEAN_SUNDIALS=$2 + +dir=`pwd` + +echo "CLEAN_SUNDIALS = $CLEAN_SUNDIALS" +if [ "$CLEAN_SUNDIALS" = true ]; then + echo "Removing sundials library ..." + rm -r $FIREMODELS/libs/sundials + rm -r $FIREMODELS/sundials/BUILDDIR +fi + +echo "Checking for sundials library..." + +if [ -d "$FIREMODELS/libs/sundials" ]; then + echo "Sundials library exists. Skipping sundials build." + # List all directories under $FIREMODELS/libs/sundials + sundials_lib_dir=$(ls -d $FIREMODELS/libs/sundials/*/) + # Extract the version part (removes the leading path) + SUNDIALS_VERSION=$(basename $sundials_lib_dir) + export SUNDIALS_HOME=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION + echo "Sundials library:" $FIREMODELS/libs/sundials/$SUNDIALS_VERSION + return 0 +else + echo "Sundials library does not exist." +fi + +echo "Checking for sundials repository..." + +if [ -d "$FIREMODELS/sundials" ]; then + echo "Sundials repository exists. Building sundials library." + mkdir $FIREMODELS/sundials/BUILDDIR + cd $FIREMODELS/sundials/BUILDDIR + + echo "Creating library directry..." + export SUNDIALS_VERSION=$(git describe) + mkdir $FIREMODELS/libs/sundials/$SUNDIALS_VERSION + + echo "Cleaning sundials repository..." + rm -r * + cp $FIREMODELS/fds/Build/Scripts/SUNDIALS/$CONFMAKE . + ./$CONFMAKE + + cd $dir + export SUNDIALS_HOME=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION + echo "Sundials library:" $FIREMODELS/libs/sundials/$SUNDIALS_VERSION + return 0 +else + echo "Sundials repository does not exist." +fi diff --git a/Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh b/Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh new file mode 100755 index 00000000000..7b5a6410028 --- /dev/null +++ b/Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh @@ -0,0 +1,15 @@ +export SUNDIALS_INSTALL_PREFIX=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION + +cmake ../ \ +-DCMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_PREFIX \ +-DEXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_PREFIX/examples \ +-DCMAKE_C_COMPILER=icx \ +-DCMAKE_CXX_COMPILER=icpx \ +-DCMAKE_Fortran_COMPILER=ifort \ +-DBUILD_FORTRAN_MODULE_INTERFACE=ON \ +-DEXAMPLES_ENABLE_CXX=OFF \ +-DEXAMPLES_ENABLE_CUDA=OFF \ +-DEXAMPLES_ENABLE_F2003=OFF \ +-DENABLE_OPENMP=ON + +make install diff --git a/Build/impi_intel_linux_db/make_fds.sh b/Build/impi_intel_linux_db/make_fds.sh index 51e87780c45..293acd281e7 100755 --- a/Build/impi_intel_linux_db/make_fds.sh +++ b/Build/impi_intel_linux_db/make_fds.sh @@ -68,7 +68,7 @@ target=${dir##*/} source ../Scripts/HYPRE/build_hypre.sh confmake_impi_intel_linux.sh $clean_hypre ## build sundials -#source ../Scripts/SUNDIALS/build_sundials.sh $arg-1 $arg-2 ... $clean_sundials +source ../Scripts/SUNDIALS/build_sundials.sh confmake_impi_intel_linux.sh $clean_sundials # build fds echo Building $target with Intel MPI and $INTEL_IFORT