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:
Christoph Niethammer 2011-03-23 11:40:02 +00:00
parent 74c2549899
commit a733363f1e

13
sit
View file

@ -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,9 +29,11 @@ COMPILER_VERSION=${COMPILER_VERSION:=}
PACKAGE_DESCRIPTOR=${PACKAGE_DESCRIPTOR:+-$PACKAGE_DESCRIPTOR}
# Compiler specifications
if [ "$COMPILER" == "system" ] ; then
echo "Using system default compiler"
else
if [ -z "$COMPILER_VERSION" ] ; then
COMPILER_MODULE=compiler/${COMPILER}
else
@ -40,8 +42,12 @@ fi
echo "Loading compiler module ${COMPILER_MODULE}"
module load ${COMPILER_MODULE}
fi
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
if [ ! -z $COMPILER_OPTS ] ; then
export ${COMPILER_OPTS}
fi
if [ ! -z "$MPI" ] ; then
MPI_MODULE="mpi/$MPI"