Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions Build/Scripts/set_thirdparty_compilers.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
echo "FDS build target = $FDS_BUILD_TARGET"

# For following variables 1- indicate availble through
# environment variable FIREMODELS_CC, FIREMODELS_CXX, and FIREMODELS_FC
# environment variable FIREMODELS_LIBS_CC, FIREMODELS_LIBS_CXX, and FIREMODELS_LIBS_FC
set_CC=0
set_CXX=0
set_FC=0

if [ -n "$FIREMODELS_CC" ]; then
CC=$FIREMODELS_CC
if [ -n "$FIREMODELS_LIBS_CC" ]; then
CC=$FIREMODELS_LIBS_CC
if command -v $CC &> /dev/null; then
set_CC=1
else
echo "The compiler specified by the FIREMODELS_CC environment variable ($CC) is not available on this system. Searching for an alternative compiler."
echo "The compiler specified by the FIREMODELS_LIBS_CC environment variable ($CC) is not available on this system. Searching for an alternative compiler."
fi
fi

if [ -n "$FIREMODELS_CXX" ]; then
CXX=$FIREMODELS_CXX
if [ -n "$FIREMODELS_LIBS_CXX" ]; then
CXX=$FIREMODELS_LIBS_CXX
if command -v $CXX &> /dev/null; then
set_CXX=1
else
echo "The compiler specified by the FIREMODELS_CXX environment variable ($CXX) is not available on this system. Searching for an alternative compiler."
echo "The compiler specified by the FIREMODELS_LIBS_CXX environment variable ($CXX) is not available on this system. Searching for an alternative compiler."
fi
fi

if [ -n "$FIREMODELS_FC" ]; then
FC=$FIREMODELS_FC
if [ -n "$FIREMODELS_LIBS_FC" ]; then
FC=$FIREMODELS_LIBS_FC
if command -v $FC &> /dev/null; then
set_FC=1
else
echo "The compiler specified by the FIREMODELS_FC environment variable ($FC) is not available on this system. Searching for an alternative compiler."
echo "The compiler specified by the FIREMODELS_LIBS_FC environment variable ($FC) is not available on this system. Searching for an alternative compiler."
fi
fi

Expand All @@ -44,7 +44,7 @@ if [[ "$FDS_BUILD_TARGET" == *"osx"* ]]; then
elif command -v gcc &> /dev/null; then
CC=gcc
else
echo "Error: Any of mpicc, iclang, or gcc is not available on this system."
echo "Error: Any of mpicc, clang, or gcc compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -58,7 +58,7 @@ if [[ "$FDS_BUILD_TARGET" == *"osx"* ]]; then
elif command -v g++ &> /dev/null; then
CXX=g++
else
echo "Error: Any of mpicxx, clang++, or g++ is not available on this system."
echo "Error: Any of mpicxx, clang++, or g++ compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -70,7 +70,7 @@ if [[ "$FDS_BUILD_TARGET" == *"osx"* ]]; then
elif command -v gfortran &> /dev/null; then
FC=gfortran
else
echo "Error: gfortran is not available on this system."
echo "Error: Any of mpifort or gfortran compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -87,7 +87,7 @@ elif [[ "$FDS_BUILD_TARGET" == *"intel"* ]]; then
elif command -v icc &> /dev/null; then
CC=icc
else
echo "Error: Any of mpiicx, icx, mpiicc, or icc is not available on this system."
echo "Error: Any of mpiicx, icx, mpiicc, or icc compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -103,7 +103,7 @@ elif [[ "$FDS_BUILD_TARGET" == *"intel"* ]]; then
elif command -v icpc &> /dev/null; then
CXX=icpc
else
echo "Error: Any of mpiicpx, icpx, mpiicpc, or icpc is not available on this system."
echo "Error: Any of mpiicpx, icpx, mpiicpc, or icpc compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -115,7 +115,7 @@ elif [[ "$FDS_BUILD_TARGET" == *"intel"* ]]; then
elif command -v ifort &> /dev/null; then
FC=ifort
else
echo "Error: Any of mpiifort, or ifort is not available on this system."
echo "Error: Any of mpiifort, or ifort compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -127,7 +127,7 @@ else #gnu
elif command -v gcc &> /dev/null; then
CC=gcc
else
echo "Error: Any of mpicc, gcc is not available on this system."
echo "Error: Any of mpicc, gcc compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -139,7 +139,7 @@ else #gnu
elif command -v g++ &> /dev/null; then
CXX=g++
else
echo "Error: Any of mpicxx, g++ is not available on this system."
echo "Error: Any of mpicxx, g++ compiler is not available on this system."
exit 1
fi
fi
Expand All @@ -151,15 +151,15 @@ else #gnu
elif command -v gfortran &> /dev/null; then
FC=gfortran
else
echo "Error: Any of mpifort, gfortran is not available on this system."
echo "Error: Any of mpifort, gfortran compiler is not available on this system."
exit 1
fi
fi
fi

echo "C Compiler CC=$CC"
echo "C++ compiler CXX=$CXX"
echo "Fortran compiler FC=$FC"
echo "Third-party libs C Compiler=$CC"
echo "Third-party libs C++ compiler=$CXX"
echo "Third-party libs Fortran compiler=$FC"

export CC=$CC
export CXX=$CXX
Expand Down