Commit 3751ce52 authored by mark's avatar mark
Browse files

ENH: minor improvements to environment

- handle sourcing bashrc with a relative path (issue #383)
- handle sourcing from bash and zsh.
  Still need manual intervention when sourcing dash, sh, or ksh.
- replace grep in etc/cshrc with sed only
- logical instead of physical path for WM_PROJECT_DIR (issue #431).
  Doesn't seem to be possible for csh/tcsh.

  * Continue using physical locations when comparing directories,
    but not for the top-level FOAM_INST_DIR, WM_PROJECT_DIR.

- relocate WM_CC, WM_CXX overrides from etc/config.*/compiler
  to etc/config.*/settings to ensure that they are left untouched
  when etc/config.sh/compiler is sourced while making third-party
  packages (eg, gcc, llvm, CGAL).

- provide fallback FOAM_TUTORIALS setting in RunFunctions

STYLE: remove "~OpenFOAM" fallback as being too rare, non-obvious
parent 7359ce76
......@@ -129,7 +129,7 @@ done
ERROR: ParaView reader module library ($plugin) does not exist
Please build the reader module before continuing:
cd \$FOAM_UTILITIES/postProcessing/graphics/PVReaders
cd \$WM_PROJECT_DIR/applications/utilities/postProcessing/graphics/PVReaders
./Allwclean
./Allwmake
......
......@@ -28,6 +28,12 @@
# Miscellaneous functions for running tutorial cases
#------------------------------------------------------------------------------
# The normal locations
[ -n "$FOAM_TUTORIALS" ] || export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
#------------------------------------------------------------------------------
#
# Look for '-parallel' in the argument list.
#
......
......@@ -139,11 +139,12 @@ _inlineSed()
}
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
echo "Failed: $msg in $file"
echo "Failed: ${msg:-replacement} in $file"
return 1
}
echo " $msg ($file)"
[ -n "$msg" ] && echo " $msg ($file)"
return 0
}
......@@ -166,7 +167,7 @@ replace()
shift 2
_inlineSed \
$file \
$file \
"$key=.*" \
"$key=$val" \
"Replaced $key setting by '$val'"
......@@ -194,8 +195,13 @@ do
_inlineSed \
etc/bashrc \
'\(.*BASH_SOURCE.*\)' \
'##\1' \
"Removed default FOAM_INST_DIR setting"
'## \1' \
"Remove default FOAM_INST_DIR setting" \
&& _inlineSed \
etc/bashrc \
'\(.* && FOAM_INST_DIR\)' \
'## \1'
_inlineSed \
etc/bashrc \
'^ *FOAM_INST_DIR=.*' \
......
......@@ -27,7 +27,7 @@
# Description
# Startup file for OpenFOAM
# Sourced from ~/.profile or ~/.bashrc
# Should be usable by any POSIX-compliant shell (eg, ksh)
# Should be usable by any POSIX-compliant shell (eg, dash, ksh)
#
#------------------------------------------------------------------------------
......@@ -37,20 +37,23 @@ export WM_PROJECT_VERSION=plus
################################################################################
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# FOAM_INST_DIR is the location of the OpenFOAM installation which defaults to
# the directory containing this file if sourced by a bash shell.
# FOAM_INST_DIR = the parent directory containing the OpenFOAM installation(s).
# - If the OpenFOAM installation has this OpenFOAM-<VERSION>/etc/bashrc, the
# next lines should work when sourced by a BASH or ZSH shell.
# - If this does not produce the desired result, please set one of the fallback
# values to an appropriate path.
#
# Please set to the appropriate path if the default is not correct.
#
[ $BASH_SOURCE ] && FOAM_INST_DIR=$(\cd ${BASH_SOURCE%/*/*/*} && \pwd -P) || \
rc="${BASH_SOURCE:-${ZSH_NAME:+$0}}"
[ -n "$rc" ] && FOAM_INST_DIR=$(\cd $(dirname $rc)/../.. && \pwd -L) || \
FOAM_INST_DIR=$HOME/$WM_PROJECT
# FOAM_INST_DIR=~$WM_PROJECT
# FOAM_INST_DIR=/opt/$WM_PROJECT
# FOAM_INST_DIR=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################
: # Extra safety - if the user commented out all fallback values
export FOAM_INST_DIR
unset rc
# The default environment variables below can be overridden in a prefs.sh file
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,
......@@ -90,8 +93,8 @@ export WM_COMPILE_OPTION=Opt
export WM_MPLIB=SYSTEMOPENMPI
#- Operating System:
# WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX
# WM_OSTYPE = POSIX
#export WM_OSTYPE=POSIX
#- Floating-point signal handling:
# set or unset
......@@ -132,8 +135,8 @@ fi
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Load helper functions
# ~~~~~~~~~~~~~~~~~~~~~
# Load shell functions
# ~~~~~~~~~~~~~~~~~~~~
. $WM_PROJECT_DIR/etc/config.sh/functions
# Add in preset user or site preferences:
......@@ -206,9 +209,8 @@ fi
# ~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamOldDirs
# Unload helper functions
# ~~~~~~~~~~~~~~~~~~~~~~~
# Unload functions
# ~~~~~~~~~~~~~~~~
. $WM_PROJECT_DIR/etc/config.sh/functions
#------------------------------------------------------------------------------
......@@ -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
......@@ -90,21 +89,6 @@ Please check your settings
UNKNOWN_COMPILER
breaksw
endsw
setenv WM_COMPILER_TYPE ThirdParty # Canonical name
breaksw
endsw
# Common settings (system or ThirdParty)
switch ("$WM_COMPILER")
case Clang*:
# Using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
breaksw
case Icc*:
setenv WM_CC 'icc'
setenv WM_CXX 'icpc'
breaksw
endsw
......
......@@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
# Fallback value
if (! $?CEI_HOME) then
if (! $?CEI_HOME ) then
setenv CEI_HOME /usr/local/ensight/CEI
endif
......
......@@ -30,21 +30,13 @@
#
#------------------------------------------------------------------------------
# Modified compiler settings
# Modify/override compiler settings
switch ("$WM_COMPILER")
case Gcc46:
case Gcc46++0x:
set gcc_version=gcc-4.6.0
set gmp_version=gmp-5.0.1
set mpfr_version=mpfr-2.4.2
set mpc_version=mpc-0.8.1
breaksw
case Gcc45:
case Gcc45++0x:
set gcc_version=gcc-4.5.2
set gmp_version=gmp-5.0.1
set mpfr_version=mpfr-2.4.2
set mpc_version=mpc-0.8.1
case Gcc70:
set gcc_version=gcc-7.0.0
set gmp_version=gmp-6.1.2
set mpfr_version=mpfr-3.1.5
set mpc_version=mpc-1.0.3
breaksw
endsw
......
......@@ -259,8 +259,8 @@ else
setenv MPI_BUFFER_SIZE $minBufferSize
endif
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
# Cleanup environment
# ~~~~~~~~~~~~~~~~~~~
unset minBufferSize
#------------------------------------------------------------------------------
......@@ -59,7 +59,7 @@ set cmake_version=cmake-system
# END OF (NORMAL) USER EDITABLE PART
#------------------------------------------------------------------------------
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
if (! $?ParaView_DIR ) setenv ParaView_DIR
# Clean PATH and LD_LIBRARY_PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-"`
......
......@@ -39,11 +39,10 @@ alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
#------------------------------------------------------------------------------
# Set environment variables according to system type
setenv WM_ARCH `uname -s`
# Default WM_COMPILER_LIB_ARCH for 32bit
setenv WM_COMPILER_LIB_ARCH
if (! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX # Default is POSIX
setenv WM_COMPILER_LIB_ARCH # Set, but empty: default for 32bit
setenv WM_ARCH `uname -s`
switch ($WM_ARCH)
case Linux:
setenv WM_ARCH linux
......@@ -54,7 +53,7 @@ case Linux:
breaksw
case x86_64:
if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64 # Default to 64-bit
if (! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64 # Default to 64-bit
switch ($WM_ARCH_OPTION)
case 32:
setenv WM_COMPILER_ARCH 64
......@@ -136,7 +135,6 @@ UNSUPPORTED_OS
endsw
#------------------------------------------------------------------------------
# Location of the jobControl directory
......@@ -202,37 +200,49 @@ _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
# Make sure to pick up dummy versions of external libraries last
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy
#------------------------------------------------------------------------------
# Compiler settings
# ~~~~~~~~~~~~~~~~~
# Default to system compiler
if (! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
# Adjustments for non-gcc compilers
switch ("$WM_COMPILER")
case Clang*:
# Using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
breaksw
case Icc*:
# Using icc - not gcc
setenv WM_CC 'icc'
setenv WM_CXX 'icpc'
breaksw
endsw
# Clear prior to sourcing
unset gcc_version gmp_version mpfr_version mpc_version
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
# Compiler installation - default to system
# ~~~~~~~~~~~~~~~~~~~~~
if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
# Load configured compiler versions, regardless of the compiler type
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Load pre-defined compiler versions
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamEtc config.csh/compiler
switch ("$WM_COMPILER_TYPE")
case system:
# Use system compiler
breaksw
case ThirdParty:
if ( $?gcc_version ) then
if ( ! $?gmp_version ) set gmp_version=gmp-system
if ( ! $?mpfr_version ) set mpfr_version=mpfr-system
if ( ! $?mpc_version ) set mpc_version=mpc-system
set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
/bin/cat << GCC_NOT_FOUND
switch ("$WM_COMPILER_TYPE-$WM_COMPILER")
case ThirdParty-Gcc*:
if (! $?gmp_version ) set gmp_version=gmp-system
if (! $?mpfr_version ) set mpfr_version=mpfr-system
if (! $?mpc_version ) set mpc_version=mpc-system
set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
/bin/cat << GCC_NOT_FOUND
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find '$WM_COMPILER' compiler installation
......@@ -242,39 +252,39 @@ Cannot find '$WM_COMPILER' compiler installation
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
===============================================================================
GCC_NOT_FOUND
endif
_foamAddMan $gccDir/man
_foamAddPath $gccDir/bin
# Add ThirdParty compiler libraries to run-time environment
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
if ( "${gmpDir:t}" != "gmp-system" ) then
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
setenv GMP_ARCH_PATH $gmpDir # For ThirdParty CGAL
endif
if ( "${mpfrDir:t}" != "mpfr-system" ) then
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
setenv MPFR_ARCH_PATH $mpfrDir # For ThirdParty CGAL
endif
if ( "${mpcDir:t}" != "mpc-system" ) then
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
endif
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using ThirdParty compiler"
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
_foamAddMan $gccDir/man
_foamAddPath $gccDir/bin
# Add ThirdParty compiler libraries to run-time environment
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
if ( "${gmpDir:t}" != "gmp-system" ) then
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
setenv GMP_ARCH_PATH $gmpDir # For ThirdParty CGAL
endif
if ( "${mpfrDir:t}" != "mpfr-system" ) then
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
setenv MPFR_ARCH_PATH $mpfrDir # For ThirdParty CGAL
endif
if ( "${mpcDir:t}" != "mpc-system" ) then
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
endif
# Check that the compiler directory can be found
if ( ! -d "$clangDir" ) then
/bin/cat << CLANG_NOT_FOUND
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using ThirdParty compiler"
echo " ${gccDir:t} (${gmpDir:t} ${mpfrDir:t} ${mpcDir:t})"
endif
breaksw
case ThirdParty-Clang*:
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
/bin/cat << CLANG_NOT_FOUND
===============================================================================
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find '$WM_COMPILER' compiler installation
......@@ -284,20 +294,20 @@ Cannot find '$WM_COMPILER' compiler installation
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
===============================================================================
CLANG_NOT_FOUND
endif
endif
_foamAddMan $clangDir/man
_foamAddPath $clangDir/bin
_foamAddMan $clangDir/man
_foamAddPath $clangDir/bin
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using ThirdParty compiler"
echo " ${clangDir:t}"
endif
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using ThirdParty compiler"
echo " ${clangDir:t}"
endif
breaksw
unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
unset clang_version clangDir
case system-*:
case ThirdParty-*:
# Using system compiler or other ThirdParty compiler
breaksw
default:
......@@ -312,9 +322,12 @@ UNKNOWN_TYPE
endsw
# Cleanup
# ~~~~~~~
unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
unset clang_version clangDir
# Retain: _foamAddPath _foamAddLib _foamAddMan
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
#- keep _foamAddPath _foamAddLib _foamAddMan
#------------------------------------------------------------------------------
......@@ -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
......@@ -88,20 +88,6 @@ Please check your settings
UNKNOWN_COMPILER
;;
esac
WM_COMPILER_TYPE=ThirdParty # Canonical name
;;
esac
# Common settings (system or ThirdParty)
case "$WM_COMPILER" in
Clang*)
# Using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
;;
Icc*)
export WM_CC='icc'
export WM_CXX='icpc'
;;
esac
......
......@@ -30,39 +30,23 @@
#
#------------------------------------------------------------------------------
# First load the standard versions, if necessary
if foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler)
then
. $foamFile
fi
unset foamFile
# Load the standard versions...
eval $($WM_PROJECT_DIR/bin/foamEtcFile -sh -mode=o config.sh/compiler)
# Override compiler settings
# Modify/override compiler settings
case "$WM_COMPILER" in
Gcc46 | Gcc46++0x)
gcc_version=gcc-4.6.0
gmp_version=gmp-5.0.1
mpfr_version=mpfr-2.4.2
mpc_version=mpc-0.8.1
;;
Gcc45 | Gcc45++0x)
gcc_version=gcc-4.5.2
gmp_version=gmp-5.0.1
mpfr_version=mpfr-2.4.2
mpc_version=mpc-0.8.1
Gcc70)
gcc_version=gcc-7.0.0
gmp_version=gmp-6.1.2
mpfr_version=mpfr-3.1.5
mpc_version=mpc-1.0.3
;;
Gcc48u)
# Example of using the system GCC 4.8 in Ubuntu 15.10. Keep in mind you
# will also need to create respective directory in "wmake/rules"
# will also need to create the respective directory in "wmake/rules"
export WM_CC='gcc-4.8'
export WM_CXX='g++-4.8'
;;
Icc*)
# Example for ensuring that 3rd software uses the Icc compilers
export WM_CC='icc'
export WM_CXX='icpc'
;;
esac
#------------------------------------------------------------------------------
......@@ -35,10 +35,11 @@
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview with a different ParaView_VERSION
# Use the shipped paraview config file (-mode=o)
# with a different ParaView_VERSION
#
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/paraview 2>/dev/null)
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode=o config.sh/paraview 2>/dev/null)
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=5.0.1
unset foamFile
......
......@@ -30,12 +30,12 @@
#
#------------------------------------------------------------------------------
if [ -z "$WM_BASH_FUNCTIONS" ]
if [ -z "$WM_SHELL_FUNCTIONS" ]
then
# Not previously loaded/defined - define now
# Temporary environment variable to track loading/unloading of functions
WM_BASH_FUNCTIONS=loaded
WM_SHELL_FUNCTIONS=loaded
# Prefix to PATH
_foamAddPath()
......@@ -69,7 +69,6 @@ then
# Evaluate command-line parameters
_foamEval()
{
local file
while [ $# -gt 0 ]
do
case "$1" in
......@@ -105,7 +104,7 @@ then
else
# Was previously loaded/defined - now unset
unset WM_BASH_FUNCTIONS
unset WM_SHELL_FUNCTIONS
unset -f _foamAddPath _foamAddLib _foamAddMan
unset -f _foamEtc _foamEval
......
......@@ -274,8 +274,8 @@ fi
export MPI_BUFFER_SIZE
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
# Cleanup environment
# ~~~~~~~~~~~~~~~~~~~
unset minBufferSize
#------------------------------------------------------------------------------
......@@ -29,10 +29,10 @@
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#
#------------------------------------------------------------------------------
# Set environment variables according to system type
export WM_ARCH=$(uname -s)
: ${WM_OSTYPE:=POSIX}; export WM_OSTYPE # Default is POSIX
export WM_ARCH=$(uname -s)
case "$WM_ARCH" in
Linux)
WM_ARCH=linux
......@@ -201,34 +201,45 @@ _foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
# Make sure to pick up dummy versions of external libraries last
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy
#------------------------------------------------------------------------------
# Compiler settings
# ~~~~~~~~~~~~~~~~~
unset gcc_version gmp_version mpfr_version mpc_version
unset GMP_ARCH_PATH MPFR_ARCH_PATH
# Compiler installation - default to system
# ~~~~~~~~~~~~~~~~~~~~~
# Default to system compiler
: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE
# Load configured compiler versions, regardless of the compiler type
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamEtc config.sh/compiler
case "$WM_COMPILER_TYPE" in
system)
# Use system compiler
# Adjust for non-gcc compilers
case "$WM_COMPILER" in
Clang*)
# Using clang - not gcc
export WM_CC='clang'
export WM_CXX='clang++'
;;
Icc*)
# Using icc - not gcc
export WM_CC='icc'
export WM_CXX='icpc'
;;
esac
ThirdParty)
if [ -n "$gcc_version" ]
then
gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${gmp_version:-gmp-system}
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpfr_version:-mpfr-system}