diff --git a/etc/bashrc b/etc/bashrc index 81bf28feaf927b59acf4f05dcc5653cd38f2b382..84e38d9e7e3d15bde95620ae1055c843a2bdc9d7 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -57,7 +57,7 @@ export FOAM_INST_DIR=$HOME/$WM_PROJECT # $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site #- Compiler location: -# WM_COMPILER_TYPE= system | ThirdParty (OpenFOAM) +# WM_COMPILER_TYPE= system | ThirdParty export WM_COMPILER_TYPE=system #- Compiler: diff --git a/etc/config.csh/compiler b/etc/config.csh/compiler index 3e28c20b71ebe793ccecd994646a1e551afa510a..7d8f757b23eb13680a5545b489e7ef40e55fa657 100644 --- a/etc/config.csh/compiler +++ b/etc/config.csh/compiler @@ -31,7 +31,6 @@ #------------------------------------------------------------------------------ switch ("$WM_COMPILER_TYPE") -case OpenFOAM: case ThirdParty: # Default versions of GMP, MPFR and MPC, override as necessary set gmp_version=gmp-system diff --git a/etc/config.csh/settings b/etc/config.csh/settings index 1cee3fcd91aede29df5600e34202ba898202de8f..659b4c5ae22ae09995ba6f7f1f20558060f421e5 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -204,14 +204,9 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L unset gcc_version gmp_version mpfr_version mpc_version unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH - -# Location of compiler installation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if ( ! $?WM_COMPILER_TYPE ) then - setenv WM_COMPILER_TYPE system - echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:" - echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'" -endif +# Compiler installation - default to system +# ~~~~~~~~~~~~~~~~~~~~~ +if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system # Load configured compiler versions, regardless of the compiler type # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -235,13 +230,16 @@ case ThirdParty: # Check that the compiler directory can be found if ( ! -d "$gccDir" ) then - echo - echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:" - echo " Cannot find $gccDir installation." - echo " Please install this compiler version or if you wish to" \ - " use the system compiler," - echo " change the 'WM_COMPILER_TYPE' setting to 'system'" - echo + cat << GCC_NOT_FOUND +=============================================================================== +Warning in $WM_PROJECT_DIR/etc/config.csh/settings: +Cannot find '$WM_COMPILER' compiler installation + $gccDir + + Either install this compiler version, or use the system compiler by setting + WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc. +=============================================================================== +GCC_NOT_FOUND endif _foamAddMan $gccDir/man @@ -268,18 +266,22 @@ case ThirdParty: echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})" endif endif + if ( $?clang_version ) then set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version # Check that the compiler directory can be found if ( ! -d "$clangDir" ) then - echo - echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:" - echo " Cannot find $clangDir installation." - echo " Please install this compiler version or if you wish to" \ - " use the system compiler," - echo " change the 'WM_COMPILER_TYPE' setting to 'system'" - echo + cat << CLANG_NOT_FOUND +=============================================================================== +Warning in $WM_PROJECT_DIR/etc/config.csh/settings: +Cannot find '$WM_COMPILER' compiler installation + $clangDir + + Either install this compiler version, or use the system compiler by setting + WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc. +=============================================================================== +CLANG_NOT_FOUND endif _foamAddMan $clangDir/man diff --git a/etc/config.sh/compiler b/etc/config.sh/compiler index 5cfc75e56cce5027873a3818b3907db156d9f651..0f27fab8a68bc7fb8dc3475ad4e9b79b78b7b020 100644 --- a/etc/config.sh/compiler +++ b/etc/config.sh/compiler @@ -31,7 +31,7 @@ #------------------------------------------------------------------------------ case "$WM_COMPILER_TYPE" in -OpenFOAM | ThirdParty) +ThirdParty) # Default versions of GMP, MPFR and MPC, override as necessary gmp_version=gmp-system mpfr_version=mpfr-system diff --git a/etc/config.sh/settings b/etc/config.sh/settings index e67bf5126fe7b0beb66f75a3846568a0bbaa14fb..4e457c15c0022356bcf923c4da0ed1d1bccbf097 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -206,14 +206,9 @@ _foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$ unset gcc_version gmp_version mpfr_version mpc_version unset GMP_ARCH_PATH MPFR_ARCH_PATH -# Location of compiler installation -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -if [ -z "$WM_COMPILER_TYPE" ] -then - WM_COMPILER_TYPE=system - echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2 - echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'" 1>&2 -fi +# Compiler installation - default to system +# ~~~~~~~~~~~~~~~~~~~~~ +: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE # Load configured compiler versions, regardless of the compiler type # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -232,15 +227,16 @@ OpenFOAM | ThirdParty) mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system} # Check that the compiler directory can be found - [ -d "$gccDir" ] || { - echo 1>&2 - echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2 - echo " Cannot find $gccDir installation." 1>&2 - echo " Please install this compiler version or if you wish to" \ - " use the system compiler," 1>&2 - echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2 - echo - } + [ -d "$gccDir" ] || cat << GCC_NOT_FOUND 1>&2 +=============================================================================== +Warning in $WM_PROJECT_DIR/etc/config.sh/settings: +Cannot find '$WM_COMPILER' compiler installation + $gccDir + + Either install this compiler version, or use the system compiler by setting + WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc. +=============================================================================== +GCC_NOT_FOUND _foamAddMan $gccDir/man _foamAddPath $gccDir/bin @@ -276,15 +272,16 @@ OpenFOAM | ThirdParty) clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version # Check that the compiler directory can be found - [ -d "$clangDir" ] || { - echo 1>&2 - echo "Warning in $WM_PROJECT_DIR/etc/config.sh/settings:" 1>&2 - echo " Cannot find $clangDir installation." 1>&2 - echo " Please install this compiler version or if you wish to" \ - " use the system compiler," 1>&2 - echo " change the 'WM_COMPILER_TYPE' setting to 'system'" 1>&2 - echo 1>&2 - } + [ -d "$clangDir" ] || cat << CLANG_NOT_FOUND 1>&2 +=============================================================================== +Warning in $WM_PROJECT_DIR/etc/config.sh/settings: +Cannot find '$WM_COMPILER' compiler installation + $clangDir + + Either install this compiler version, or use the system compiler by setting + WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/bashrc. +=============================================================================== +CLANG_NOT_FOUND _foamAddMan $clangDir/share/man _foamAddPath $clangDir/bin diff --git a/etc/cshrc b/etc/cshrc index 984db6bfefac48242c2448117bf66a597cca09c8..8f509b283984b5a8a0c981b5db839bf1f75efc8e 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -57,7 +57,7 @@ echo $FOAM_INST_DIR # $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site #- Compiler location: -# WM_COMPILER_TYPE = system | ThirdParty (OpenFOAM) +# WM_COMPILER_TYPE = system | ThirdParty setenv WM_COMPILER_TYPE system #- Compiler: