etc: Explicit control of decomposition and ParaView installation type

*** Note that this commit depends on a corresponding change in
ThirdParty-dev. Ensure that both repositories are up to date before
re-building OpenFOAM.

New environment variables have been added to explicitly control the
installation type of the thirdparty decomposition libraries and of the
ParaView visualiation software. These are set in the etc/bashrc and can
be overridden in a ~/.OpenFOAM/<version>/prefs.sh file or similar.

The variables relating to the decomposition libraries are SCOTCH_TYPE,
METIS_TYPE, PARMETIS_TYPE and ZOLTAN_TYPE, and they can take values of
none, system, or ThirdParty. In the case of ThirdParty, a
<library>_VERSION variable can also be specified. If the version is not
specified then the configuration will search for a source directory, and
if multiple such directories are found then the one with the highest
version number will be used.

The variable relating to ParaView is ParaView_TYPE, and this can be
similarly be set to none, system, or ThirdParty, and ParaView_VERSION
can also be specified when the type is ThirdParty. If the version is not
specified then the installation with the highest version number will be
used.

An example  ~/.OpenFOAM/dev/prefs.sh file, in which all decomposition
libraries are enabled, and the Scotch and ParaView versions are
explicitly set, is as follows:

    export SCOTCH_TYPE=ThirdParty
    export SCOTCH_VERSION=7.0.3
    export METIS_TYPE=ThirdParty
    export PARMETIS_TYPE=ThirdParty
    export ZOLTAN_TYPE=ThirdParty

    export ParaView_TYPE=ThirdParty
    export ParaView_VERSION=5.11.2

*** Note that if version numbers are not set then the configuration will
search for a decomposition source directory, but it will search for a
ParaView installation directory. This is because decomposition libraries
are built as part of OpenFOAM's ./Allwmake, but ParaView is not. This
distinction remains. If a local compilation of ParaView is needed, then
'./makeParaView -version X.XX.X' should be called explicitly in the
third party directory prior to building OpenFOAM.

The name of the third party directory can now also be independently set.
This simplifies some packaging processes in that it permits third party
to be located within the OpenFOAM installation directory and therefore
bundled into the same binary package.
This commit is contained in:
Will Bainbridge
2024-05-17 10:13:27 +01:00
parent a9742de070
commit 48fcb7f6d1
37 changed files with 1186 additions and 890 deletions

View File

