Changed default COMPILER to new target "system"
The new compiler target "system" will neither load a compiler module nor set the environment variables CC, CXX, FC and F77.
This commit is contained in:
parent
74c2549899
commit
a733363f1e
1 changed files with 19 additions and 10 deletions
29
sit
29
sit
|
@ -20,7 +20,7 @@ source "$SIT_PATH/functions.sh"
|
|||
|
||||
# compiler to use
|
||||
# (gnu|intel|pgi)
|
||||
COMPILER=${COMPILER:=gnu}
|
||||
COMPILER=${COMPILER:=system}
|
||||
# use specific compiler version
|
||||
COMPILER_VERSION=${COMPILER_VERSION:=}
|
||||
|
||||
|
@ -29,19 +29,25 @@ COMPILER_VERSION=${COMPILER_VERSION:=}
|
|||
PACKAGE_DESCRIPTOR=${PACKAGE_DESCRIPTOR:+-$PACKAGE_DESCRIPTOR}
|
||||
|
||||
|
||||
|
||||
# Compiler specifications
|
||||
|
||||
if [ -z "$COMPILER_VERSION" ] ; then
|
||||
COMPILER_MODULE=compiler/${COMPILER}
|
||||
else
|
||||
COMPILER_MODULE=compiler/${COMPILER}/${COMPILER_VERSION}
|
||||
if [ "$COMPILER" == "system" ] ; then
|
||||
echo "Using system default compiler"
|
||||
else
|
||||
if [ -z "$COMPILER_VERSION" ] ; then
|
||||
COMPILER_MODULE=compiler/${COMPILER}
|
||||
else
|
||||
COMPILER_MODULE=compiler/${COMPILER}/${COMPILER_VERSION}
|
||||
fi
|
||||
|
||||
echo "Loading compiler module ${COMPILER_MODULE}"
|
||||
module load ${COMPILER_MODULE}
|
||||
fi
|
||||
|
||||
echo "Loading compiler module ${COMPILER_MODULE}"
|
||||
module load ${COMPILER_MODULE}
|
||||
|
||||
case ${COMPILER} in
|
||||
system)
|
||||
COMPILER="" # prevent any compiler specs in the prefix
|
||||
;;
|
||||
gnu)
|
||||
COMPILER_OPTS="CC=gcc CXX=g++ FC=gfortran F77=gfortran"
|
||||
if [ "x${COMPILER_VERSION}" == "x" ] ; then
|
||||
|
@ -64,8 +70,11 @@ case ${COMPILER} in
|
|||
echo "Unknown compiler ${COMPILER}."
|
||||
;;
|
||||
esac
|
||||
|
||||
# make the compiler variables CC, CXX, FC and F77 available
|
||||
export ${COMPILER_OPTS}
|
||||
if [ ! -z $COMPILER_OPTS ] ; then
|
||||
export ${COMPILER_OPTS}
|
||||
fi
|
||||
|
||||
if [ ! -z "$MPI" ] ; then
|
||||
MPI_MODULE="mpi/$MPI"
|
||||
|
|
Loading…
Reference in a new issue