Skip to content

Commit 24c3381

Browse files
committed
Build: choose c compilers for sundials build
1 parent 8a132ae commit 24c3381

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

Build/Scripts/SUNDIALS/confmake_impi_intel_linux.sh

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
export SUNDIALS_INSTALL_PREFIX=$FIREMODELS/libs/sundials/$SUNDIALS_VERSION
22

3+
# Check for Intel C compiler (icx or icc)
4+
if command -v icx &> /dev/null; then
5+
CC=icx
6+
elif command -v icc &> /dev/null; then
7+
CC=icc
8+
else
9+
echo "Error: Neither icx nor icc is available on this system."
10+
exit 1
11+
fi
12+
13+
# Check for Intel C++ compiler (icpx or icpc)
14+
if command -v icpx &> /dev/null; then
15+
CXX=icpx
16+
elif command -v icpc &> /dev/null; then
17+
CXX=icpc
18+
else
19+
echo "Error: Neither icpx nor icpc is available on this system."
20+
exit 1
21+
fi
22+
323
cmake ../ \
424
-DCMAKE_INSTALL_PREFIX=$SUNDIALS_INSTALL_PREFIX \
525
-DEXAMPLES_INSTALL_PATH=$SUNDIALS_INSTALL_PREFIX/examples \
6-
-DCMAKE_C_COMPILER=icx \
7-
-DCMAKE_CXX_COMPILER=icpx \
26+
-DCMAKE_C_COMPILER=$CC \
27+
-DCMAKE_CXX_COMPILER=$CXX \
828
-DCMAKE_Fortran_COMPILER=ifort \
929
-DBUILD_FORTRAN_MODULE_INTERFACE=ON \
1030
-DEXAMPLES_ENABLE_CXX=OFF \

0 commit comments

Comments
 (0)