Skip to content

Commit

Permalink
Merge pull request #13634 from cxp484/master
Browse files Browse the repository at this point in the history
FDS Source: Add automatic Sundials build script
  • Loading branch information
rmcdermo authored Oct 28, 2024
2 parents 361fd6f + daa5dfe commit eb96cae
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
51 changes: 51 additions & 0 deletions Build/Scripts/SUNDIALS/build_sundials.sh
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion Build/impi_intel_linux_db/make_fds.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb96cae

Please sign in to comment.