Skip to content

Commit eb96cae

Browse files
authored
Merge pull request #13634 from cxp484/master
FDS Source: Add automatic Sundials build script
2 parents 361fd6f + daa5dfe commit eb96cae

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
CONFMAKE=$1
3+
CLEAN_SUNDIALS=$2
4+
5+
dir=`pwd`
6+
7+
echo "CLEAN_SUNDIALS = $CLEAN_SUNDIALS"
8+
if [ "$CLEAN_SUNDIALS" = true ]; then
9+
echo "Removing sundials library ..."
10+
rm -r $FIREMODELS/libs/sundials
11+
rm -r $FIREMODELS/sundials/BUILDDIR
12+
fi
13+
14+
echo "Checking for sundials library..."
15+
16+
if [ -d "$FIREMODELS/libs/sundials" ]; then
17+
echo "Sundials library exists. Skipping sundials build."
18+
# List all directories under $FIREMODELS/libs/sundials
19+
sundials_lib_dir=$(ls -d $FIREMODELS/libs/sundials/*/)
20+
# Extract the version part (removes the leading path)
21+
SUNDIALS_VERSION=$(basename $sundials_lib_dir)
22+
export SUNDIALS_HOME=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION
23+
echo "Sundials library:" $FIREMODELS/libs/sundials/$SUNDIALS_VERSION
24+
return 0
25+
else
26+
echo "Sundials library does not exist."
27+
fi
28+
29+
echo "Checking for sundials repository..."
30+
31+
if [ -d "$FIREMODELS/sundials" ]; then
32+
echo "Sundials repository exists. Building sundials library."
33+
mkdir $FIREMODELS/sundials/BUILDDIR
34+
cd $FIREMODELS/sundials/BUILDDIR
35+
36+
echo "Creating library directry..."
37+
export SUNDIALS_VERSION=$(git describe)
38+
mkdir $FIREMODELS/libs/sundials/$SUNDIALS_VERSION
39+
40+
echo "Cleaning sundials repository..."
41+
rm -r *
42+
cp $FIREMODELS/fds/Build/Scripts/SUNDIALS/$CONFMAKE .
43+
./$CONFMAKE
44+
45+
cd $dir
46+
export SUNDIALS_HOME=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION
47+
echo "Sundials library:" $FIREMODELS/libs/sundials/$SUNDIALS_VERSION
48+
return 0
49+
else
50+
echo "Sundials repository does not exist."
51+
fi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export SUNDIALS_INSTALL_PREFIX=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION
2+
3+
cmake ../ \
4+
-DCMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_PREFIX \
5+
-DEXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_PREFIX/examples \
6+
-DCMAKE_C_COMPILER=icx \
7+
-DCMAKE_CXX_COMPILER=icpx \
8+
-DCMAKE_Fortran_COMPILER=ifort \
9+
-DBUILD_FORTRAN_MODULE_INTERFACE=ON \
10+
-DEXAMPLES_ENABLE_CXX=OFF \
11+
-DEXAMPLES_ENABLE_CUDA=OFF \
12+
-DEXAMPLES_ENABLE_F2003=OFF \
13+
-DENABLE_OPENMP=ON
14+
15+
make install

Build/impi_intel_linux_db/make_fds.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ target=${dir##*/}
6868
source ../Scripts/HYPRE/build_hypre.sh confmake_impi_intel_linux.sh $clean_hypre
6969

7070
## build sundials
71-
#source ../Scripts/SUNDIALS/build_sundials.sh $arg-1 $arg-2 ... $clean_sundials
71+
source ../Scripts/SUNDIALS/build_sundials.sh confmake_impi_intel_linux.sh $clean_sundials
7272

7373
# build fds
7474
echo Building $target with Intel MPI and $INTEL_IFORT

0 commit comments

Comments
 (0)