Skip to content

Commit

Permalink
Build: choose c compilers for sundials build
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcdermo committed Oct 28, 2024
1 parent 8a132ae commit 24c3381
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
export SUNDIALS_INSTALL_PREFIX=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION

# Check for Intel C compiler (icx or icc)
if command -v icx &> /dev/null; then
CC=icx
elif command -v icc &> /dev/null; then
CC=icc
else
echo "Error: Neither icx nor icc is available on this system."
exit 1
fi

# Check for Intel C++ compiler (icpx or icpc)
if command -v icpx &> /dev/null; then
CXX=icpx
elif command -v icpc &> /dev/null; then
CXX=icpc
else
echo "Error: Neither icpx nor icpc is available on this system."
exit 1
fi

cmake ../ \
-DCMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_PREFIX \
-DEXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_PREFIX/examples \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_Fortran_COMPILER=ifort \
-DBUILD_FORTRAN_MODULE_INTERFACE=ON \
-DEXAMPLES_ENABLE_CXX=OFF \
Expand Down

0 comments on commit 24c3381

Please sign in to comment.