mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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
This commit is contained in:
@ -129,7 +129,7 @@ done
|
|||||||
ERROR: ParaView reader module library ($plugin) does not exist
|
ERROR: ParaView reader module library ($plugin) does not exist
|
||||||
Please build the reader module before continuing:
|
Please build the reader module before continuing:
|
||||||
|
|
||||||
cd \$FOAM_UTILITIES/postProcessing/graphics/PVReaders
|
cd \$WM_PROJECT_DIR/applications/utilities/postProcessing/graphics/PVReaders
|
||||||
./Allwclean
|
./Allwclean
|
||||||
./Allwmake
|
./Allwmake
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,12 @@
|
|||||||
# Miscellaneous functions for running tutorial cases
|
# 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.
|
# Look for '-parallel' in the argument list.
|
||||||
#
|
#
|
||||||
|
|||||||
@ -139,11 +139,12 @@ _inlineSed()
|
|||||||
}
|
}
|
||||||
|
|
||||||
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
||||||
echo "Failed: $msg in $file"
|
echo "Failed: ${msg:-replacement} in $file"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
echo " $msg ($file)"
|
[ -n "$msg" ] && echo " $msg ($file)"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +167,7 @@ replace()
|
|||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
_inlineSed \
|
_inlineSed \
|
||||||
$file \
|
$file \
|
||||||
"$key=.*" \
|
"$key=.*" \
|
||||||
"$key=$val" \
|
"$key=$val" \
|
||||||
"Replaced $key setting by '$val'"
|
"Replaced $key setting by '$val'"
|
||||||
@ -194,8 +195,13 @@ do
|
|||||||
_inlineSed \
|
_inlineSed \
|
||||||
etc/bashrc \
|
etc/bashrc \
|
||||||
'\(.*BASH_SOURCE.*\)' \
|
'\(.*BASH_SOURCE.*\)' \
|
||||||
'##\1' \
|
'## \1' \
|
||||||
"Removed default FOAM_INST_DIR setting"
|
"Remove default FOAM_INST_DIR setting" \
|
||||||
|
&& _inlineSed \
|
||||||
|
etc/bashrc \
|
||||||
|
'\(.* && FOAM_INST_DIR\)' \
|
||||||
|
'## \1'
|
||||||
|
|
||||||
_inlineSed \
|
_inlineSed \
|
||||||
etc/bashrc \
|
etc/bashrc \
|
||||||
'^ *FOAM_INST_DIR=.*' \
|
'^ *FOAM_INST_DIR=.*' \
|
||||||
|
|||||||
30
etc/bashrc
30
etc/bashrc
@ -27,7 +27,7 @@
|
|||||||
# Description
|
# Description
|
||||||
# Startup file for OpenFOAM
|
# Startup file for OpenFOAM
|
||||||
# Sourced from ~/.profile or ~/.bashrc
|
# 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
|
# 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
|
# FOAM_INST_DIR = the parent directory containing the OpenFOAM installation(s).
|
||||||
# the directory containing this file if sourced by a bash shell.
|
# - 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.
|
rc="${BASH_SOURCE:-${ZSH_NAME:+$0}}"
|
||||||
#
|
[ -n "$rc" ] && FOAM_INST_DIR=$(\cd $(dirname $rc)/../.. && \pwd -L) || \
|
||||||
[ $BASH_SOURCE ] && FOAM_INST_DIR=$(\cd ${BASH_SOURCE%/*/*/*} && \pwd -P) || \
|
|
||||||
FOAM_INST_DIR=$HOME/$WM_PROJECT
|
FOAM_INST_DIR=$HOME/$WM_PROJECT
|
||||||
# FOAM_INST_DIR=~$WM_PROJECT
|
|
||||||
# FOAM_INST_DIR=/opt/$WM_PROJECT
|
# FOAM_INST_DIR=/opt/$WM_PROJECT
|
||||||
# FOAM_INST_DIR=/usr/local/$WM_PROJECT
|
# FOAM_INST_DIR=/usr/local/$WM_PROJECT
|
||||||
#
|
#
|
||||||
# END OF (NORMAL) USER EDITABLE PART
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
################################################################################
|
################################################################################
|
||||||
|
: # Extra safety - if the user commented out all fallback values
|
||||||
export FOAM_INST_DIR
|
export FOAM_INST_DIR
|
||||||
|
unset rc
|
||||||
|
|
||||||
# The default environment variables below can be overridden in a prefs.sh file
|
# The default environment variables below can be overridden in a prefs.sh file
|
||||||
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,
|
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,
|
||||||
@ -90,8 +93,8 @@ export WM_COMPILE_OPTION=Opt
|
|||||||
export WM_MPLIB=SYSTEMOPENMPI
|
export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
|
||||||
#- Operating System:
|
#- Operating System:
|
||||||
# WM_OSTYPE = POSIX | ???
|
# WM_OSTYPE = POSIX
|
||||||
export WM_OSTYPE=POSIX
|
#export WM_OSTYPE=POSIX
|
||||||
|
|
||||||
#- Floating-point signal handling:
|
#- Floating-point signal handling:
|
||||||
# set or unset
|
# set or unset
|
||||||
@ -132,8 +135,8 @@ fi
|
|||||||
# ~~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
|
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
|
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||||
|
|
||||||
# Add in preset user or site preferences:
|
# Add in preset user or site preferences:
|
||||||
@ -206,9 +209,8 @@ fi
|
|||||||
# ~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~
|
||||||
unset cleaned foamClean foamOldDirs
|
unset cleaned foamClean foamOldDirs
|
||||||
|
|
||||||
|
# Unload functions
|
||||||
# Unload helper functions
|
# ~~~~~~~~~~~~~~~~
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
. $WM_PROJECT_DIR/etc/config.sh/functions
|
. $WM_PROJECT_DIR/etc/config.sh/functions
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -31,7 +31,6 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
switch ("$WM_COMPILER_TYPE")
|
switch ("$WM_COMPILER_TYPE")
|
||||||
case OpenFOAM:
|
|
||||||
case ThirdParty:
|
case ThirdParty:
|
||||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||||
set gmp_version=gmp-system
|
set gmp_version=gmp-system
|
||||||
@ -90,21 +89,6 @@ Please check your settings
|
|||||||
UNKNOWN_COMPILER
|
UNKNOWN_COMPILER
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
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
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Fallback value
|
# Fallback value
|
||||||
if (! $?CEI_HOME) then
|
if (! $?CEI_HOME ) then
|
||||||
setenv CEI_HOME /usr/local/ensight/CEI
|
setenv CEI_HOME /usr/local/ensight/CEI
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@ -30,21 +30,13 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Modified compiler settings
|
# Modify/override compiler settings
|
||||||
switch ("$WM_COMPILER")
|
switch ("$WM_COMPILER")
|
||||||
case Gcc46:
|
case Gcc70:
|
||||||
case Gcc46++0x:
|
set gcc_version=gcc-7.0.0
|
||||||
set gcc_version=gcc-4.6.0
|
set gmp_version=gmp-6.1.2
|
||||||
set gmp_version=gmp-5.0.1
|
set mpfr_version=mpfr-3.1.5
|
||||||
set mpfr_version=mpfr-2.4.2
|
set mpc_version=mpc-1.0.3
|
||||||
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
|
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
|||||||
@ -259,8 +259,8 @@ else
|
|||||||
setenv MPI_BUFFER_SIZE $minBufferSize
|
setenv MPI_BUFFER_SIZE $minBufferSize
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Cleanup environment:
|
# Cleanup environment
|
||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~
|
||||||
unset minBufferSize
|
unset minBufferSize
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -59,7 +59,7 @@ set cmake_version=cmake-system
|
|||||||
# END OF (NORMAL) USER EDITABLE PART
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
|
if (! $?ParaView_DIR ) setenv ParaView_DIR
|
||||||
|
|
||||||
# Clean PATH and LD_LIBRARY_PATH
|
# 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-"`
|
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
|
# Set environment variables according to system type
|
||||||
|
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`
|
setenv WM_ARCH `uname -s`
|
||||||
|
|
||||||
# Default WM_COMPILER_LIB_ARCH for 32bit
|
|
||||||
setenv WM_COMPILER_LIB_ARCH
|
|
||||||
|
|
||||||
switch ($WM_ARCH)
|
switch ($WM_ARCH)
|
||||||
case Linux:
|
case Linux:
|
||||||
setenv WM_ARCH linux
|
setenv WM_ARCH linux
|
||||||
@ -54,7 +53,7 @@ case Linux:
|
|||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
case x86_64:
|
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)
|
switch ($WM_ARCH_OPTION)
|
||||||
case 32:
|
case 32:
|
||||||
setenv WM_COMPILER_ARCH 64
|
setenv WM_COMPILER_ARCH 64
|
||||||
@ -136,7 +135,6 @@ UNSUPPORTED_OS
|
|||||||
|
|
||||||
endsw
|
endsw
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Location of the jobControl directory
|
# 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
|
# 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
|
_foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Compiler settings
|
# 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
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
unsetenv GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
# Compiler installation - default to system
|
# Load pre-defined compiler versions
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
if ( ! $?WM_COMPILER_TYPE ) setenv WM_COMPILER_TYPE system
|
|
||||||
|
|
||||||
# Load configured compiler versions, regardless of the compiler type
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
_foamEtc config.csh/compiler
|
_foamEtc config.csh/compiler
|
||||||
|
|
||||||
switch ("$WM_COMPILER_TYPE")
|
switch ("$WM_COMPILER_TYPE-$WM_COMPILER")
|
||||||
case system:
|
case ThirdParty-Gcc*:
|
||||||
# Use system compiler
|
if (! $?gmp_version ) set gmp_version=gmp-system
|
||||||
breaksw
|
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
|
||||||
|
|
||||||
case ThirdParty:
|
# Check that the compiler directory can be found
|
||||||
if ( $?gcc_version ) then
|
if ( ! -d "$gccDir" ) then
|
||||||
if ( ! $?gmp_version ) set gmp_version=gmp-system
|
/bin/cat << GCC_NOT_FOUND
|
||||||
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:
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
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.
|
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
|
||||||
===============================================================================
|
===============================================================================
|
||||||
GCC_NOT_FOUND
|
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
|
endif
|
||||||
|
|
||||||
if ( $?clang_version ) then
|
_foamAddMan $gccDir/man
|
||||||
set clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
_foamAddPath $gccDir/bin
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
# Add ThirdParty compiler libraries to run-time environment
|
||||||
if ( ! -d "$clangDir" ) then
|
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
/bin/cat << CLANG_NOT_FOUND
|
|
||||||
|
# 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
|
||||||
|
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:
|
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
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.
|
WM_COMPILER_TYPE to 'system' in \$WM_PROJECT_DIR/etc/cshrc.
|
||||||
===============================================================================
|
===============================================================================
|
||||||
CLANG_NOT_FOUND
|
CLANG_NOT_FOUND
|
||||||
endif
|
|
||||||
|
|
||||||
_foamAddMan $clangDir/man
|
|
||||||
_foamAddPath $clangDir/bin
|
|
||||||
|
|
||||||
if ($?FOAM_VERBOSE && $?prompt) then
|
|
||||||
echo "Using ThirdParty compiler"
|
|
||||||
echo " ${clangDir:t}"
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
unset gcc_version gccDir
|
_foamAddMan $clangDir/man
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
_foamAddPath $clangDir/bin
|
||||||
unset clang_version clangDir
|
|
||||||
|
if ($?FOAM_VERBOSE && $?prompt) then
|
||||||
|
echo "Using ThirdParty compiler"
|
||||||
|
echo " ${clangDir:t}"
|
||||||
|
endif
|
||||||
|
breaksw
|
||||||
|
|
||||||
|
case system-*:
|
||||||
|
case ThirdParty-*:
|
||||||
|
# Using system compiler or other ThirdParty compiler
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -312,9 +322,12 @@ UNKNOWN_TYPE
|
|||||||
|
|
||||||
endsw
|
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
|
case "$WM_COMPILER_TYPE" in
|
||||||
OpenFOAM | ThirdParty)
|
ThirdParty)
|
||||||
# Default versions of GMP, MPFR and MPC, override as necessary
|
# Default versions of GMP, MPFR and MPC, override as necessary
|
||||||
gmp_version=gmp-system
|
gmp_version=gmp-system
|
||||||
mpfr_version=mpfr-system
|
mpfr_version=mpfr-system
|
||||||
@ -88,20 +88,6 @@ Please check your settings
|
|||||||
UNKNOWN_COMPILER
|
UNKNOWN_COMPILER
|
||||||
;;
|
;;
|
||||||
esac
|
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
|
esac
|
||||||
|
|
||||||
|
|||||||
@ -30,39 +30,23 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# First load the standard versions, if necessary
|
# Load the standard versions...
|
||||||
if foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/compiler)
|
eval $($WM_PROJECT_DIR/bin/foamEtcFile -sh -mode=o config.sh/compiler)
|
||||||
then
|
|
||||||
. $foamFile
|
|
||||||
fi
|
|
||||||
unset foamFile
|
|
||||||
|
|
||||||
|
# Modify/override compiler settings
|
||||||
# Override compiler settings
|
|
||||||
case "$WM_COMPILER" in
|
case "$WM_COMPILER" in
|
||||||
Gcc46 | Gcc46++0x)
|
Gcc70)
|
||||||
gcc_version=gcc-4.6.0
|
gcc_version=gcc-7.0.0
|
||||||
gmp_version=gmp-5.0.1
|
gmp_version=gmp-6.1.2
|
||||||
mpfr_version=mpfr-2.4.2
|
mpfr_version=mpfr-3.1.5
|
||||||
mpc_version=mpc-0.8.1
|
mpc_version=mpc-1.0.3
|
||||||
;;
|
|
||||||
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
|
|
||||||
;;
|
;;
|
||||||
Gcc48u)
|
Gcc48u)
|
||||||
# Example of using the system GCC 4.8 in Ubuntu 15.10. Keep in mind you
|
# 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_CC='gcc-4.8'
|
||||||
export WM_CXX='g++-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
|
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
|
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=5.0.1
|
||||||
|
|
||||||
unset foamFile
|
unset foamFile
|
||||||
|
|||||||
@ -30,12 +30,12 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
if [ -z "$WM_BASH_FUNCTIONS" ]
|
if [ -z "$WM_SHELL_FUNCTIONS" ]
|
||||||
then
|
then
|
||||||
# Not previously loaded/defined - define now
|
# Not previously loaded/defined - define now
|
||||||
|
|
||||||
# Temporary environment variable to track loading/unloading of functions
|
# Temporary environment variable to track loading/unloading of functions
|
||||||
WM_BASH_FUNCTIONS=loaded
|
WM_SHELL_FUNCTIONS=loaded
|
||||||
|
|
||||||
# Prefix to PATH
|
# Prefix to PATH
|
||||||
_foamAddPath()
|
_foamAddPath()
|
||||||
@ -69,7 +69,6 @@ then
|
|||||||
# Evaluate command-line parameters
|
# Evaluate command-line parameters
|
||||||
_foamEval()
|
_foamEval()
|
||||||
{
|
{
|
||||||
local file
|
|
||||||
while [ $# -gt 0 ]
|
while [ $# -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -105,7 +104,7 @@ then
|
|||||||
else
|
else
|
||||||
# Was previously loaded/defined - now unset
|
# Was previously loaded/defined - now unset
|
||||||
|
|
||||||
unset WM_BASH_FUNCTIONS
|
unset WM_SHELL_FUNCTIONS
|
||||||
unset -f _foamAddPath _foamAddLib _foamAddMan
|
unset -f _foamAddPath _foamAddLib _foamAddMan
|
||||||
unset -f _foamEtc _foamEval
|
unset -f _foamEtc _foamEval
|
||||||
|
|
||||||
|
|||||||
@ -274,8 +274,8 @@ fi
|
|||||||
export MPI_BUFFER_SIZE
|
export MPI_BUFFER_SIZE
|
||||||
|
|
||||||
|
|
||||||
# Cleanup environment:
|
# Cleanup environment
|
||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~
|
||||||
unset minBufferSize
|
unset minBufferSize
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -29,10 +29,10 @@
|
|||||||
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
|
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Set environment variables according to system type
|
# 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
|
case "$WM_ARCH" in
|
||||||
Linux)
|
Linux)
|
||||||
WM_ARCH=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
|
# 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
|
_foamAddLib $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Compiler settings
|
# Compiler settings
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
# Default to system compiler
|
||||||
|
: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
# Clear prior to sourcing
|
||||||
unset gcc_version gmp_version mpfr_version mpc_version
|
unset gcc_version gmp_version mpfr_version mpc_version
|
||||||
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
unset GMP_ARCH_PATH MPFR_ARCH_PATH
|
||||||
|
|
||||||
# Compiler installation - default to system
|
# Load pre-defined compiler versions
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
: ${WM_COMPILER_TYPE:=system}; export WM_COMPILER_TYPE
|
|
||||||
|
|
||||||
# Load configured compiler versions, regardless of the compiler type
|
|
||||||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
_foamEtc config.sh/compiler
|
_foamEtc config.sh/compiler
|
||||||
|
|
||||||
case "$WM_COMPILER_TYPE" in
|
case "$WM_COMPILER_TYPE-$WM_COMPILER" in
|
||||||
system)
|
ThirdParty-Gcc*)
|
||||||
# Use system compiler
|
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}
|
||||||
|
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/${mpc_version:-mpc-system}
|
||||||
|
|
||||||
ThirdParty)
|
# Check that the compiler directory can be found
|
||||||
if [ -n "$gcc_version" ]
|
[ -d "$gccDir" ] || /bin/cat << GCC_NOT_FOUND 1>&2
|
||||||
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}
|
|
||||||
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" ] || /bin/cat << GCC_NOT_FOUND 1>&2
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
@ -239,41 +250,40 @@ Cannot find '$WM_COMPILER' compiler installation
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
GCC_NOT_FOUND
|
GCC_NOT_FOUND
|
||||||
|
|
||||||
_foamAddMan $gccDir/man
|
_foamAddMan $gccDir/man
|
||||||
_foamAddPath $gccDir/bin
|
_foamAddPath $gccDir/bin
|
||||||
|
|
||||||
# Add ThirdParty compiler libraries to run-time environment
|
# Add ThirdParty compiler libraries to run-time environment
|
||||||
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gccDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
|
|
||||||
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
|
# Add ThirdParty gmp/mpfr/mpc libraries to run-time environment
|
||||||
if [ "${gmpDir##*-}" != system ]
|
if [ "${gmpDir##*-}" != system ]
|
||||||
then
|
then
|
||||||
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $gmpDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
export GMP_ARCH_PATH=$gmpDir # For ThirdParty CGAL
|
export GMP_ARCH_PATH=$gmpDir # For ThirdParty CGAL
|
||||||
fi
|
fi
|
||||||
if [ "${mpfrDir##*-}" != system ]
|
if [ "${mpfrDir##*-}" != system ]
|
||||||
then
|
then
|
||||||
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpfrDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
export MPFR_ARCH_PATH=$mpfrDir # For ThirdParty CGAL
|
export MPFR_ARCH_PATH=$mpfrDir # For ThirdParty CGAL
|
||||||
fi
|
fi
|
||||||
if [ "${mpcDir##*-}" != system ]
|
if [ "${mpcDir##*-}" != system ]
|
||||||
then
|
then
|
||||||
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
_foamAddLib $mpcDir/lib$WM_COMPILER_LIB_ARCH
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
|
||||||
then
|
|
||||||
echo "Using ThirdParty compiler"
|
|
||||||
echo " ${gccDir##*/} (${gmpDir##*/} $${mpfrDir##*/} ${mpcDir##*/})"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$clang_version" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
echo "Using ThirdParty compiler"
|
||||||
|
echo " ${gccDir##*/} (${gmpDir##*/} $${mpfrDir##*/} ${mpcDir##*/})"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
# Check that the compiler directory can be found
|
ThirdParty-Clang*)
|
||||||
[ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2
|
clangDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$clang_version
|
||||||
|
|
||||||
|
# Check that the compiler directory can be found
|
||||||
|
[ -d "$clangDir" ] || /bin/cat << CLANG_NOT_FOUND 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
|
||||||
Cannot find '$WM_COMPILER' compiler installation
|
Cannot find '$WM_COMPILER' compiler installation
|
||||||
@ -284,20 +294,20 @@ Cannot find '$WM_COMPILER' compiler installation
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
CLANG_NOT_FOUND
|
CLANG_NOT_FOUND
|
||||||
|
|
||||||
_foamAddMan $clangDir/share/man
|
_foamAddMan $clangDir/share/man
|
||||||
_foamAddPath $clangDir/bin
|
_foamAddPath $clangDir/bin
|
||||||
|
|
||||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||||
then
|
then
|
||||||
echo "Using ThirdParty compiler"
|
echo "Using ThirdParty compiler"
|
||||||
echo " ${clangDir##*/}"
|
echo " ${clangDir##*/}"
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset gcc_version gccDir
|
|
||||||
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
|
||||||
unset clang_version clangDir
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
system-* | ThirdParty-*)
|
||||||
|
# Using system compiler or other ThirdParty compiler
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
/bin/cat << UNKNOWN_TYPE 1>&2
|
/bin/cat << UNKNOWN_TYPE 1>&2
|
||||||
===============================================================================
|
===============================================================================
|
||||||
@ -310,4 +320,11 @@ UNKNOWN_TYPE
|
|||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
# ~~~~~~~
|
||||||
|
unset gcc_version gccDir
|
||||||
|
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
|
||||||
|
unset clang_version clangDir
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
39
etc/cshrc
39
etc/cshrc
@ -36,22 +36,22 @@ setenv WM_PROJECT_VERSION plus
|
|||||||
################################################################################
|
################################################################################
|
||||||
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
# 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
|
# FOAM_INST_DIR = the parent directory containing the OpenFOAM installation(s).
|
||||||
# the directory containing this file.
|
# - If the OpenFOAM installation has this OpenFOAM-<VERSION>/etc/cshrc, the
|
||||||
|
# next lines should work when sourced by a CSH or TCSH 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.
|
setenv FOAM_INST_DIR `/usr/bin/lsof +p $$ |& \
|
||||||
#
|
sed -n -e 's@[^/]*@@' -e 's@/'$WM_PROJECT'[^/]*/etc/cshrc@@p'`
|
||||||
setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' | \
|
|
||||||
sed 's%/'$WM_PROJECT'[^/]*/etc/cshrc%%'`
|
|
||||||
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT
|
# setenv FOAM_INST_DIR $HOME/$WM_PROJECT
|
||||||
# setenv FOAM_INST_DIR ~$WM_PROJECT
|
|
||||||
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
|
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
|
||||||
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
|
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
|
||||||
#
|
#
|
||||||
# END OF (NORMAL) USER EDITABLE PART
|
# END OF (NORMAL) USER EDITABLE PART
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# The default environment variables below can be overridden in a prefs.sh file
|
# The default environment variables below can be overridden in a prefs.csh file
|
||||||
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,
|
# located in ~/.OpenFOAM/$WM_PROJECT_VERSION, ~/.OpenFOAM,
|
||||||
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
|
||||||
|
|
||||||
@ -90,8 +90,8 @@ setenv WM_COMPILE_OPTION Opt
|
|||||||
setenv WM_MPLIB SYSTEMOPENMPI
|
setenv WM_MPLIB SYSTEMOPENMPI
|
||||||
|
|
||||||
#- Operating System:
|
#- Operating System:
|
||||||
# WM_OSTYPE = POSIX | ???
|
# WM_OSTYPE = POSIX
|
||||||
setenv WM_OSTYPE POSIX
|
#setenv WM_OSTYPE POSIX
|
||||||
|
|
||||||
#- Floating-point signal handling:
|
#- Floating-point signal handling:
|
||||||
# set or unset
|
# set or unset
|
||||||
@ -176,11 +176,11 @@ while ( $#argv > 0 )
|
|||||||
breaksw
|
breaksw
|
||||||
default:
|
default:
|
||||||
# Filename: source it
|
# Filename: source it
|
||||||
if ( -f "$1" ) then
|
if ( -f "$argv[1]" ) then
|
||||||
if ($?FOAM_VERBOSE && $?prompt) echo "Using: $1"
|
if ($?FOAM_VERBOSE && $?prompt) echo "Using: $argv[1]"
|
||||||
source "$1"
|
source "$argv[1]"
|
||||||
else
|
else
|
||||||
_foamEtc -silent "$1"
|
_foamEtc -silent "$argv[1]"
|
||||||
endif
|
endif
|
||||||
breaksw
|
breaksw
|
||||||
endsw
|
endsw
|
||||||
@ -195,8 +195,8 @@ set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
|||||||
#- prevent local variables from shadowing setenv variables
|
#- prevent local variables from shadowing setenv variables
|
||||||
unset PATH MANPATH LD_LIBRARY_PATH LD_PRELOAD
|
unset PATH MANPATH LD_LIBRARY_PATH LD_PRELOAD
|
||||||
|
|
||||||
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH ''
|
if (! $?LD_LIBRARY_PATH ) setenv LD_LIBRARY_PATH
|
||||||
if (! $?MANPATH) setenv MANPATH ''
|
if (! $?MANPATH ) setenv MANPATH
|
||||||
|
|
||||||
#- Clean PATH (path)
|
#- Clean PATH (path)
|
||||||
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
|
set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
|
||||||
@ -249,9 +249,12 @@ if ( $?LD_PRELOAD ) then
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
# Cleanup environment:
|
# Cleanup environment
|
||||||
# ~~~~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~~~
|
||||||
unset cleaned foamClean foamOldDirs
|
unset cleaned foamClean foamOldDirs
|
||||||
unalias _foamEtc
|
unalias _foamEtc
|
||||||
|
unalias _foamAddPath
|
||||||
|
unalias _foamAddLib
|
||||||
|
unalias _foamAddMan
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -20,10 +20,10 @@ cd ${0%/*} && wmakeCheckPwd "$WM_PROJECT_DIR/src" 2>/dev/null || {
|
|||||||
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
|
wmakePrintBuild -check || wrmo OpenFOAM/global/global.o 2>/dev/null
|
||||||
|
|
||||||
wmakeLnInclude -u OpenFOAM
|
wmakeLnInclude -u OpenFOAM
|
||||||
wmakeLnInclude -u OSspecific/${WM_OSTYPE:-POSIX}
|
wmakeLnInclude -u OSspecific/${WM_OSTYPE:=POSIX}
|
||||||
Pstream/Allwmake $targetType $*
|
Pstream/Allwmake $targetType $*
|
||||||
|
|
||||||
OSspecific/${WM_OSTYPE:-POSIX}/Allwmake $targetType $*
|
OSspecific/${WM_OSTYPE:=POSIX}/Allwmake $targetType $*
|
||||||
wmake $targetType OpenFOAM
|
wmake $targetType OpenFOAM
|
||||||
|
|
||||||
wmake $targetType fileFormats
|
wmake $targetType fileFormats
|
||||||
|
|||||||
@ -95,6 +95,12 @@ do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Set tutorial locations (as required)
|
||||||
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# set up a default scheme on all schemes
|
# set up a default scheme on all schemes
|
||||||
|
|||||||
@ -85,7 +85,7 @@ expandPath()
|
|||||||
# - WM_PROJECT_DIR, HOME
|
# - WM_PROJECT_DIR, HOME
|
||||||
findTarget()
|
findTarget()
|
||||||
{
|
{
|
||||||
local wmpdir=$(expandPath $WM_PROJECT_DIR)
|
local project=$(expandPath $WM_PROJECT_DIR)
|
||||||
local home=$(expandPath $HOME)
|
local home=$(expandPath $HOME)
|
||||||
local reldir="${1:-.}"
|
local reldir="${1:-.}"
|
||||||
local absdir=$(expandPath $reldir)
|
local absdir=$(expandPath $reldir)
|
||||||
@ -93,7 +93,7 @@ findTarget()
|
|||||||
while [ -n "$absdir" ]
|
while [ -n "$absdir" ]
|
||||||
do
|
do
|
||||||
case "$absdir" in
|
case "$absdir" in
|
||||||
($wmpdir | $home | /)
|
($project | $home | /)
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@ -154,21 +154,21 @@ cdSource()
|
|||||||
# - WM_PROJECT_DIR, WM_OPTIONS
|
# - WM_PROJECT_DIR, WM_OPTIONS
|
||||||
findObjectDir()
|
findObjectDir()
|
||||||
{
|
{
|
||||||
local wmpdir=$(expandPath $WM_PROJECT_DIR)
|
local project=$(expandPath $WM_PROJECT_DIR)
|
||||||
local exPath=$(expandPath ${1:-.})
|
local absdir=$(expandPath ${1:-.})
|
||||||
local objectsDir
|
local objectsDir
|
||||||
|
|
||||||
case "$exPath" in
|
case "$absdir" in
|
||||||
("$wmpdir"/*)
|
("$project"/*)
|
||||||
local buildPath=$WM_PROJECT_DIR/build/${WM_OPTIONS}
|
local buildPath=$WM_PROJECT_DIR/build/${WM_OPTIONS}
|
||||||
objectsDir=$buildPath$(echo $exPath | sed s%$wmpdir%% )
|
objectsDir=$buildPath$(echo $absdir | sed s%$project%% )
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
local path=$exPath
|
local path=$absdir
|
||||||
local appDir=.
|
local appDir=.
|
||||||
[ -d Make ] || appDir=$(findTarget .) || exit 1 # Fatal
|
[ -d Make ] || appDir=$(findTarget .) || exit 1 # Fatal
|
||||||
exPath=$(expandPath $appDir/.)
|
absdir=$(expandPath $appDir/.)
|
||||||
objectsDir=$appDir/Make/${WM_OPTIONS}$(echo $path | sed s%$exPath%% )
|
objectsDir=$appDir/Make/${WM_OPTIONS}$(echo $path | sed s%$absdir%% )
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user