From a733363f1ef15c437fb9a35715b2c7896c43c6b3 Mon Sep 17 00:00:00 2001 From: Christoph Niethammer Date: Wed, 23 Mar 2011 11:40:02 +0000 Subject: [PATCH] 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. --- sit | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/sit b/sit index 2f6e92e..d40a8f4 100755 --- a/sit +++ b/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"