Commit 1193903d authored by Henry Weller's avatar Henry Weller
Browse files

OpenFOAM-dev/etc: separated scripts for bash and csh into separate directories

etc/config.sh and etc/config.csh

This structure is more convenient to add support for other shells, e.g. zsh, fish etc.

Resolves feature request to simplify support for other shells in
http://www.openfoam.org/mantisbt/view.php?id=1232
parent 3b3bb717
* OpenFOAM Configuration
The main OpenFOAM settings are located in the parent etc/ directory. The bash
and csh shells are supported and to configure OpenFOAM source etc/bashrc or
etc/cshrc respectively which source the following files in the config.sh or
config.csh respectively:
+ =settings=: core settings
+ =aliases=: aliases for interactive shells
+ =unset=: sourced to clear as many OpenFOAM environment settings as possible
+ =ensight=: application settings for EnSight
+ =paraview=: application settings for ParaView
+ =scotch=: application settings for compiling against scotch
+ =metis=: application settings for compiling against metis 5
The config.*/example directories contains various example configuration files
for the corresponding shell:
+ =compiler=: an example of fine tuning ThirdParty compiler settings
+ =openmpi=: an example of fine tuning openmpi settings for OpenFOAM
+ =paraview=: an example of chaining to the standard config/paraview with a
different ParaView_VERSION
+ =prefs=: an example of supplying alternative site-defined settings
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -211,16 +211,16 @@ export PATH LD_LIBRARY_PATH MANPATH
# Source project setup files
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource $WM_PROJECT_DIR/etc/config/settings.sh
_foamSource $WM_PROJECT_DIR/etc/config/aliases.sh
_foamSource $WM_PROJECT_DIR/etc/config.sh/settings
_foamSource $WM_PROJECT_DIR/etc/config.sh/aliases
# Source user setup files for optional packages
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/paraview.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/ensight.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/gperftools.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/CGAL.sh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/paraview`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/ensight`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/gperftools`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.sh/CGAL`
# Clean environment paths again. Only remove duplicates
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/CGAL.csh
# config.csh/CGAL
#
# Description
# Setup file for CGAL (& boost) include/libraries.
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config/aliases.csh
# etc/config.csh/aliases
#
# Description
# Aliases for working with OpenFOAM
......@@ -42,7 +42,7 @@ alias wmDP 'wmSET WM_PRECISION_OPTION=DP'
alias wmREFRESH 'wmSET $FOAM_SETTINGS'
# clear env
alias wmUNSET 'source $WM_PROJECT_DIR/etc/config/unset.csh'
alias wmUNSET 'source $WM_PROJECT_DIR/etc/config.csh/unset'
# Toggle wmakeScheduler on/off
# - also need to set WM_HOSTS
......@@ -52,7 +52,7 @@ alias wmSchedOFF 'unsetenv WM_SCHEDULER'
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias foamPV 'source `$WM_PROJECT_DIR/etc/config/paraview.csh` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
alias foamPV 'source `$WM_PROJECT_DIR/etc/config.csh/paraview` ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
# Change directory aliases
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/ensight.csh
# config.csh/ensight
#
# Description
# Setup file for Ensight
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,11 +22,11 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/compiler.csh
# config.csh/example/compiler
#
# Description
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
# Sourced from OpenFOAM-<VERSION>/etc/config.csh/settings
#
#------------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,11 +22,11 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/openmpi.csh
# config.csh/example/openmpi
#
# Description
# Example of fine tuning openmpi settings for OpenFOAM
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.csh
# Sourced from OpenFOAM-<VERSION>/etc/config.csh/settings
#
#------------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,10 +22,10 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/paraview.csh
# config.csh/example/paraview
#
# Description
# Example of chaining to the standard config/paraview.csh with a
# Example of chaining to the standard config.csh/paraview with a
# different ParaView_VERSION
#
# Note
......@@ -38,7 +38,7 @@
# Use other (shipped) paraview.csh with a different ParaView_VERSION
#
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.csh`
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config.csh/paraview`
if ( $status == 0 ) source $foamFile ParaView_VERSION=3.12.0
unset foamFile
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/prefs.csh
# config.csh/example/prefs.csh
#
# Description
# Preset variables for the OpenFOAM configuration - C-Shell shell syntax.
......
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/paraview.csh
# config.csh/paraview
#
# Description
# Setup file for paraview-[3-5].x
......
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config/settings.csh
# etc/config.csh/settings
#
# Description
# Startup file for OpenFOAM
......@@ -209,7 +209,7 @@ unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?foamCompiler ) then
set foamCompiler=system
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " foamCompiler not set, using '$foamCompiler'"
endif
......@@ -254,7 +254,7 @@ case ThirdParty:
breaksw
default:
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
echo " Please check your settings"
echo
......@@ -262,7 +262,7 @@ case ThirdParty:
endsw
# Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/compiler.csh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/compiler`
if ( $?gcc_version ) then
set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
......@@ -275,7 +275,7 @@ case ThirdParty:
# Check that the compiler directory can be found
if ( ! -d "$gccDir" ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
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,"
......@@ -311,7 +311,7 @@ case ThirdParty:
# Check that the compiler directory can be found
if ( ! -d "$clangDir" ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
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,"
......@@ -360,7 +360,7 @@ case SYSTEMOPENMPI:
case OPENMPI:
setenv FOAM_MPI openmpi-1.10.0
# Optional configuration tweaks:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config/openmpi.csh`
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/openmpi`
setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$FOAM_MPI
......@@ -381,7 +381,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ROOT) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " Please set the environment variable MPI_ROOT to point to" \
" the base folder for the system MPI in use."
echo " Example:"
......@@ -393,7 +393,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_FLAGS) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " MPI_ARCH_FLAGS is not set. Example:"
echo
echo ' setenv MPI_ARCH_FLAGS "-DOMPI_SKIP_MPICXX"'
......@@ -402,7 +402,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_INC) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " MPI_ARCH_INC is not set. Example:"
echo
echo ' setenv MPI_ARCH_INC "-isystem $MPI_ROOT/include"'
......@@ -411,7 +411,7 @@ case SYSTEMMPI:
if ( ! ($?MPI_ARCH_LIBS) ) then
echo
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " MPI_ARCH_LIBS is not set. Example:"
echo
echo ' setenv MPI_ARCH_LIBS "-L$MPI_ROOT/lib -lmpi"'
......@@ -499,7 +499,7 @@ case SGIMPI:
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
if ( ! -d "$MPI_ROOT" ) then
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " MPI_ROOT not a valid mpt installation directory."
echo " Please set MPI_ROOT to the mpt installation directory."
echo " (usually done by loading the mpt module)"
......@@ -529,7 +529,7 @@ case INTELMPI:
if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
if ( ! -d "$MPI_ROOT" ) then
echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " MPI_ROOT not a valid mpt installation directory."
echo " Please set MPI_ROOT to the mpt installation directory."
echo " (usually done by loading the mpt module)"
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config/unset.csh
# etc/config.csh/unset
#
# Description
# Clear as many OpenFOAM environment settings as possible
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/CGAL.sh
# config.sh/CGAL
#
# Description
# Setup file for CGAL (& boost) include/libraries.
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config/aliases.sh
# etc/config.sh/aliases
#
# Description
# Aliases for working with OpenFOAM
......@@ -42,7 +42,7 @@ alias wmDP='wmSET WM_PRECISION_OPTION=DP'
alias wmREFRESH='wmSET $FOAM_SETTINGS'
# clear env
alias wmUNSET='. $WM_PROJECT_DIR/etc/config/unset.sh'
alias wmUNSET='. $WM_PROJECT_DIR/etc/config.sh/unset'
# Toggle wmakeScheduler on/off
# - also need to set WM_HOSTS
......@@ -55,7 +55,7 @@ alias wmSchedOFF='unset WM_SCHEDULER'
unset foamPV
foamPV()
{
. $WM_PROJECT_DIR/etc/config/paraview.sh ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=$1
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2
}
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/ensight.sh
# config.sh/ensight
#
# Description
# Setup file for Ensight
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,11 +22,11 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/compiler.sh
# config.sh/example/compiler
#
# Description
# Example of fine tuning ThirdParty compiler settings for OpenFOAM
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
# Sourced from OpenFOAM-<VERSION>/etc/config.sh/settings
#
#------------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,11 +22,11 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/openmpi.sh
# config.sh/example/openmpi
#
# Description
# Example of fine tuning openmpi settings for OpenFOAM
# Sourced from OpenFOAM-<VERSION>/etc/config/settings.sh
# Sourced from OpenFOAM-<VERSION>/etc/config.sh/settings
#
#------------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,10 +22,10 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/paraview.sh
# config.sh/example/paraview
#
# Description
# Example of chaining to the standard config/paraview.sh with a
# Example of chaining to the standard config.sh/paraview with a
# different ParaView_VERSION
#
# Note
......@@ -35,10 +35,10 @@
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview.sh with a different ParaView_VERSION
# Use other (shipped) paraview with a different ParaView_VERSION
#
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config/paraview.sh 2>/dev/null)
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/paraview 2>/dev/null)
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=3.12.0
unset foamFile
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/example/prefs.sh
# config.sh/example/prefs.sh
#
# Description
# Preset variables for the OpenFOAM configuration - POSIX shell syntax.
......
......@@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
......@@ -22,7 +22,7 @@
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config/gperftools.sh
# config.sh/gperftools
#
# Description
# Setup file for gperftools binaries libraries.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment