ENH: reorganize settings to avoid inheriting bad values

- avoid non-standard 'tempfile' in bin/tools/foamConfigurePaths
This commit is contained in:
Mark Olesen
2010-12-23 07:37:32 +01:00
parent 8bffec8fbb
commit 18dbe9996a
7 changed files with 203 additions and 116 deletions

View File

@ -35,24 +35,73 @@ export WM_PROJECT=OpenFOAM
export WM_PROJECT_VERSION=dev
################################################################################
# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
#
# either set $FOAM_INST_DIR before sourcing this file or set
# $foamInstall below to where OpenFOAM is installed
# 'foamInstall' below to where OpenFOAM is installed
#
# Location of the OpenFOAM installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamInstall=$HOME/$WM_PROJECT
# foamInstall=~$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
# foamInstall=/opt/$WM_PROJECT
# foamInstall=/usr/local/$WM_PROJECT
#
# END OF (NORMAL) USER EDITABLE PART
################################################################################
# note the location for later use (eg, in job scripts)
#
# These are the defaults for this version which should generally be
# overridden from the prefs.sh file or from command-line specification
#
#- note the location for later use (eg, in job scripts)
: ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
#- ParaView version, automatically determine major version:
export ParaView_VERSION=3.8.0
export ParaView_MAJOR=unknown
#- Compiler location:
# foamCompiler= system | ThirdParty (OpenFOAM)
foamCompiler=system
#- Compiler:
# WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
export WM_COMPILER=Gcc
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
#- Architecture:
# WM_ARCH_OPTION = 32 | 64
export WM_ARCH_OPTION=64
#- Precision:
# WM_PRECISION_OPTION = DP | SP
export WM_PRECISION_OPTION=DP
#- Optimised, debug, profiling:
# WM_COMPILE_OPTION = Opt | Debug | Prof
export WM_COMPILE_OPTION=Opt
#- MPI implementation:
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
# | GAMMA | MPI | QSMPI
export WM_MPLIB=OPENMPI
#- Operating System:
# WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX
#- Floating-point signal handling:
# set or unset
export FOAM_SIGFPE=
#- memory initialisation:
# set or unset
#export FOAM_SETNAN=
################################################################################
# The old dirs to be cleaned from the various environment variables
# - remove anything under top-level directory.
# NB: the WM_PROJECT_INST_DIR might not be identical between versions
@ -90,6 +139,7 @@ _foamSource()
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters and record settings for later
# these can be used to set/unset values, or specify prefs files
export FOAM_SETTINGS="$@"
while [ $# -gt 0 ]
do
@ -116,41 +166,6 @@ do
done
# Operating System/Platform
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_OSTYPE = POSIX | ????
: ${WM_OSTYPE:=POSIX}; export WM_OSTYPE
# Compiler: set to Gcc, Gcc43, Gcc44, or Icc (for Intel's icc)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: ${WM_COMPILER:=Gcc}; export WM_COMPILER
unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
# Compilation options (architecture, precision, optimised, debug or profiling)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# WM_ARCH_OPTION = 32 | 64
: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION
# WM_PRECISION_OPTION = DP | SP
: ${WM_PRECISION_OPTION:=DP}; export WM_PRECISION_OPTION
# WM_COMPILE_OPTION = Opt | Debug | Prof
: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA
# | MPI | QSMPI
: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
# Run options (floating-point signal handling and memory initialisation)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export FOAM_SIGFPE=
# export FOAM_SETNAN=
# Detect system type and set environment variables appropriately
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_ARCH=`uname -s`
@ -165,7 +180,7 @@ Linux)
;;
x86_64)
case $WM_ARCH_OPTION in
case "$WM_ARCH_OPTION" in
32)
export WM_COMPILER_ARCH='-64'
export WM_CC='gcc'
@ -196,13 +211,13 @@ Linux)
mips64)
WM_ARCH=SiCortex64
WM_MPLIB=MPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
export WM_MPLIB=MPI
;;
ppc64)
@ -223,13 +238,13 @@ Linux)
SunOS)
WM_ARCH=SunOS64
WM_MPLIB=FJMPI
export WM_COMPILER_LIB_ARCH=64
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-mabi=64 -fPIC'
export WM_CXXFLAGS='-mabi=64 -fPIC'
export WM_LDFLAGS='-mabi=64 -G0'
export WM_MPLIB=FJMPI
;;
*) # an unsupported operating system