-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13634 from cxp484/master
FDS Source: Add automatic Sundials build script
- Loading branch information
Showing
3 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters