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
|
# compiler to use
|
||||||
# (gnu|intel|pgi)
|
# (gnu|intel|pgi)
|
||||||
COMPILER=${COMPILER:=gnu}
|
COMPILER=${COMPILER:=system}
|
||||||
# use specific compiler version
|
# use specific compiler version
|
||||||
COMPILER_VERSION=${COMPILER_VERSION:=}
|
COMPILER_VERSION=${COMPILER_VERSION:=}
|
||||||
|
|
||||||
|
@ -29,19 +29,25 @@ COMPILER_VERSION=${COMPILER_VERSION:=}
|
||||||
PACKAGE_DESCRIPTOR=${PACKAGE_DESCRIPTOR:+-$PACKAGE_DESCRIPTOR}
|
PACKAGE_DESCRIPTOR=${PACKAGE_DESCRIPTOR:+-$PACKAGE_DESCRIPTOR}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Compiler specifications
|
# Compiler specifications
|
||||||
|
|
||||||
if [ -z "$COMPILER_VERSION" ] ; then
|
if [ "$COMPILER" == "system" ] ; then
|
||||||
COMPILER_MODULE=compiler/${COMPILER}
|
echo "Using system default compiler"
|
||||||
else
|
else
|
||||||
COMPILER_MODULE=compiler/${COMPILER}/${COMPILER_VERSION}
|
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
|
fi
|
||||||
|
|
||||||
echo "Loading compiler module ${COMPILER_MODULE}"
|
|
||||||
module load ${COMPILER_MODULE}
|
|
||||||
|
|
||||||
case ${COMPILER} in
|
case ${COMPILER} in
|
||||||
|
system)
|
||||||
|
COMPILER="" # prevent any compiler specs in the prefix
|
||||||
|
;;
|
||||||
gnu)
|
gnu)
|
||||||
COMPILER_OPTS="CC=gcc CXX=g++ FC=gfortran F77=gfortran"
|
COMPILER_OPTS="CC=gcc CXX=g++ FC=gfortran F77=gfortran"
|
||||||
if [ "x${COMPILER_VERSION}" == "x" ] ; then
|
if [ "x${COMPILER_VERSION}" == "x" ] ; then
|
||||||
|
@ -64,8 +70,11 @@ case ${COMPILER} in
|
||||||
echo "Unknown compiler ${COMPILER}."
|
echo "Unknown compiler ${COMPILER}."
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# make the compiler variables CC, CXX, FC and F77 available
|
# 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
|
if [ ! -z "$MPI" ] ; then
|
||||||
MPI_MODULE="mpi/$MPI"
|
MPI_MODULE="mpi/$MPI"
|
||||||
|
|
Loading…
Reference in a new issue