@ -10,12 +10,6 @@ then
exit 0
fi
if [ -z "$PV_PLUGIN_PATH" ]
then
echo " Error: \$PV_PLUGIN_PATH is unset."
exit 1
fi
# Ensure CMake gets the correct C/C++ compilers
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -99,44 +99,33 @@ prefixDir="${projectDir%/*}"
# the name used for the project directory
projectDirName="${projectDir##*/}"
# version number used for debian packaging
unset versionNum
#
# handle standard and debian naming convention
#
# handle standard and packaged naming conventions
case "$projectDirName" in
OpenFOAM-*) # standard naming convention OpenFOAM-<VERSION>
version="${projectDirName##OpenFOAM-}"
;;
openfoam[0-9]*) # debian naming convention
versionNum="${projectDirName##openfoam}"
case "$versionNum" in
[4-9]) # v4-9
version="$versionNum"
OpenFOAM-*) # standard naming convention OpenFOAM-<VERSION>
version="${projectDirName##OpenFOAM-}"
;;
[1-2][0-9]) # v10 onwards
version="$versionNum"
openfoam-dev) # debian naming convention for dev
version="${projectDirName##openfoam-}"
;;
3[0-9]) # e.g. v3.0
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@')
openfoam[1-2][0-9]) # debian naming convention for v10 onwards
version="${projectDirName##openfoam}"
;;
[1-2][0-9][0-9]) # e.g. v1.7.0
version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@')
openfoam[4-9]) # debian naming convention for v4-9
version="${projectDirName##openfoam}"
;;
openfoam3[0-9]) # debian naming convention for v3.?
version=$(echo "${projectDirName##openfoam}" | sed -e 's@\(.\)\(.\)@\1.\2@')
;;
openfoam[1-2][0-9][0-9]) # debian naming convention for v1.?.? and v2.?.?
version=$(echo "${projectDirName##openfoam}" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@')
;;
app) # flatpak naming convention
version="${FLATPAK_ID##OpenFOAM-}"
;;
*)
version="$WM_PROJECT_VERSION"
echo "Error : unknown/unsupported naming convention"
exit 1
;;
esac
;;
openfoam-dev) # debian naming convention
versionNum="${projectDirName##openfoam}"
version="${versionNum##-}"
;;
*)
echo "Error : unknown/unsupported naming convention"
exit 1
;;
esac
# default mode is 'ugo'
@ -184,11 +173,6 @@ do
-v | -version)
[ "$#" -ge 2 ] || error "'$1' option requires an argument"
version="$2"
# convert x.y.z -> xyz version (if installation looked like debian)
if [ -n "$versionNum" ]
then
versionNum=$(echo "$version" | sed -e 's@\.@@g')
fi
shift
;;
--)
@ -205,15 +189,6 @@ do
shift
done
# debugging:
# echo "Installed locations:"
# for i in projectDir prefixDir projectDirName version versionNum
# do
# eval echo "$i=\$$i"
# done
# Save the essential bits of information
# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile)
nArgs=$#
@ -237,14 +212,7 @@ esac
case "$mode" in
*o*) # other (shipped)
if [ -n "$versionNum" ]
then
# debian packaging
dirList="$dirList $prefixDir/openfoam$versionNum/etc"
else
# standard packaging
dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc"
fi
dirList="$dirList $prefixDir/$projectDirName/etc"
;;
esac
set -- $dirList

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -28,9 +28,6 @@
# Description
# start paraview with the OpenFOAM libraries
#
# Note
# combining -block or -builtin options with the -region option yields
# undefined behaviour
#------------------------------------------------------------------------------
usage() {
cat<<USAGE
@ -61,19 +58,12 @@ error() {
}
pvExec () {
if [ "$ParaView_GL" = mesa ]
then
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_LIB_DIR/mesa paraview "$@"
else
paraview "$@"
fi
# For now filter out any ld.so errors. Caused by non-system compiler?
paraview "$@" 2>&1 | grep -v -F 'Inconsistency detected by ld.so'
}
noPVReader () {
noPV() {
cat<<EOF
FATAL ERROR: The official reader module for OpenFOAM data does not exist on
your system. This means that the version of ParaView you are using was not
compiled with OpenFOAM, or distributed with a packaged version of OpenFOAM.
For information on packaged versions of OpenFOAM/ParaView and compilation of
OpenFOAM/ParaView, see https://openfoam.org/download
@ -85,6 +75,25 @@ module provided with ParaView by running:
EOF
}
noPVExe () {
cat<<EOF
FATAL ERROR: A ParaView executable was not found on your system. This means
that ParaView is not installed, or that OpenFOAM has been configured to use a
different installation of ParaView from that which is installed.
EOF
noPV
}
noPVReader () {
cat<<EOF
FATAL ERROR: The reader module for OpenFOAM data was not found on your system.
This means that OpenFOAM was not built with ParaView support, or that ParaView
is not installed, or that OpenFOAM has been configured to use a different
installation of ParaView from that which is installed.
EOF
noPV
}
# We want to do nice exit when running paraview to give paraview opportunity
# to clean up
unset FOAM_ABORT
@ -99,7 +108,8 @@ export LC_ALL=C
# Reader extension
extension=OpenFOAM
requirePV=1
requirePVExe=1
requirePVReader=1
# Parse options
while [ "$#" -gt 0 ]
@ -114,7 +124,8 @@ do
;;
-builtin)
extension=foam
requirePV=0
requirePVExe=1
requirePVReader=0
shift
;;
-case)
@ -133,12 +144,14 @@ do
;;
-touch)
optTouch=true
requirePV=0
requirePVExe=0
requirePVReader=0
shift
;;
-touchAll)
optTouch=all
requirePV=0
requirePVExe=0
requirePVReader=0
shift
;;
--)
@ -154,8 +167,26 @@ do
esac
done
# Check that reader module has been built
[ $requirePV -eq 1 ] && \
# Check for incompatibility of options
if [ -n "$regionName" ]
then
case $extension in
blockMesh)
echo "FATAL ERROR: The builtin reader does not support blockMesh"
exit 1
;;
foam)
echo "FATAL ERROR: The builtin reader does not support regions"
exit 1
;;
esac
fi
# Check that the executable and/or the reader module are available
[ $requirePVExe -eq 1 ] && \
! which paraview > /dev/null 2>&1 && \
noPVExe && exit 1
[ $requirePVReader -eq 1 ] && \
! [ -f "$PV_PLUGIN_PATH/libPVFoamReader_SM.so" ] && \
noPVReader && exit 1
@ -174,14 +205,11 @@ hasDataArg()
shift
done
}
hasDataArg "$@"
# Get a sensible caseName from the directory name
# Construct a case name from the directory name
caseName=${PWD##*/}
caseFile="$caseName.$extension"
fvControls="system"
if [ -n "$regionName" ]
then
if [ ! -d constant/"$regionName" ]
@ -190,110 +218,106 @@ then
exit 1
else
caseFile="$caseName{$regionName}.$extension"
fvControls="$fvControls/$regionName"
fi
fi
# If the touch option is set, then create files and exit
case "${optTouch:-false}" in
all)
extension=OpenFOAM
# Block mesh
if [ -f system/blockMeshDict ] || [ -f constant/polyMesh/blockMeshDict ]
then
touch "$caseName.blockMesh"
echo "Created '$caseName.blockMesh'"
fi
touch "$caseName.$extension"
echo "Created '$caseName.$extension'"
# Discover probable regions
# Default region
touch "$caseName.OpenFOAM"
echo "Created '$caseName.OpenFOAM'"
# Find other probable regions
for region in constant/*
do
[ -d "$region" ] && [ -d "${region}/polyMesh" ] && \
[ -d "$region/polyMesh" ] && \
regionName=${region##*/} && \
touch "$caseName{$regionName}.$extension" && \
echo "Created '$caseName{$regionName}.$extension'"
touch "$caseName{$regionName}.OpenFOAM" && \
echo "Created '$caseName{$regionName}.OpenFOAM'"
done
exit 0
;;
true)
# Default region
touch "$caseFile"
echo "Created '$caseFile'"
exit 0
;;
esac
# Parent directory for normal or parallel results
case "$caseName" in
processor*) parentDir=".." ;;
*) parentDir="." ;;
esac
# If we have a --data=... argument, then send this directly to paraview
if [ "${hasData:-false}" = true ]
then
# Has --data=.., send directly to paraview
pvExec "$@"
else
# Check existence of essential files
warn="WARN file does not exist:"
case $extension in
blockMesh)
blockMeshDictDir=system/blockMeshDict
if [ -f constant/polyMesh/blockMeshDict ]
then
blockMeshDictDir=constant/polyMesh/blockMeshDict
fi
for check in \
system/controlDict \
$blockMeshDictDir \
;
do
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
builtin | OpenFOAM)
for check in \
system/controlDict \
;
do
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
esac
[ -n "$warn" ] || {
echo "Cannot locate OpenFOAM-format case files"
printf "Would you like to open ParaView anyway <Y|n>:"
read open
[ "$open" = "" ] || echo "$open" | grep -iqE "^y" && pvExec
exit
}
# Only create/remove caseFile if it didn't already exist
[ -e "$caseFile" ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"
echo "Created temporary '$caseFile'"
}
# For now filter out any ld.so errors. Caused by non-system compiler?
pvExec --data="$caseFile" "$@" 2>&1 \
| grep -v -F 'Inconsistency detected by ld.so'
exit 0
fi
# Check existence of essential files
warn="WARN file does not exist:"
case $extension in
blockMesh)
blockMeshDictDir=system/blockMeshDict
if [ -f constant/polyMesh/blockMeshDict ]
then
blockMeshDictDir=constant/polyMesh/blockMeshDict
fi
for check in system/controlDict $blockMeshDictDir
do
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
OpenFOAM | foam)
for check in system/controlDict
do
[ -s "$parentDir/$check" ] || [ -s "$parentDir/$check.orig" ] ||
{
[ -n "$warn" ] && echo "$warn" 1>&2
echo " $parentDir/$check" 1>&2
unset warn
}
done
;;
esac
# Warn if essential files do not exist
[ -n "$warn" ] || {
echo "Cannot locate OpenFOAM-format case files"
printf "Would you like to open ParaView anyway <Y|n>:"
read open
[ "$open" = "" ] || echo "$open" | grep -iqE "^y" && pvExec
exit
}
# Only create/remove the caseFile if it didn't already exist
[ -e "$caseFile" ] || {
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
touch "$caseFile"
echo "Created temporary '$caseFile'"
}
# Run paraview
pvExec --data="$caseFile" "$@"
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -26,7 +26,7 @@
# foamConfigurePaths
#
# Description
# hardcode installation directory
# Hard-code installation directories
#
#------------------------------------------------------------------------------
usage() {
@ -35,16 +35,12 @@ usage() {
cat<<USAGE
usage: ${0##*/}
--foamInstall dir specify installation directory (e.g. /opt)
--projectName name specify project name (e.g. openfoam220)
--projectVersion ver specify project version (e.g. 2.2.0)
--archOption arch specify architecture option (only 32 or 64 applicable)
--paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam3120)
--paraviewVersion ver specify ParaView_VERSION (e.g. 3.12.0)
--scotchArchPath dir specify SCOTCH_ARCH_PATH (e.g. /opt/OpenFOAM-scotch-6.0.0/)
--scotchVersion ver specify SCOTCH_VERSION (e.g. 6.0.0)
* hardcode paths to installation
--foamInstall dir specify installation directory (e.g. /opt)
--projectName name specify project name (e.g. openfoam11)
--thirdPartyName name specify third-party name (e.g. openfoam11/thirdparty)
--projectVersion ver specify project version (e.g. 11)
--archOption arch specify architecture option (only 32 or 64 applicable)
--dependency name:type:ver specify dependency (e.g. SCOTCH=ThirdParty:6.0.9)
USAGE
exit 1
@ -77,10 +73,10 @@ _inlineSed()
}
[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
[ -d etc ] || usage "Please run from top-level directory of installation"
unset foamInstDir projectName projectVersion archOption
unset paraviewInstall scotchArchPath
unset foamInstDir projectName thirdPartyName projectVersion archOption
unset paraviewType paraviewVersion
# Parse options
while [ "$#" -gt 0 ]
@ -95,14 +91,14 @@ do
# Replace FOAM_INST_DIR=...
_inlineSed \
etc/bashrc \
'\(.*BASH_SOURCE.*\)' \
'#\1' \
"Removing default FOAM_INST_DIR setting"
_inlineSed \
etc/bashrc \
'^export FOAM_INST_DIR=.*' \
'export FOAM_INST_DIR=.*' \
'export FOAM_INST_DIR='"$foamInstDir" \
"Setting FOAM_INST_DIR to '$foamInstDir'"
_inlineSed \
etc/cshrc \
'setenv FOAM_INST_DIR .*' \
'setenv FOAM_INST_DIR '"$foamInstDir" \
"Setting FOAM_INST_DIR to '$foamInstDir'"
shift 2
;;
-projectName | --projectName)
@ -111,9 +107,30 @@ do
# replace WM_PROJECT_DIR=...
_inlineSed \
etc/bashrc \
'WM_PROJECT_DIR=.*' \
'WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName" \
'export WM_PROJECT_DIR=.*' \
'export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName" \
"Replacing WM_PROJECT_DIR setting by $projectName"
_inlineSed \
etc/cshrc \
'setenv WM_PROJECT_DIR .*' \
'setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/'"$projectName" \
"Replacing WM_PROJECT_DIR setting by $projectName"
shift 2
;;
-thirdPartyName | --thirdPartyName)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
thirdPartyName="$2"
# replace WM_PROJECT_DIR=...
_inlineSed \
etc/bashrc \
'export WM_THIRD_PARTY_DIR=.*' \
'export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/'"$thirdPartyName" \
"Replacing WM_THIRD_PARTY_DIR setting by $thirdPartyName"
_inlineSed \
etc/cshrc \
'setenv WM_THIRD_PARTY_DIR .*' \
'setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/'"$thirdPartyName" \
"Replacing WM_THIRD_PARTY_DIR setting by $thirdPartyName"
shift 2
;;
--projectVersion)
@ -123,69 +140,72 @@ do
echo "Replacing WM_PROJECT_VERSION setting by $projectVersion"
_inlineSed \
etc/bashrc \
'WM_PROJECT_VERSION=.*' \
'WM_PROJECT_VERSION='"$projectVersion" \
'export WM_PROJECT_VERSION=.*' \
'export WM_PROJECT_VERSION='"$projectVersion" \
"Replacing WM_PROJECT_VERSION setting by $projectVersion"
_inlineSed \
etc/cshrc \
'setenv WM_PROJECT_VERSION .*' \
'setenv WM_PROJECT_VERSION '"$projectVersion" \
"Replacing WM_PROJECT_VERSION setting by $projectVersion"
shift 2
;;
-archOption | --archOption)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
archOption="$2"
current_archOption=`grep WM_ARCH_OPTION= etc/bashrc | sed "s/export WM_ARCH_OPTION=//"`
if [ "$archOption" != "$current_archOption" ]
# replace WM_ARCH_OPTION=...
_inlineSed \
etc/bashrc \
'export WM_ARCH_OPTION=.*' \
'export WM_ARCH_OPTION='"$archOption" \
"Replacing WM_ARCH_OPTION setting by '$archOption'"
_inlineSed \
etc/cshrc \
'setenv WM_ARCH_OPTION .*' \
'setenv WM_ARCH_OPTION '"$archOption" \
"Replacing WM_ARCH_OPTION setting by '$archOption'"
shift 2
;;
-dependency | --dependency)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
dependencyNameTypeVersion=$2
dependencyNameType=${dependencyNameTypeVersion%:*}
dependencyName=${dependencyNameType%=*}
dependencyVersion=${dependencyNameTypeVersion#$dependencyNameType*}
dependencyVersion=${dependencyVersion#:}
dependencyType=${dependencyNameType#$dependencyName*}
dependencyType=${dependencyType#=}
# replace ${dependencyName}_TYPE...
if [ -n "$dependencyType" ]
then
# replace WM_ARCH_OPTION=...
_inlineSed \
etc/bashrc \
'WM_ARCH_OPTION=.*' \
'WM_ARCH_OPTION='"$archOption" \
"Replacing WM_ARCH_OPTION setting by '$archOption'"
else
echo "WM_ARCH_OPTION already set to $archOption"
'export '"$dependencyName"'_TYPE=.*' \
'export '"$dependencyName"'_TYPE='"$dependencyType" \
"Replacing ${dependencyName}_TYPE setting by '$dependencyType'"
_inlineSed \
etc/cshrc \
'setenv '"$dependencyName"'_TYPE .*' \
'setenv '"$dependencyName"'_TYPE '"$dependencyType" \
"Replacing ${dependencyName}_TYPE setting by '$dependencyType'"
fi
# add/replace ${dependencyName}_VERSION...
if [ -n "$dependencyVersion" ]
then
sed -i '/export '"$dependencyName"'_VERSION=.*/d' etc/bashrc
_inlineSed \
etc/bashrc \
'\(export '"$dependencyName"'_TYPE=.*\)' \
'\1\nexport '"$dependencyName"'_VERSION='"$dependencyVersion" \
"Adding ${dependencyName}_VERSION setting '$dependencyVersion'"
sed -i '/setenv '"$dependencyName"'_VERSION .*/d' etc/cshrc
_inlineSed \
etc/cshrc \
'\(setenv '"$dependencyName"'_TYPE .*\)' \
'\1\nsetenv '"$dependencyName"'_VERSION '"$dependencyVersion" \
"Adding ${dependencyName}_VERSION setting '$dependencyVersion'"
fi
shift 2
;;
-paraviewInstall | --paraviewInstall)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewInstall="$2"
# replace ParaView_DIR=...
_inlineSed \
etc/config.sh/paraview \
'ParaView_DIR=.*' \
'ParaView_DIR='"$paraviewInstall" \
"Replacing ParaView_DIR setting by '$paraviewInstall'"
shift 2
;;
-paraviewVersion | --paraviewVersion)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
paraviewVersion="$2"
# replace ParaView_VERSION=...
_inlineSed \
etc/config.sh/paraview \
'ParaView_VERSION=.*' \
'ParaView_VERSION='"$paraviewVersion" \
"Replacing ParaView_VERSION setting by '$paraviewVersion'"
shift 2
;;
-scotchVersion | --scotchVersion)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
scotchVersion="$2"
_inlineSed \
etc/config.sh/scotch \
'SCOTCH_VERSION=.*' \
'SCOTCH_VERSION='"$scotchVersion" \
"Replacing SCOTCH_VERSION setting by '$scotchVersion'"
shift 2
;;
-scotchArchPath | --scotchArchPath)
[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
scotchArchPath="$2"
_inlineSed \
etc/config.sh/scotch \
'SCOTCH_ARCH_PATH=.*' \
'SCOTCH_ARCH_PATH='"$scotchArchPath" \
"Replacing SCOTCH_ARCH_PATH setting by '$scotchArchPath'"
shift 2
;;
*)
@ -194,26 +214,9 @@ do
esac
done
[ -n "$foamInstDir" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" \
-o -n "$paraviewInstall" -o -n "$paraviewVersion" \
-o -n "$scotchVersion" -o -n "$scotchArchPath" \
[ -n "$foamInstDir" -o -n "$projectName" -o -n "$thirdPartyName" \
-o -n "$projectVersion" -o -n "$archOption" \
-o -n "$dependencyNameTypeVersion" \
] || usage "Please specify at least one configure option"
#echo "Replacing WM_PROJECT setting by '$projectName'"
#sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
# Set WM_MPLIB=SYSTEMOPENMPI always
_inlineSed \
etc/bashrc \
'export WM_MPLIB=.*' \
'export WM_MPLIB=SYSTEMOPENMPI' \
"Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'"
## set WM_COMPILER_TYPE=system always
#_inlineSed \
# etc/bashrc \
# 'WM_COMPILER_TYPE=.*' \
# 'WM_COMPILER_TYPE=system' \
# "Replacing WM_COMPILER_TYPE setting by 'system'"
#------------------------------------------------------------------------------

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -31,8 +31,6 @@
# Note
# Not normally called directly by the user.
#------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> [archOptions]
@ -57,9 +55,11 @@ archOptions="${2:-$WM_OPTIONS}"
exit 1
}
# base arch (w/o precision, optimisation, etc)
# same as "$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION"
archOSCompilerTypes=$(echo "$archOptions" | sed -e 's@\(Int[0-9]\+\).*$@\1@')
# same as "$WM_ARCH$WM_COMPILER"
archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
archOSCompiler=$(echo "$archOptions" | sed -e 's@[DSL]P.*$@@')
# same as $WM_ARCH - eg, 'linux64'
# TODO: only works for Gcc, Icc, Clang
@ -89,10 +89,10 @@ dirList=$(
for dir in \
$packDir/platforms/$archOptions/bin \
$packDir/platforms/$archOptions/lib \
$packDir/wmake/platforms/$archCompiler \
$packDir/wmake/platforms/$archOSCompiler \
$packDir/wmake/platforms/$archOS \
$packDir/wmake/rules/General \
$packDir/wmake/rules/$archCompiler \
$packDir/wmake/rules/$archOSCompiler \
$packDir/wmake/rules/$archOS \
;
do
@ -103,7 +103,7 @@ dirList=$(
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing $archOptions ($archCompiler) port of $packDir
Packing $archOptions port of $packDir
archOS = $archOS
32bit archOS = $arch3264

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -31,8 +31,6 @@
# Note
# Not normally called directly by the user.
#------------------------------------------------------------------------------
toolsDir="${0%/*}" # this script is already located in the tools/ directory
[ $# -eq 1 -o $# -eq 2 ] || {
cat <<USAGE 1>&2
Usage : ${0##*/} <packDir> [archOptions]
@ -57,9 +55,11 @@ archOptions="${2:-$WM_OPTIONS}"
exit 1
}
# base arch (w/o precision, optimisation, etc)
# same as "$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION"
archOSCompilerTypes=$(echo "$archOptions" | sed -e 's@\(Int[0-9]\+\).*$@\1@')
# same as "$WM_ARCH$WM_COMPILER"
archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
archOSCompiler=$(echo "$archOptions" | sed -e 's@[DSL]P.*$@@')
# same as $WM_ARCH - eg, 'linux64'
# TODO: only works for Gcc, Icc, Clang
@ -73,7 +73,6 @@ arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
# check for essential directories
for dir in \
$packDir \
$packDir/platforms/$archOptions/lib \
;
do
[ -d $dir ] || {
@ -87,7 +86,8 @@ done
dirList=$(
for dir in \
$packDir/platforms/$archOptions \
$packDir/platforms/$archCompiler \
$packDir/platforms/$archOSCompilerTypes \
$packDir/platforms/$archOSCompiler \
$packDir/platforms/$archOS \
;
do
@ -109,7 +109,7 @@ dirList=$(
cat <<INFO 1>&2
-------------------------------------------------------------------------------
Packing $archOptions ($archCompiler) port of $packDir
Packing $archOptions port of $packDir
archOS = $archOS
32bit archOS = $arch3264

View File

@ -3,7 +3,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2020-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -59,7 +59,7 @@ error() {
exit 1
}
# Comparison functions
# Define comparison functions
_foamVersionCompare_eq=0
_foamVersionCompare_lt=1
_foamVersionCompare_gt=2
@ -121,9 +121,14 @@ _foamVersionGe()
# Parse arguments
[ $# -eq 3 ] || error "Incorrect arguments specified"
v1=${1##*-}
# Extraction pattern
extract='s/^.*\([^0-9]\.\|[_-]\)[vV]\?\([0-9][0-9.]*[0-9]\)\(\|[._-].*\)$/\2/g'
# Get the first version number
v1=$(echo $1 | sed $extract)
shift 1
# Get the comparison operator
case $1 in
-h | -help)
usage && exit 0
@ -149,7 +154,8 @@ case $1 in
esac
shift 1
v2=${1##*-}
# Get the second version number
v2=$(echo $1 | sed $extract)
shift 1
# Perform comparison and return

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -32,19 +32,28 @@
#------------------------------------------------------------------------------
export WM_PROJECT=OpenFOAM
export WM_THIRD_PARTY=ThirdParty
export WM_PROJECT_VERSION=dev
################################################################################
# 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.
# the directory two levels below this file, or $HOME/$WM_PROJECT if that
# directory cannot be determined.
#
# Please set to the appropriate path if the default is not correct.
[ "$BASH" ] && bashrcFile=${BASH_SOURCE}
[ "$ZSH_NAME" ] && bashrcFile=$0
if [ -n "$bashrcFile" ]
then
export FOAM_INST_DIR=$(cd $(dirname $bashrcFile)/../.. && pwd -P)
else
export FOAM_INST_DIR=$HOME/$WM_PROJECT
fi
unset bashrcFile
#
# Please set to the appropriate path if the above default is not correct. E.g.,
#
[ "$BASH" -o "$ZSH_NAME" ] && \
export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \
export FOAM_INST_DIR=$HOME/$WM_PROJECT
# export FOAM_INST_DIR=~$WM_PROJECT
# export FOAM_INST_DIR=/opt/$WM_PROJECT
# export FOAM_INST_DIR=/usr/local/$WM_PROJECT
@ -57,7 +66,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 (OpenFOAM)
export WM_COMPILER_TYPE=system
#- Compiler:
@ -92,11 +101,21 @@ export WM_MPLIB=SYSTEMOPENMPI
# WM_OSTYPE = POSIX | ???
export WM_OSTYPE=POSIX
#- Decomposition libraries:
# <library>_TYPE = none | system | ThirdParty (OpenFOAM)
export SCOTCH_TYPE=ThirdParty
export METIS_TYPE=none
export PARMETIS_TYPE=none
export ZOLTAN_TYPE=none
# ParaView_TYPE = none | system | paraviewopenfoam | ThirdParty (OpenFOAM)
export ParaView_TYPE=ThirdParty
#- Floating-point signal handling:
# set or unset
export FOAM_SIGFPE=
#- memory initialisation:
#- Memory initialisation:
# set or unset
#export FOAM_SETNAN=
@ -123,9 +142,26 @@ then
unset WM_PROJECT_DIR_REAL
fi
# Source initialisation functions
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. $WM_PROJECT_DIR/etc/config.sh/functions
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters of the form "param=keyword" or unset
# parameters with "param="
export FOAM_SETTINGS="$@"
_foamParams $@
# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
if [ ${WM_THIRD_PARTY%%/*} = ${WM_PROJECT_DIR##*/} ]
then
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/$WM_THIRD_PARTY
else
export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/$WM_THIRD_PARTY-$WM_PROJECT_VERSION
fi
if [ -d "$WM_THIRD_PARTY_DIR" ]
then
@ -151,18 +187,6 @@ fi
# ~~~~~~~~~~~~~~~~~~~~~~
export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION
# Source initialisation functions
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. $WM_PROJECT_DIR/etc/config.sh/functions
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
# Evaluate command-line parameters of the form "param=keyword" or unset
# parameters with "param="
export FOAM_SETTINGS="$@"
_foamParams $@
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
@ -219,7 +243,6 @@ fi
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamOldDirs
# Unload initialisation functions:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
. $WM_PROJECT_DIR/etc/config.sh/functions

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -84,7 +84,7 @@ alias foamVersion \
# Change ParaView version
# ~~~~~~~~~~~~~~~~~~~~~~~
alias foamPV \
'source $WM_PROJECT_DIR/etc/config.csh/paraview ParaView_VERSION=\!*; echo paraview-$ParaView_VERSION'
'source $WM_PROJECT_DIR/etc/config.csh/functions source $WM_PROJECT_DIR/etc/config.csh/paraview ParaView_VERSION=\!*; source $WM_PROJECT_DIR/etc/config.csh/functions; echo paraview-$ParaView_VERSION'
#------------------------------------------------------------------------------

83
etc/config.csh/compiler Normal file
View File

@ -0,0 +1,83 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config.csh/settings
#
# Description
# Startup file for OpenFOAM
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
#
#------------------------------------------------------------------------------
switch ("$WM_COMPILER_TYPE")
case OpenFOAM:
case ThirdParty:
# Default versions of GMP, MPFR and MPC, override as necessary
set gmp_version=gmp-5.1.2
set mpfr_version=mpfr-3.1.2
set mpc_version=mpc-1.0.1
switch ("$WM_COMPILER")
case Gcc55:
set gcc_version=gcc-5.5.0
breaksw
case Gcc65:
set gcc_version=gcc-6.5.0
breaksw
case Gcc74:
set gcc_version=gcc-7.4.0
breaksw
case Gcc82:
set gcc_version=gcc-8.2.0
breaksw
case Gcc95:
set gcc_version=gcc-9.5.0
breaksw
case Gcc111:
set gcc_version=gcc-11.1.0
breaksw
case Gcc121:
set gcc_version=gcc-12.1.0
breaksw
case Clang:
# Using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-3.7.0
breaksw
default:
/bin/cat <<USAGE
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Unknown OpenFOAM compiler type '$WM_COMPILER'
Please check your settings
USAGE
breaksw
endsw
breaksw
endsw
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -31,7 +31,7 @@
#------------------------------------------------------------------------------
# Fallback value
if (! $?CEI_HOME) then
if ( ! $?CEI_HOME ) then
setenv CEI_HOME /usr/local/ensight/CEI
endif

View File

@ -1,46 +0,0 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config.csh/example/paraview
#
# Description
# Example of chaining to the standard config.csh/paraview with a
# different ParaView_VERSION
#
# Note
# This file could be copied to a user or site location, but should never
# replace the default shipped version as this will cause an infinite loop
#
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview.csh with a different ParaView_VERSION
#
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config.csh/paraview`
if ( $status == 0 ) source $foamFile ParaView_VERSION=3.12.0
unset foamFile
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -38,7 +38,7 @@
## Specify OpenFOAM ThirdParty compiler
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# set WM_COMPILER_TYPE=ThirdParty
#setenv WM_COMPILER_TYPE ThirdParty
## Specify compiler type
## ~~~~~~~~~~~~~~~~~~~~~
@ -46,7 +46,17 @@
## Specify system openmpi
## ~~~~~~~~~~~~~~~~~~~~~~
# setenv WM_MPLIB SYSTEMOPENMPI
#setenv WM_MPLIB SYSTEMOPENMPI
## Specify options for decomposition libraries
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#setenv SCOTCH_TYPE system
#setenv METIS_TYPE ThirdParty
#setenv METIS_VERSION 5.1.0
#setenv PARMETIS_TYPE ThirdParty
#setenv ZOLTAN_TYPE ThirdParty
## Specify system ParaView
#setenv ParaView_TYPE system
#------------------------------------------------------------------------------

103
etc/config.csh/functions Normal file
View File

@ -0,0 +1,103 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# etc/config.csh/functions
#
# Description
# Initialisation script functions for the cshrc environment
# Sourced from OpenFOAM-<VERSION>/etc/cshrc
#
#------------------------------------------------------------------------------
if ( ! $?WM_CSH_FUNCTIONS ) then
# Temporary environment variable for automatically (un)loading functions
set WM_CSH_FUNCTIONS loaded
# Source files, possibly with some verbosity
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
# Evaluate command-line parameters
alias _foamParams 'foreach arg (\!*)\
switch ($arg)\
case -*:\
# stray option (not meant for us here) -> get out\
break\
breaksw\
case *=:\
# name= -> unsetenv name\
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $arg:s/=//"\
eval "unsetenv $arg:s/=//"\
breaksw\
case *=*:\
# name=value -> setenv name value\
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $arg:s/=/ /"\
eval "setenv $arg:s/=/ /"\
breaksw\
default:\
# ignore non-parameter arguments, e.g. filenames\
break\
breaksw\
endsw\
end'
# Prefix to PATH
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
# Prefix to LD_LIBRARY_PATH
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# Prefix to MANPATH
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
# Find the most recent of a list of versioned directories
alias _foamMostRecentDir 'foreach dir (\!* /dev/nul[l])\
if ( -d "$dir" ) then\
if ( $?_mostRecentDir ) then\
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $_mostRecentDir lt $dir\
if ( $status == 0 ) then\
set _mostRecentDir=$dir\
endif\
else\
set _mostRecentDir=$dir\
endif\
endif\
end\
if ( $?_mostRecentDir ) then\
echo $_mostRecentDir\
endif\
unset _mostRecentDir'
else
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset WM_CSH_FUNCTIONS
unset _foamSource
unset _foamAddPath _foamAddLib _foamAddMan
endif
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -30,9 +30,6 @@
#
#------------------------------------------------------------------------------
# Communications library
# ~~~~~~~~~~~~~~~~~~~~~~
unsetenv MPI_ARCH_PATH MPI_HOME FOAM_MPI_LIBBIN
switch ("$WM_MPLIB")
@ -43,7 +40,7 @@ case SYSTEMOPENMPI:
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
# Include files and libraries.
# include files and libraries.
setenv MPI_ARCH_PATH "${libDir:h}"
_foamAddLib $libDir
@ -266,7 +263,6 @@ if ( "$FOAM_MPI" != dummy ) then
endif
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?minBufferSize ) set minBufferSize=20000000
@ -279,4 +275,9 @@ else
setenv MPI_BUFFER_SIZE $minBufferSize
endif
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset minBufferSize
#------------------------------------------------------------------------------

View File

@ -28,14 +28,8 @@
# Setup file for paraview-[4-5].x
# Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
#
# Note
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
# are required for building plugins
#
#------------------------------------------------------------------------------
if ( ! $?ParaView_DIR ) setenv ParaView_DIR
# Clean the PATH
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
"/opt/paraviewopenfoam \
@ -44,106 +38,128 @@ set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
`
if ( $status == 0 ) setenv PATH $cleaned
# Determine the cmake to be used. Take the most recent.
unsetenv CMAKE_HOME CMAKE_ROOT
set nonomatch
foreach cmake ( $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake-* )
if ( -d $cmake ) then
if ( $?CMAKE_HOME ) then
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $CMAKE_HOME lt $cmake
endif
if ( ! $?CMAKE_HOME || $status == 0 ) then
setenv CMAKE_HOME $cmake
setenv CMAKE_ROOT $cmake
endif
endif
end
if ( $?CMAKE_HOME ) then
setenv PATH $cmake/bin:${PATH}
# Detect the most recent version of cmake available and add to the PATH
set cmakeDir=`eval _foamMostRecentDir "$WM_THIRD_PARTY_DIR"/platforms/$WM_ARCH$WM_COMPILER/cmake-*`
if ( "$cmakeDir" != "" ) then
setenv PATH $cmakeDir/bin:$PATH
endif
unset cmakeDir
#- ParaView version, automatically determine major version:
#setenv ParaView_VERSION 5.6.3
setenv ParaView_VERSION 5.10.1
setenv ParaView_MAJOR detect
# Set up the paraview environment
switch ("$ParaView_TYPE")
case none:
#setenv ParaView_GL system
setenv ParaView_GL mesa
# Evaluate command-line parameters for ParaView
while ( $#argv > 0 )
switch ($argv[1])
case ParaView*=*:
# name=value -> setenv name value
eval "setenv $argv[1]:s/=/ /"
breaksw
endsw
shift
end
# Set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
case "$ParaView_MAJOR".*:
# Version and major appear to correspond
unset PV_PLUGIN_PATH
breaksw
case [0-9]*:
# Extract major from the version
setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
case system:
# Look for a paraview installation
set pvserverExe=`which pvserver 2> /dev/null`
if ( $status == 0 ) then
set pvserverBinDir=`dirname $pvserverExe`
set paraviewBinDir=`cd $pvserverBinDir && pwd -P`
endif
# Set the environment
if ( $?paraviewBinDir ) then
if ( -d "$paraviewBinDir" ) then
setenv ParaView_DIR `dirname paraviewBinDir`
export ParaView_LIB_DIR `unset LD_LIBRARY_PATH && \
ldd $paraviewBinDir/paraview | \
grep -o "/.*/libpqCore-pv.*.so" | \
xargs dirname`
setenv ParaView_VERSION `unset LD_LIBRARY_PATH && \
pvserver --version 2> /dev/null | \
awk '{print $NF}'`
setenv ParaView_MAJOR `echo $ParaView_VERSION | sed 's/\.[^\.]\+$//g'`
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-$ParaView_MAJOR
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the library path
setenv LD_LIBRARY_PATH ${ParaView_LIB_DIR}:${PV_PLUGIN_PATH}:${LD_LIBRARY_PATH}
endif
endif
unset pvserverExe paraviewBinDir
breaksw
case paraviewopenfoam:
# Look for a paraview installation. The version should be set externally.
if ( $?ParaView_VERSION ) then
setenv ParaView_MAJOR `echo $ParaView_VERSION | sed 's/\.[^\.]\+$//g'`
set paraviewDir=/opt/paraviewopenfoam`echo $ParaView_MAJOR | tr -d '.'`
endif
# Set the environment
if ( $?paraviewDir ) then
if ( -d "$paraviewDir" ) then
setenv ParaView_DIR $paraviewDir
setenv ParaView_LIB_DIR `echo "$ParaView_DIR"/lib* | tr ' ' ':'`
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-$ParaView_MAJOR
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the path and the library path
setenv PATH $ParaView_DIR/bin:${PATH}
setenv LD_LIBRARY_PATH ${ParaView_LIB_DIR}:${PV_PLUGIN_PATH}:${LD_LIBRARY_PATH}
endif
endif
unset paraviewDir
breaksw
case OpenFOAM:
case ThirdParty:
# Look for a paraview installation
if ( ! $?ParaView_VERSION ) then
set paraviewDir=`eval _foamMostRecentDir "$WM_THIRD_PARTY_DIR"/platforms/$WM_ARCH$WM_COMPILER/ParaView-*`
else
set paraviewDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
endif
# Set the environment
if ( -d "$paraviewDir" ) then
setenv ParaView_DIR $paraviewDir
setenv ParaView_LIB_DIR `echo "$ParaView_DIR"/lib* | tr ' ' ':'`
setenv ParaView_VERSION `echo $ParaView_DIR | sed 's/.*ParaView-//g'`
setenv ParaView_MAJOR `echo $ParaView_VERSION | sed 's/\.[^\.]\+$//g'`
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-$ParaView_MAJOR
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the path and the library path
setenv PATH $ParaView_DIR/bin:${PATH}
setenv LD_LIBRARY_PATH ${ParaView_LIB_DIR}:${PV_PLUGIN_PATH}:${LD_LIBRARY_PATH}
# Add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if ( -r $paraviewPython ) then
if ( $?PYTHONPATH ) then
setenv PYTHONPATH $PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
else
setenv PYTHONPATH $paraviewPython:$ParaView_LIB_DIR
endif
endif
unset paraviewPython
endif
unset paraviewDir
breaksw
endsw
# Set the binary and source directories
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
set paraviewSrcDir=$WM_THIRD_PARTY_DIR/ParaView-${ParaView_VERSION}
# Set paths if binaries or source are present
if ( -d $ParaView_DIR || -d $paraviewSrcDir ) then
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-${ParaView_MAJOR}
set paraviewArch=
if ( -d $ParaView_DIR/lib64 ) then
set paraviewArch=64
endif
set paraviewLibSubDir=
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $ParaView_VERSION lt 5.5.0
if ( $status == 0 ) then
set paraviewLibSubDir=/paraview-$ParaView_MAJOR
endif
setenv ParaView_LIB_DIR $ParaView_DIR/lib$paraviewArch$paraviewLibSubDir
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv LD_LIBRARY_PATH "${ParaView_LIB_DIR}:${LD_LIBRARY_PATH}"
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
endif
# Add in python libraries if required
set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if ( -r $paraviewPython ) then
if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_LIB_DIR
else
setenv PYTHONPATH ${paraviewPython}:$ParaView_LIB_DIR
endif
endif
# Alias paraview to launch with mesa if necessary
if ("$ParaView_GL" == mesa) then
alias paraview 'env LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ParaView_LIB_DIR}/mesa paraview'
endif
else
unsetenv PV_PLUGIN_PATH
# Report
if ( $?ParaView_DIR ) then
if ( -d "$ParaView_DIR" && $?FOAM_VERBOSE && $?prompt ) then
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
endif
endif
unset cleaned cmake paraviewInstDir paraviewPython
unset cleaned
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -30,27 +30,26 @@
#
#------------------------------------------------------------------------------
# Prefix to PATH
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
# Prefix to LD_LIBRARY_PATH
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
# Prefix to MANPATH
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
# Define compilation flags for the given system type
switch ($WM_ARCH)
case Linux:
setenv WM_ARCH linux
# Compiler specifics
switch (`uname -m`)
case i686:
setenv WM_ARCH_OPTION 32
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-fPIC'
setenv WM_CXXFLAGS '-fPIC -std=c++0x'
setenv WM_LDFLAGS
breaksw
case x86_64:
@ -91,6 +90,17 @@ case Linux:
setenv WM_LDFLAGS ''
breaksw
case armv7l:
setenv WM_ARCH linuxARM7
setenv WM_ARCH_OPTION 32
setenv WM_COMPILER_LIB_ARCH 32
setenv WM_CC 'gcc'
setenv WM_CXX 'g++'
setenv WM_CFLAGS '-fPIC'
setenv WM_CXXFLAGS '-fPIC -std=c++0x'
setenv WM_LDFLAGS
breaksw
case ppc64:
setenv WM_ARCH linuxPPC64
setenv WM_COMPILER_LIB_ARCH 64
@ -129,13 +139,14 @@ case SunOS:
setenv WM_LDFLAGS '-mabi=64 -G0'
breaksw
default:
echo
echo "Your '$WM_ARCH' operating system is not supported by this release"
echo "of OpenFOAM. For further assistance, please contact https://openfoam.org"
echo
breaksw
default: # An unsupported operating system
/bin/cat <<USAGE
Your "$WM_ARCH" operating system is not supported by this release
of OpenFOAM. For further assistance, please contact https://openfoam.org
USAGE
breaksw
endsw
@ -213,59 +224,23 @@ _foamAddLib ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_L
unset gcc_version gmp_version mpfr_version mpc_version
unsetenv MPFR_ARCH_PATH GMP_ARCH_PATH
# Location of compiler installation
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( ! $?WM_COMPILER_TYPE ) then
set WM_COMPILER_TYPE=system
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'"
/bin/cat <<USAGE
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'
USAGE
endif
# Load configured compiler versions, regardless of the compiler type
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile config.csh/compiler`
switch ("$WM_COMPILER_TYPE")
case OpenFOAM:
case ThirdParty:
# Default versions of GMP, MPFR and MPC, override as necessary
set gmp_version=gmp-5.1.2
set mpfr_version=mpfr-3.1.2
set mpc_version=mpc-1.0.1
switch ("$WM_COMPILER")
case Gcc55:
set gcc_version=gcc-5.5.0
breaksw
case Gcc65:
set gcc_version=gcc-6.5.0
breaksw
case Gcc74:
set gcc_version=gcc-7.4.0
breaksw
case Gcc82:
set gcc_version=gcc-8.2.0
breaksw
case Gcc111:
set gcc_version=gcc-11.1.0
breaksw
case Gcc121:
set gcc_version=gcc-12.1.0
breaksw
case Clang:
# Using clang - not gcc
setenv WM_CC 'clang'
setenv WM_CXX 'clang++'
set clang_version=llvm-3.7.0
breaksw
default:
echo
echo "Warning in $WM_PROJECT_DIR/etc/config.csh/settings:"
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'"
echo " Please check your settings"
echo
breaksw
endsw
# Optional configuration tweaks:
_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
@ -277,13 +252,14 @@ 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
/bin/cat <<USAGE
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find $gccDir installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'WM_COMPILER_TYPE' setting to 'system'
USAGE
endif
_foamAddMan $gccDir/man
@ -302,27 +278,27 @@ case ThirdParty:
endif
endif
unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
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
/bin/cat <<USAGE
Warning in $WM_PROJECT_DIR/etc/config.csh/settings:
Cannot find $clangDir installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'WM_COMPILER_TYPE' setting to 'system'
USAGE
endif
_foamAddMan $clangDir/man
_foamAddMan $clangDir/share/man
_foamAddPath $clangDir/bin
endif
unset clang_version clangDir
breaksw
case system:
@ -330,16 +306,16 @@ case system:
breaksw
default:
echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported"
echo " treating as 'system' instead"
/bin/cat <<USAGE
Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported
treating as 'system' instead
USAGE
breaksw
endsw
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
#- keep _foamAddPath _foamAddLib _foamAddMan
unset minBufferSize
unsetenv WM_COMPILER_TYPE
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -30,7 +30,6 @@
#------------------------------------------------------------------------------
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
unset foamClean
if ( $?WM_PROJECT_DIR ) then
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
@ -78,6 +77,7 @@ unsetenv WM_PROJECT_SITE
unsetenv WM_PROJECT_USER_DIR
unsetenv WM_PROJECT_VERSION
unsetenv WM_SCHEDULER
unsetenv WM_THIRD_PARTY
unsetenv WM_THIRD_PARTY_DIR
@ -106,6 +106,9 @@ unsetenv FOAM_TUTORIALS
unsetenv FOAM_USER_APPBIN
unsetenv FOAM_USER_LIBBIN
unsetenv FOAM_UTILITIES
unsetenv FOAM_SETNAN
unsetenv FOAM_VERBOSE
unsetenv FOAM_ABORT
#------------------------------------------------------------------------------
@ -113,20 +116,28 @@ unsetenv FOAM_UTILITIES
unsetenv MPI_ARCH_PATH
unsetenv MPI_BUFFER_SIZE
unsetenv OPAL_PREFIX
#------------------------------------------------------------------------------
# Unset Ensight/ParaView-related environment variables
# Unset Ensight/Decomposition/ParaView-related environment variables
unsetenv ENSIGHT9_READER
unsetenv CMAKE_HOME
unsetenv SCOTCH_TYPE
unsetenv SCOTCH_VERSION
unsetenv METIS_TYPE
unsetenv METIS_VERSION
unsetenv PARMETIS_TYPE
unsetenv PARMETIS_VERSION
unsetenv ZOLTAN_TYPE
unsetenv ZOLTAN_VERSION
unsetenv ParaView_TYPE
unsetenv ParaView_DIR
unsetenv ParaView_INCLUDE_DIR
unsetenv ParaView_LIB_DIR
unsetenv ParaView_MAJOR
unsetenv ParaView_VERSION
unsetenv ParaView_GL
unsetenv PV_PLUGIN_PATH
@ -158,6 +169,7 @@ endif
unset cleaned foamClean foamOldDirs
#------------------------------------------------------------------------------
# Cleanup aliases

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -110,7 +110,9 @@ foamVersion()
unset foamPV
foamPV()
{
. $WM_PROJECT_DIR/etc/config.sh/functions
. $WM_PROJECT_DIR/etc/config.sh/paraview ParaView_VERSION=$1
. $WM_PROJECT_DIR/etc/config.sh/functions
echo "paraview-$ParaView_VERSION (major: $ParaView_MAJOR)" 1>&2
}

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -67,12 +67,16 @@ OpenFOAM | ThirdParty)
clang_version=llvm-3.7.0
;;
*)
echo 1>&2
echo "Warning in $WM_PROJECT_DIR/etc/config.sh/compiler:" 1>&2
echo " Unknown OpenFOAM compiler type '$WM_COMPILER'" 1>&2
echo " Please check your settings" 1>&2
echo 1>&2
/bin/cat <<USAGE 1>&2
Warning in $WM_PROJECT_DIR/etc/config.sh/compiler:
Unknown OpenFOAM compiler type '$WM_COMPILER'
Please check your settings
USAGE
;;
esac
;;
esac
#------------------------------------------------------------------------------

View File

@ -1,46 +0,0 @@
#----------------------------------*-sh-*--------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# File
# config.sh/example/paraview
#
# Description
# Example of chaining to the standard config.sh/paraview with a
# different ParaView_VERSION
#
# Note
# This file could be copied to a user or site location, but should never
# replace the default shipped version as this will cause an infinite loop.
#
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview with a different ParaView_VERSION
#
foamFile=$($WM_PROJECT_DIR/bin/foamEtcFile -mode o config.sh/paraview 2>/dev/null)
[ $? -eq 0 ] && . $foamFile ParaView_VERSION=3.12.0
unset foamFile
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -38,7 +38,7 @@
## Specify OpenFOAM ThirdParty compiler
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#WM_COMPILER_TYPE=ThirdParty
#export WM_COMPILER_TYPE=ThirdParty
## Specify compiler type
## ~~~~~~~~~~~~~~~~~~~~~
@ -48,5 +48,15 @@
## ~~~~~~~~~~~~~~~~~~~~~~
#export WM_MPLIB=SYSTEMOPENMPI
## Specify options for decomposition libraries
## ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#export SCOTCH_TYPE=system
#export METIS_TYPE=ThirdParty
#export METIS_VERSION=5.1.0
#export PARMETIS_TYPE=ThirdParty
#export ZOLTAN_TYPE=ThirdParty
## Specify system ParaView
#export ParaView_TYPE=system
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -26,7 +26,7 @@
#
# Description
# Initialisation script functions for the bashrc environment
# Sourced from OpenFOAM-<VERSION>/etc/config.sh/bashrc
# Sourced from OpenFOAM-<VERSION>/etc/bashrc
#
#------------------------------------------------------------------------------
@ -102,12 +102,44 @@ then
done
}
# Find the most recent of a list of versioned directories
_foamMostRecentDir()
{
_mostRecentDir=
while [ $# -gt 0 ]
do
if [ -d "$1" ]
then
if [ -z "$_mostRecentDir" ] ||
"$WM_PROJECT_DIR"/bin/tools/foamVersionCompare \
"$_mostRecentDir" lt $1
then
_mostRecentDir=$1
fi
fi
shift
done
if [ -n "$_mostRecentDir" ]
then
echo "$_mostRecentDir"
fi
unset _mostRecentDir
}
else
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset WM_BASH_FUNCTIONS
unset _foamSource
unset _foamParams
unset _foamAddPath _foamAddLib _foamAddMan
unset _foamSource _foamParams
unset _foamMostRecentDir
fi
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2013-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -34,7 +34,37 @@
#
#------------------------------------------------------------------------------
export METIS_VERSION=metis-5.1.0
export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$METIS_VERSION
# Load functions
. $WM_PROJECT_DIR/etc/config.sh/functions
# Find the path to the metis installation
case "$METIS_TYPE" in
none)
;;
system)
export METIS_VERSION=system
export METIS_ARCH_PATH=/usr
;;
OpenFOAM | ThirdParty)
# Look for the source directory
if [ -z "$METIS_VERSION" ]
then
metisSrcDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/metis-*)
else
metisSrcDir=$WM_THIRD_PARTY_DIR/metis-$METIS_VERSION
fi
# Set the version and the installation path
if [ -d "$metisSrcDir" ]
then
export METIS_VERSION=${metisSrcDir##*metis-}
export METIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/metis-$METIS_VERSION
fi
# Clean up
unset metisSrcDir
;;
esac
# Unload functions
. $WM_PROJECT_DIR/etc/config.sh/functions
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -267,7 +267,6 @@ then
fi
# Set the minimum MPI buffer size (used by all platforms except SGI MPI)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: ${minBufferSize:=20000000}

View File

@ -34,7 +34,38 @@
#
#------------------------------------------------------------------------------
export PARMETIS_VERSION=parmetis-4.0.3
export PARMETIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$PARMETIS_VERSION
# Load functions
. $WM_PROJECT_DIR/etc/config.sh/functions
# Find the path to the parMetis installation
case "$PARMETIS_TYPE" in
none)
;;
system)
export PARMETIS_VERSION=system
export PARMETIS_ARCH_PATH=/usr
;;
OpenFOAM | ThirdParty)
# Look for the source directory
if [ -z "$PARMETIS_VERSION" ]
then
parMetisSrcDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/parmetis-*)
else
parMetisSrcDir=$WM_THIRD_PARTY_DIR/parmetis-$PARMETIS_VERSION
fi
# Set the version and the installation path
if [ -d "$parMetisSrcDir" ]
then
export PARMETIS_VERSION=${parMetisSrcDir##*parmetis-}
export PARMETIS_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/parmetis-$PARMETIS_VERSION
fi
# Clean up
unset parMetisSrcDir
;;
esac
# Unload functions
. $WM_PROJECT_DIR/etc/config.sh/functions
#------------------------------------------------------------------------------

View File

@ -28,135 +28,138 @@
# Setup file for paraview-[4-5].x
# Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
#
# Note
# The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
# are required for building plugins
#------------------------------------------------------------------------------
# Clean the PATH
cleaned=$($WM_PROJECT_DIR/bin/foamCleanPath "$PATH" \
cleaned=$("$WM_PROJECT_DIR"/bin/foamCleanPath "$PATH" \
"/opt/paraviewopenfoam \
$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- \
$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-" \
) \
&& PATH="$cleaned"
# Determine the cmake to be used. Take the most recent.
unset CMAKE_HOME CMAKE_ROOT
for cmake in $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake-*
do
if [ -d $cmake ]
then
if [ -z $CMAKE_HOME ] || \
$WM_PROJECT_DIR/bin/tools/foamVersionCompare $CMAKE_HOME lt $cmake
then
export CMAKE_HOME=$cmake
export CMAKE_ROOT=$cmake
fi
fi
done
if [ -n $CMAKE_HOME ]
# Detect the most recent version of cmake available and add to the PATH
cmakeDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/platforms/$WM_ARCH$WM_COMPILER/cmake-*)
if [ -n "$cmakeDir" ]
then
export PATH=$cmake/bin:$PATH
export PATH=$cmakeDir/bin:$PATH
fi
unset cmakeDir
#- ParaView version, automatically determine major version
#export ParaView_VERSION=5.6.3
export ParaView_VERSION=5.10.1
export ParaView_MAJOR=detect
#export ParaView_GL=system
export ParaView_GL=mesa
# Evaluate command-line parameters for ParaView
_foamParaviewEval()
{
while [ $# -gt 0 ]
do
case "$1" in
ParaView*=*)
# name=value -> export name=value
eval "export $1"
;;
esac
shift
done
}
# Evaluate command-line parameters
_foamParaviewEval $@
# Set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
case "$ParaView_VERSION" in
"$ParaView_MAJOR".* )
# Version and major appear to correspond
# Set up the paraview environment
case "$ParaView_TYPE" in
none)
;;
[0-9]*)
# Extract major from the version
ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
system)
# Look for a paraview installation
if pvserverExe=$(which pvserver 2> /dev/null)
then
paraviewBinDir=$(dirname $pvserverExe)
paraviewBinDir=$(cd $paraviewBinDir && pwd -P)
fi
# Set the environment
if [ -d "$paraviewBinDir" ]
then
export ParaView_DIR=$(dirname $paraviewBinDir)
export ParaView_LIB_DIR=$(unset LD_LIBRARY_PATH && \
ldd $paraviewBinDir/paraview | \
grep -o "/.*/libpqCore-pv.*.so" | \
xargs dirname)
export ParaView_VERSION=$(unset LD_LIBRARY_PATH && \
pvserver --version 2> /dev/null | \
awk '{print $NF}')
export ParaView_MAJOR=${ParaView_VERSION%.*}
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the library path
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$PV_PLUGIN_PATH:$LD_LIBRARY_PATH
fi
unset pvserverExe paraviewBinDir
;;
paraviewopenfoam)
# Look for a paraview installation. The version should be set externally.
if [ -n "$ParaView_VERSION" ]
then
export ParaView_MAJOR=${ParaView_VERSION%.*}
paraviewDir=/opt/paraviewopenfoam$(echo "$ParaView_MAJOR" | tr -d '.')
fi
# Set the environment
if [ -d "$paraviewDir" ]
then
export ParaView_DIR=$paraviewDir
export ParaView_LIB_DIR=$(echo "$ParaView_DIR"/lib* | tr ' ' ':')
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the path and the library path
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$PV_PLUGIN_PATH:$LD_LIBRARY_PATH
fi
unset paraviewDir
;;
OpenFOAM | ThirdParty)
# Look for a paraview installation
if [ -z "$ParaView_VERSION" ]
then
paraviewDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/platforms/$WM_ARCH$WM_COMPILER/ParaView-*)
else
paraviewDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
fi
# Set the environment
if [ -d "$paraviewDir" ]
then
export ParaView_DIR=$paraviewDir
export ParaView_LIB_DIR=$(echo "$ParaView_DIR"/lib* | tr ' ' ':')
export ParaView_VERSION=${paraviewDir##*ParaView-}
export ParaView_MAJOR=${ParaView_VERSION%.*}
export ParaView_INCLUDE_DIR=$paraviewDir/include/paraview-$ParaView_MAJOR
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
# Add to the path and the library path
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$PV_PLUGIN_PATH:$LD_LIBRARY_PATH
# Add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if [ -r "$paraviewPython" ]
then
if [ "$PYTHONPATH" ]
then
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
else
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
fi
fi
unset paraviewPython
fi
unset paraviewDir
;;
esac
export ParaView_VERSION ParaView_MAJOR
# Set the binary and source directories
export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/ParaView-$ParaView_VERSION
paraviewSrcDir=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
# Set paths if binaries or source are present
if [ -d $ParaView_DIR -o -d $paraviewSrcDir ]
# Report
if [ "$FOAM_VERBOSE" ] && [ "$PS1" ] && [ -d "$ParaView_DIR" ]
then
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$ParaView_MAJOR
paraviewArch=
if [ -d $ParaView_DIR/lib64 ]
then
paraviewArch=64
fi
paraviewLibSubDir=
if $WM_PROJECT_DIR/bin/tools/foamVersionCompare $ParaView_VERSION lt 5.5.0
then
paraviewLibSubDir=/paraview-$ParaView_MAJOR
fi
export ParaView_LIB_DIR=$ParaView_DIR/lib$paraviewArch$paraviewLibSubDir
export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_LIB_DIR:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
fi
# Add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if [ -r $paraviewPython ]
then
if [ "$PYTHONPATH" ]
then
export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_LIB_DIR
else
export PYTHONPATH=$paraviewPython:$ParaView_LIB_DIR
fi
fi
# Alias paraview to launch with mesa if necessary
if [ "$ParaView_GL" = mesa ]
then
alias paraview='LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ParaView_LIB_DIR/mesa paraview'
fi
else
unset PV_PLUGIN_PATH
echo "Using paraview"
echo " ParaView_DIR : $ParaView_DIR"
echo " ParaView_LIB_DIR : $ParaView_LIB_DIR"
echo " ParaView_INCLUDE_DIR : $ParaView_INCLUDE_DIR"
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
fi
unset _foamParaviewEval
unset cleaned cmake paraviewInstDir paraviewPython
unset cleaned
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -32,12 +32,39 @@
# A csh version is not needed, since the values here are only sourced
# during the wmake process
#
# If Scotch is to be entirely disabled, either rename this file or create
# an empty one with the same name at a user or site location.
#
#------------------------------------------------------------------------------
export SCOTCH_VERSION=scotch_6.0.9
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$SCOTCH_VERSION
# Load functions
. $WM_PROJECT_DIR/etc/config.sh/functions
# Find the path to the scotch installation
case "$SCOTCH_TYPE" in
none)
;;
system)
export SCOTCH_VERSION=system
export SCOTCH_ARCH_PATH=/usr
;;
OpenFOAM | ThirdParty)
# Look for the source directory
if [ -z "$SCOTCH_VERSION" ]
then
scotchSrcDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/scotch_*)
else
scotchSrcDir=$WM_THIRD_PARTY_DIR/scotch_$SCOTCH_VERSION
fi
# Set the version and the installation path
if [ -d "$scotchSrcDir" ]
then
export SCOTCH_VERSION=${scotchSrcDir##*scotch_}
export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/scotch_$SCOTCH_VERSION
fi
# Clean up
unset scotchSrcDir
;;
esac
# Unload functions
. $WM_PROJECT_DIR/etc/config.sh/functions
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -33,20 +33,21 @@
# Set environment variables according to system type
export WM_ARCH=`uname -s`
# Define compilation flags for the system type
case "$WM_ARCH" in
Linux)
WM_ARCH=linux
# Compiler specifics
case `uname -m` in
i686)
export WM_ARCH_OPTION=32
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_LDFLAGS=
;;
i686)
export WM_ARCH_OPTION=32
export WM_CC='gcc'
export WM_CXX='g++'
export WM_CFLAGS='-fPIC'
export WM_CXXFLAGS='-fPIC -std=c++0x'
export WM_LDFLAGS=
;;
x86_64)
case "$WM_ARCH_OPTION" in
@ -58,6 +59,7 @@ Linux)
export WM_CXXFLAGS='-m32 -fPIC -std=c++0x'
export WM_LDFLAGS='-m32'
;;
64)
WM_ARCH=linux64
export WM_COMPILER_LIB_ARCH=64
@ -67,10 +69,11 @@ Linux)
export WM_CXXFLAGS='-m64 -fPIC -std=c++0x'
export WM_LDFLAGS='-m64'
;;
*)
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64"\
1>&2
echo "Unknown WM_ARCH_OPTION '$WM_ARCH_OPTION', should be 32 or 64" 1>&2
;;
esac
;;
@ -132,7 +135,7 @@ SunOS)
export WM_LDFLAGS='-mabi=64 -G0'
;;
*) # An unsupported operating system
*) # An unsupported operating system
/bin/cat <<USAGE 1>&2
Your "$WM_ARCH" operating system is not supported by this release
@ -220,8 +223,10 @@ unset MPFR_ARCH_PATH GMP_ARCH_PATH
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
/bin/cat <<USAGE 1>&2
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
WM_COMPILER_TYPE not set, using '$WM_COMPILER_TYPE'
USAGE
fi
# Load configured compiler versions, regardless of the compiler type
@ -236,18 +241,23 @@ OpenFOAM | ThirdParty)
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
mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
if [ -n "$mpc_version" ]
then
mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
fi
# 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
}
if [ ! -d "$gccDir" ]
then
/bin/cat <<USAGE 1>&2
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
Cannot find $gccDir installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'WM_COMPILER_TYPE' setting to 'system'
USAGE
fi
_foamAddMan $gccDir/man
_foamAddPath $gccDir/bin
@ -266,35 +276,45 @@ OpenFOAM | ThirdParty)
fi
fi
unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
if [ -n "$clang_version" ]
then
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
}
if [ ! -d "$clangDir" ]
then
/bin/cat <<USAGE 1>&2
Warning in $WM_PROJECT_DIR/etc/config.sh/settings:
Cannot find $clangDir installation.
Please install this compiler version or if you wish to use the system compiler,
change the 'WM_COMPILER_TYPE' setting to 'system'
USAGE
fi
_foamAddMan $clangDir/share/man
_foamAddPath $clangDir/bin
fi
unset clang_version clangDir
;;
system)
# Use system compiler
;;
*)
echo "Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported" 1>&2
echo " treating as 'system' instead" 1>&2
/bin/cat <<USAGE 1>&2
Warn: WM_COMPILER_TYPE='$WM_COMPILER_TYPE' is unsupported
treating as 'system' instead
USAGE
;;
esac
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset WM_COMPILER_TYPE
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -69,6 +69,7 @@ unset WM_PROJECT_SITE
unset WM_PROJECT_USER_DIR
unset WM_PROJECT_VERSION
unset WM_SCHEDULER
unset WM_THIRD_PARTY
unset WM_THIRD_PARTY_DIR
@ -97,6 +98,9 @@ unset FOAM_TUTORIALS
unset FOAM_USER_APPBIN
unset FOAM_USER_LIBBIN
unset FOAM_UTILITIES
unset FOAM_SETNAN
unset FOAM_VERBOSE
unset FOAM_ABORT
#------------------------------------------------------------------------------
@ -113,16 +117,23 @@ fi
#------------------------------------------------------------------------------
# Unset Ensight/ParaView-related environment variables
# Unset Ensight/Decomposition/ParaView-related environment variables
unset ENSIGHT9_READER
unset CMAKE_HOME
unset SCOTCH_TYPE
unset SCOTCH_VERSION
unset METIS_TYPE
unset METIS_VERSION
unset PARMETIS_TYPE
unset PARMETIS_VERSION
unset ZOLTAN_TYPE
unset ZOLTAN_VERSION
unset ParaView_TYPE
unset ParaView_DIR
unset ParaView_INCLUDE_DIR
unset ParaView_LIB_DIR
unset ParaView_MAJOR
unset ParaView_VERSION
unset ParaView_GL
unset PV_PLUGIN_PATH
@ -155,6 +166,7 @@ unalias wm32
unalias wmSP
unalias wmDP
unset wmRefresh
unalias wmUnset
unalias wmSchedOn
@ -171,7 +183,6 @@ unalias util
unalias tut
unalias run
unset wmRefresh
unset foamVersion
unset foamPV

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2021-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -34,7 +34,38 @@
#
#------------------------------------------------------------------------------
export ZOLTAN_VERSION=Zoltan-3.90
export ZOLTAN_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/$ZOLTAN_VERSION
# Load functions
. $WM_PROJECT_DIR/etc/config.sh/functions
# Find the path to the zoltan installation
case "$ZOLTAN_TYPE" in
none)
;;
system)
export ZOLTAN_VERSION=system
export ZOLTAN_ARCH_PATH=/usr
;;
OpenFOAM | ThirdParty)
# Look for the source directory
if [ -z "$ZOLTAN_VERSION" ]
then
zoltanSrcDir=$(_foamMostRecentDir "$WM_THIRD_PARTY_DIR"/Zoltan-*)
else
zoltanSrcDir=$WM_THIRD_PARTY_DIR/Zoltan-$ZOLTAN_VERSION
fi
# Set the version and the installation path
if [ -d "$zoltanSrcDir" ]
then
export ZOLTAN_VERSION=${zoltanSrcDir##*Zoltan-}
export ZOLTAN_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_LABEL_OPTION/Zoltan-$ZOLTAN_VERSION
fi
# Clean up
unset zoltanSrcDir
;;
esac
# Unload functions
. $WM_PROJECT_DIR/etc/config.sh/functions
#------------------------------------------------------------------------------

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | Website: https://openfoam.org
# \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
# \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -31,19 +31,26 @@
#------------------------------------------------------------------------------
setenv WM_PROJECT OpenFOAM
setenv WM_THIRD_PARTY ThirdParty
setenv WM_PROJECT_VERSION dev
################################################################################
# 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.
# the directory two levels below this file, or $HOME/$WM_PROJECT if that
# directory cannot be determined.
#
# Please set to the appropriate path if the default is not correct.
set foamInstDir=`lsof +p $$ |& sed -n 's%.* \(/.*\)/[^/]\+/etc/cshrc$%\1%p'`
if ( -d "$foamInstDir" ) then
setenv FOAM_INST_DIR $foamInstDir
else
setenv FOAM_INST_DIR $HOME/$WM_PROJECT
endif
unset foamInstDir
#
# Please set to the appropriate path if the above default is not correct. E.g.,
#
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 ~$WM_PROJECT
# setenv FOAM_INST_DIR /opt/$WM_PROJECT
# setenv FOAM_INST_DIR /usr/local/$WM_PROJECT
@ -51,7 +58,7 @@ setenv FOAM_INST_DIR `lsof +p $$ |& grep -oE '/.*'$WM_PROJECT'[^/]*/etc/cshrc' |
# 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,
# $FOAM_INST_DIR/site/$WM_PROJECT_VERSION or $FOAM_INST_DIR/site
@ -91,11 +98,22 @@ setenv WM_MPLIB SYSTEMOPENMPI
# WM_OSTYPE = POSIX | ???
setenv WM_OSTYPE POSIX
#- Decomposition libraries:
# <library>_TYPE = none | system | ThirdParty (OpenFOAM)
setenv SCOTCH_TYPE ThirdParty
setenv METIS_TYPE none
setenv PARMETIS_TYPE none
setenv ZOLTAN_TYPE none
#- ParaView installation:
# ParaView_TYPE = none | system | paraviewopenfoam | ThirdParty (OpenFOAM)
setenv ParaView_TYPE ThirdParty
#- Floating-point signal handling:
# set or unset
setenv FOAM_SIGFPE
#- memory initialisation:
#- Memory initialisation:
# set or unset
#setenv FOAM_SETNAN
@ -125,9 +143,25 @@ endif
setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
# Source initialisation functions
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source $WM_PROJECT_DIR/etc/config.csh/functions
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
# Evaluate command-line parameters of the form "param=keyword" or unset
# parameters with "param="
setenv FOAM_SETTINGS "${*}"
_foamParams ${*}
# Location of third-party software
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
if ( `echo $WM_PROJECT_DIR | sed 's/.*\///g'` == `echo $WM_THIRD_PARTY | sed 's/\/.*//g'` ) then
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/$WM_THIRD_PARTY
else
setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/$WM_THIRD_PARTY-$WM_PROJECT_VERSION
endif
# Location of site-specific templates etc
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -143,43 +177,7 @@ endif
# ~~~~~~~~~~~~~~~~~~~~~~
setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
# Source files, possibly with some verbosity
alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!* != "") source \!*'
# Add in preset user or site preferences:
_foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
# Evaluate command-line parameters of the form "param=keyword" or unset
# parameters with "param="
setenv FOAM_SETTINGS "${*}"
while ( $#argv > 0 )
switch ($argv[1])
case -*:
# stray option (not meant for us here) -> get out
break
breaksw
case *=:
# name= -> unsetenv name
if ($?FOAM_VERBOSE && $?prompt) echo "unsetenv $argv[1]:s/=//"
eval "unsetenv $argv[1]:s/=//"
breaksw
case *=*:
# name=value -> setenv name value
if ($?FOAM_VERBOSE && $?prompt) echo "setenv $argv[1]:s/=/ /"
eval "setenv $argv[1]:s/=/ /"
breaksw
default:
# ignore non-parameter arguments, e.g. filenames
break
breaksw
endsw
shift
end
# Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
#- prevent local variables from shadowing setenv variables
@ -234,9 +232,12 @@ if ( $?LD_PRELOAD ) then
endif
# cleanup environment:
# Cleanup environment:
# ~~~~~~~~~~~~~~~~~~~~
unset cleaned foamClean foamOldDirs
unalias _foamSource
# Unload initialisation functions:
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
source $WM_PROJECT_DIR/etc/config.csh/functions
#------------------------------------------------------------------------------

View File

@ -4,20 +4,15 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# get METIS_VERSION, METIS_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis`
then
. $settings
# Build if Metis is enabled
case $METIS_TYPE in
none)
;;
*)
. $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis)
echo " using METIS_ARCH_PATH=$METIS_ARCH_PATH"
if [ -r "$METIS_ARCH_PATH/lib/libmetis.so" ]
then
wmake $targetType
fi
else
echo
echo " Error: no config.sh/metis settings"
echo
fi
wmake $targetType
;;
esac
#------------------------------------------------------------------------------

View File

@ -4,23 +4,16 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
# get PARMETIS_VERSION, PARMETIS_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/parMetis`
then
. $settings
# Build if ParMetis is enabled
case $PARMETIS_TYPE in
none)
;;
*)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
. $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/parMetis)
echo " using PARMETIS_ARCH_PATH=$PARMETIS_ARCH_PATH"
if [ -r "$PARMETIS_ARCH_PATH/lib/libparmetis.so" ]
then
wmakeMpiLib $PARMETIS_VERSION parMetis
else
echo " skipping parMetis"
fi
else
echo
echo " Error: no config.sh/parMetis settings"
echo
fi
wmakeMpiLib parmetis-$PARMETIS_VERSION parMetis
;;
esac
#------------------------------------------------------------------------------

View File

@ -4,25 +4,21 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
# Get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
# Build if Scotch is enabled and MPI is available
if [ -n "$WM_MPLIB" ] && [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
then
. $settings
echo " using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
if [ -n "$SCOTCH_ARCH_PATH" ] \
&& [ -n "$WM_MPLIB" ] \
&& [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
then
wmakeMpiLib $SCOTCH_VERSION ptscotch
else
echo " skipping ptscotch"
fi
case $SCOTCH_TYPE in
none)
;;
*)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
. $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
echo " using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
wmakeMpiLib scotch_$SCOTCH_VERSION ptscotch
;;
esac
else
echo
echo " Error: no config.sh/scotch settings"
echo
echo " skipping ptscotch"
fi
#------------------------------------------------------------------------------

View File

@ -4,19 +4,15 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
# Get SCOTCH_VERSION, SCOTCH_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch`
then
. $settings
# Build if Scotch is enabled
case $SCOTCH_TYPE in
none)
;;
*)
. $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch)
echo " using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
if [ -n "$SCOTCH_ARCH_PATH" ]
then
wmake $targetType
fi
else
echo
echo " Error: no config.sh/scotch settings"
echo
fi
wmake $targetType
;;
esac
#------------------------------------------------------------------------------

View File

@ -4,28 +4,16 @@ cd ${0%/*} || exit 1 # Run from this directory
# Parse arguments for library compilation
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
# Get ZOLTAN_VERSION, ZOLTAN_ARCH_PATH
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan`
then
. $settings
# Build if Zoltan is enabled
case $ZOLTAN_TYPE in
none)
;;
*)
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeMpiLib
. $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/zoltan)
echo " using ZOLTAN_ARCH_PATH=$ZOLTAN_ARCH_PATH"
if [ -n "$ZOLTAN_ARCH_PATH" ] \
&& [ -r "$ZOLTAN_ARCH_PATH/include/zoltan.h" ] \
&& { \
[ -r "$FOAM_EXT_LIBBIN/$FOAM_MPI/libzoltan.a" ] \
|| [ -r "$ZOLTAN_ARCH_PATH/lib/libzoltan.a" ]; \
}
then
wmakeMpiLib $ZOLTAN_VERSION zoltan
else
echo " skipping zoltan"
fi
else
echo
echo " Error: no config.sh/zoltan settings"
echo
fi
wmakeMpiLib Zoltan-$ZOLTAN_VERSION zoltan
;;
esac
#------------------------------------------------------------------------------