CONFIG: foamConfigurePaths support for sys-openmpi major version

This commit is contained in:
Mark Olesen 2021-07-08 15:20:30 +02:00
parent aab61cc6b3
commit aefd907333

View File

@ -7,7 +7,7 @@
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Copyright (C) 2011-2016 OpenFOAM Foundation # Copyright (C) 2011-2016 OpenFOAM Foundation
# Copyright (C) 2016-2020 OpenCFD Ltd. # Copyright (C) 2016-2021 OpenCFD Ltd.
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -55,6 +55,8 @@ Equivalent options:
-scotch-path --scotchArchPath | -scotchArchPath -scotch-path --scotchArchPath | -scotchArchPath
-system-compiler -system -system-compiler -system
-third-compiler -third -third-compiler -third
-openmpi-system -sys-openmpi
-openmpi-third -openmpi
HELP_COMPAT HELP_COMPAT
exit 0 # A clean exit exit 0 # A clean exit
@ -89,10 +91,9 @@ Compiler
mpc-VERSION For ThirdParty gcc (mpc-system for system library) mpc-VERSION For ThirdParty gcc (mpc-system for system library)
MPI MPI
-mpi NAME specify 'WM_MPLIB' type (eg, INTELMPI, etc) -mpi=NAME Specify 'WM_MPLIB' type (eg, INTELMPI, etc)
-openmpi VER use ThirdParty openmpi, with version for 'FOAM_MPI' -openmpi[=VER] Use ThirdParty openmpi, with version for 'FOAM_MPI'
-openmpi-system use system openmpi -sys-openmpi[=MAJ] Use system openmpi, with specified major version
-openmpi-third use ThirdParty openmpi (using default version)
Components versions (ThirdParty) Components versions (ThirdParty)
-adios VER specify 'adios2_version' -adios VER specify 'adios2_version'
@ -212,12 +213,13 @@ _inlineSed()
# Local filename (for reporting) # Local filename (for reporting)
localFile="$(echo "$file" | sed -e "s#^$projectDir/##")" localFile="$(echo "$file" | sed -e "s#^$projectDir/##")"
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \ if grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file"
then
[ -n "$msg" ] && echo " $msg ($localFile)"
else
echo "Failed: ${msg:-replacement} in $localFile" echo "Failed: ${msg:-replacement} in $localFile"
return 1 return 1
} fi
[ -n "$msg" ] && echo " $msg ($localFile)"
return 0 return 0
} }
@ -278,8 +280,8 @@ replaceEtc()
local file="$1" local file="$1"
shift shift
file=$(_foamEtc "$file") file="$(_foamEtc "$file")"
replace $file "$@" replace "$file" "$@"
} }
@ -289,24 +291,36 @@ replaceEtcCsh()
local file="$1" local file="$1"
shift shift
file=$(_foamEtc "$file") file="$(_foamEtc "$file")"
replaceCsh $file "$@" replaceCsh "$file" "$@"
} }
# Get the option's value (argument), or die on missing or empty argument # Get the option's value (argument), or die on missing or empty argument
# $1 option # $1 option
# $2 value # $2 value
# Returns values via optValue, nOptArgs variables!!
optValue=""
nOptArgs=0 # The number of args to shift
getOptionValue() getOptionValue()
{ {
local value="$2" optValue="${1#*=}"
[ -n "$value" ] || die "'$1' option requires an argument" if [ "$optValue" = "$1" ]
then
# Eg, -option value
optValue="$2"
[ -n "$optValue" ] || die "'$1' option requires an argument"
nOptArgs=1
else
# Eg, -option=value
nOptArgs=0
fi
# Remove any surrounding double quotes # Remove any surrounding double quotes
value="${value%\"}" optValue="${optValue%\"}"
value="${value#\"}" optValue="${optValue#\"}"
echo "$value"
} }
@ -366,7 +380,7 @@ removeCshMagic()
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
unset adjusted optMpi unset adjusted
# Parse options # Parse options
while [ "$#" -gt 0 ] while [ "$#" -gt 0 ]
do do
@ -420,26 +434,37 @@ CONFIG_CSH
export FOAM_CONFIG_ETC="${1#*=}" export FOAM_CONFIG_ETC="${1#*=}"
;; ;;
-project-path) -project-path=* | -project-path)
# Replace WM_PROJECT_DIR=... # Replace WM_PROJECT_DIR=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc bashrc WM_PROJECT_DIR "\"$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh cshrc WM_PROJECT_DIR "\"$optionValue\""
removeBashMagic $(_foamEtc bashrc) if [ -n "$optValue" ]
removeCshMagic $(_foamEtc cshrc) then
replaceEtc bashrc WM_PROJECT_DIR "\"$optValue\""
replaceEtcCsh cshrc WM_PROJECT_DIR "\"$optValue\""
adjusted=true removeBashMagic "$(_foamEtc bashrc)"
shift removeCshMagic "$(_foamEtc cshrc)"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-version | -foamVersion | --projectVersion) -version=* | -version | -foamVersion | --projectVersion)
# Replace WM_PROJECT_VERSION=... # Replace WM_PROJECT_VERSION=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc bashrc WM_PROJECT_VERSION "$optionValue" shift "${nOptArgs:-0}"
replaceEtcCsh cshrc WM_PROJECT_VERSION "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc bashrc WM_PROJECT_VERSION "$optValue"
replaceEtcCsh cshrc WM_PROJECT_VERSION "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-sp | -SP | -float32) -sp | -SP | -float32)
@ -465,131 +490,168 @@ CONFIG_CSH
-int32 | -int64) -int32 | -int64)
# Replace WM_LABEL_SIZE=... # Replace WM_LABEL_SIZE=...
optionValue="${1#-int}" optValue="${1#-int}"
replaceEtc bashrc WM_LABEL_SIZE "$optionValue" replaceEtc bashrc WM_LABEL_SIZE "$optValue"
replaceEtcCsh cshrc WM_LABEL_SIZE "$optionValue" replaceEtcCsh cshrc WM_LABEL_SIZE "$optValue"
adjusted=true adjusted=true
;; ;;
## Compiler ## ## Compiler ##
-clang) -clang=* | -clang)
# Replace default_clang_version=... # Replace default_clang_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/compiler default_clang_version "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/compiler default_clang_version "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/compiler default_clang_version "$optValue"
replaceEtc config.csh/compiler default_clang_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-gcc) -gcc=* | -gcc)
# Replace default_gcc_version=... # Replace default_gcc_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/compiler default_gcc_version "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/compiler default_gcc_version "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/compiler default_gcc_version "$optValue"
replaceEtc config.csh/compiler default_gcc_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-system-compiler | -system) -system-compiler | -system)
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=... # Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc bashrc \ shift "${nOptArgs:-0}"
WM_COMPILER_TYPE system \
WM_COMPILER "$optionValue" if [ -n "$optValue" ]
replaceEtcCsh cshrc \ then
WM_COMPILER_TYPE system \ replaceEtc bashrc \
WM_COMPILER "$optionValue" WM_COMPILER_TYPE system \
adjusted=true WM_COMPILER "$optValue"
shift replaceEtcCsh cshrc \
WM_COMPILER_TYPE system \
WM_COMPILER "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-third-compiler | -third | -ThirdParty) -third-compiler | -third | -ThirdParty)
# Replace WM_COMPILER_TYPE=... and WM_COMPILER=... # Replace WM_COMPILER_TYPE=... and WM_COMPILER=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc bashrc \ shift "${nOptArgs:-0}"
WM_COMPILER_TYPE ThirdParty \
WM_COMPILER "$optionValue" if [ -n "$optValue" ]
replaceEtcCsh cshrc \ then
WM_COMPILER_TYPE ThirdParty \ replaceEtc bashrc \
WM_COMPILER "$optionValue" WM_COMPILER_TYPE ThirdParty \
adjusted=true WM_COMPILER "$optValue"
shift replaceEtcCsh cshrc \
WM_COMPILER_TYPE ThirdParty \
WM_COMPILER "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
gmp-[4-9]* | gmp-system) gmp-[4-9]* | gmp-system)
# gcc-related package # gcc-related package
replaceEtc config.sh/compiler default_gmp_version "$1" optValue="${1#-}"
replaceEtc config.csh/compiler default_gmp_version "$1" replaceEtc config.sh/compiler default_gmp_version "$optValue"
replaceEtc config.csh/compiler default_gmp_version "$optValue"
adjusted=true adjusted=true
;; ;;
mpfr-[2-9]* | mpfr-system) mpfr-[2-9]* | mpfr-system)
# gcc-related package # gcc-related package
replaceEtc config.sh/compiler default_mpfr_version "$1" optValue="${1#-}"
replaceEtc config.csh/compiler default_mpfr_version "$1" replaceEtc config.sh/compiler default_mpfr_version "$optValue"
replaceEtc config.csh/compiler default_mpfr_version "$optValue"
adjusted=true adjusted=true
;; ;;
mpc-[0-9]* | mpc-system) mpc-[0-9]* | mpc-system)
# gcc-related package # gcc-related package
replaceEtc config.sh/compiler default_mpc_version "$1" optValue="${1#-}"
replaceEtc config.csh/compiler default_mpc_version "$1" replaceEtc config.sh/compiler default_mpc_version "$optValue"
replaceEtc config.csh/compiler default_mpc_version "$optValue"
adjusted=true adjusted=true
;; ;;
## MPI ## ## MPI ##
-mpi) -mpi=* | -mpi)
# Explicitly set WM_MPLIB=... # Explicitly set WM_MPLIB=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc bashrc WM_MPLIB "$optionValue" shift "${nOptArgs:-0}"
replaceEtcCsh cshrc WM_MPLIB "$optionValue"
optMpi=system if [ -n "$optValue" ]
adjusted=true then
shift replaceEtc bashrc WM_MPLIB "$optValue"
replaceEtcCsh cshrc WM_MPLIB "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-openmpi) -sys-openmpi=* | -sys-openmpi | -openmpi-system)
# Replace FOAM_MPI=openmpi-<digits>.. and set to use third-party optValue="$(echo "$1" | sed -ne 's/^.*mpi=\([1-9][0-9]*\).*/\1/p')"
# The edit is slightly fragile, but works
expected="openmpi-[1-9][.0-9]*"
optMpi=$(getOptionValue "$@")
_matches "$optMpi" "$expected" || \
die "'$1' has bad value: '$optMpi'"
_inlineSed $(_foamEtc config.sh/mpi) \
"FOAM_MPI=$expected" \
"FOAM_MPI=$optMpi" \
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optMpi'"
_inlineSed $(_foamEtc config.csh/mpi) \
"FOAM_MPI $expected" \
"FOAM_MPI $optMpi" \
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optMpi'"
replaceEtc bashrc WM_MPLIB OPENMPI
replaceEtcCsh cshrc WM_MPLIB OPENMPI
adjusted=true
shift
;;
-openmpi-system)
# Explicitly set WM_MPLIB=SYSTEMOPENMPI # Explicitly set WM_MPLIB=SYSTEMOPENMPI
replaceEtc bashrc WM_MPLIB SYSTEMOPENMPI if [ -n "$optValue" ]
replaceEtcCsh cshrc WM_MPLIB SYSTEMOPENMPI then
optMpi=system replaceEtc bashrc WM_MPLIB SYSTEMOPENMPI"$optValue"
adjusted=true replaceEtcCsh cshrc WM_MPLIB SYSTEMOPENMPI"$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-openmpi-third) -openmpi=* | -openmpi | -openmpi-third)
# Explicitly set WM_MPLIB=OPENMPI, using default setting for openmpi # Explicitly set WM_MPLIB=OPENMPI
# - use default setting for openmpi, or
# replace FOAM_MPI=openmpi-<digits>..
# The edit is slightly fragile, but works
expected="openmpi-[1-9][.0-9]*"
optValue="$(echo "$1" | sed -ne 's/^.*mpi=//p')"
if [ -n "$optValue" ]
then
if [ "${optValue#openmpi-}" = "$optValue" ]
then
optValue="openmpi-$optValue"
fi
_matches "$optValue" "$expected" || \
die "'${1%=*}' has bad value: '$optValue'"
_inlineSed "$(_foamEtc config.sh/mpi)" \
"FOAM_MPI=$expected" \
"FOAM_MPI=$optValue" \
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optValue'"
_inlineSed "$(_foamEtc config.csh/mpi)" \
"FOAM_MPI=$expected" \
"FOAM_MPI=$optValue" \
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optValue'"
fi
replaceEtc bashrc WM_MPLIB OPENMPI replaceEtc bashrc WM_MPLIB OPENMPI
replaceEtcCsh cshrc WM_MPLIB OPENMPI replaceEtcCsh cshrc WM_MPLIB OPENMPI
optMpi=third
adjusted=true adjusted=true
;; ;;
@ -598,146 +660,242 @@ CONFIG_CSH
-adios | -adios2) -adios | -adios2)
# Replace adios2_version=... # Replace adios2_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/adios2 adios2_version "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/adios2 adios2_version "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/adios2 adios2_version "$optValue"
replaceEtc config.csh/adios2 adios2_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-adios-path | -adios2-path) -adios-path | -adios2-path)
# Replace ADIOS2_ARCH_PATH=... # Replace ADIOS2_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/adios2 ADIOS2_ARCH_PATH "\"$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh config.csh/adios2 ADIOS2_ARCH_PATH "\"$optionValue\""
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/adios2 ADIOS2_ARCH_PATH "\"$optValue\""
replaceEtcCsh config.csh/adios2 ADIOS2_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-boost) -boost)
# Replace boost_version=... (config is cgal or CGAL) # Replace boost_version=... (config is cgal or CGAL)
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
replaceEtc config.sh/"$cfgName" boost_version "$optionValue" if [ -n "$optValue" ]
replaceEtc config.csh/"$cfgName" boost_version "$optionValue" then
adjusted=true replaceEtc config.sh/"$cfgName" boost_version "$optValue"
shift replaceEtc config.csh/"$cfgName" boost_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-boost-path) -boost-path)
# Replace BOOST_ARCH_PATH=... (config is cgal or CGAL) # Replace BOOST_ARCH_PATH=... (config is cgal or CGAL)
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
replaceEtc config.sh/"$cfgName" BOOST_ARCH_PATH "\"$optionValue\"" if [ -n "$optValue" ]
replaceEtc config.csh/"$cfgName" BOOST_ARCH_PATH "\"$optionValue\"" then
adjusted=true replaceEtc config.sh/"$cfgName" BOOST_ARCH_PATH "\"$optValue\""
shift replaceEtc config.csh/"$cfgName" BOOST_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-cgal) -cgal)
# Replace cgal_version=... (config is cgal or CGAL) # Replace cgal_version=... (config is cgal or CGAL)
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
replaceEtc config.sh/"$cfgName" cgal_version "$optionValue" if [ -n "$optValue" ]
replaceEtc config.csh/"$cfgName" cgal_version "$optionValue" then
adjusted=true replaceEtc config.sh/"$cfgName" cgal_version "$optValue"
shift replaceEtc config.csh/"$cfgName" cgal_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-cgal-path) -cgal-path)
# Replace CGAL_ARCH_PATH=... (config is cgal or CGAL) # Replace CGAL_ARCH_PATH=... (config is cgal or CGAL)
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL cfgName=cgal; _foamEtc -q config.sh/"$cfgName" || cfgName=CGAL
replaceEtc config.sh/"$cfgName" CGAL_ARCH_PATH "$optionValue" if [ -n "$optValue" ]
replaceEtcCsh config.csh/"$cfgName" CGAL_ARCH_PATH "$optionValue" then
adjusted=true replaceEtc config.sh/"$cfgName" CGAL_ARCH_PATH "$optValue"
shift replaceEtcCsh config.csh/"$cfgName" CGAL_ARCH_PATH "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-fftw) -fftw)
# Replace fftw_version=... # Replace fftw_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
# config.sh/fftw or config.sh/FFTW # config.sh/fftw or config.sh/FFTW
cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW
replaceEtc config.sh/"$cfgName" fftw_version "$optionValue" if [ -n "$optValue" ]
replaceEtc config.csh/"$cfgName" fftw_version "$optionValue" then
adjusted=true replaceEtc config.sh/"$cfgName" fftw_version "$optValue"
shift replaceEtc config.csh/"$cfgName" fftw_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-fftw-path) -fftw-path)
# Replace FFTW_ARCH_PATH=... # Replace FFTW_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
shift "${nOptArgs:-0}"
# config.sh/fftw or config.sh/FFTW # config.sh/fftw or config.sh/FFTW
cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW cfgName=fftw; _foamEtc -q config.sh/"$cfgName" || cfgName=FFTW
replaceEtc config.sh/"$cfgName" FFTW_ARCH_PATH "\"$optionValue\"" if [ -n "$optValue" ]
replaceEtcCsh config.csh/"$cfgName" FFTW_ARCH_PATH "\"$optionValue\"" then
adjusted=true replaceEtc config.sh/"$cfgName" FFTW_ARCH_PATH "\"$optValue\""
shift replaceEtcCsh config.csh/"$cfgName" FFTW_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-cmake) -cmake)
# Replace cmake_version=... # Replace cmake_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/cmake cmake_version "$optionValue" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/cmake cmake_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-cmake-path) -cmake-path)
# Replace CMAKE_ARCH_PATH=... # Replace CMAKE_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/cmake CMAKE_ARCH_PATH "$optionValue" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/cmake CMAKE_ARCH_PATH "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-kahip) -kahip)
# Replace KAHIP_VERSION=... # Replace KAHIP_VERSION=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/kahip KAHIP_VERSION "$optionValue" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/kahip KAHIP_VERSION "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-kahip-path) -kahip-path)
# Replace KAHIP_ARCH_PATH=... # Replace KAHIP_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/kahip KAHIP_ARCH_PATH "\"$optionValue\"" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/kahip KAHIP_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-metis) -metis)
# Replace METIS_VERSION=... # Replace METIS_VERSION=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/metis METIS_VERSION "$optionValue" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/metis METIS_VERSION "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-metis-path) -metis-path)
# Replace METIS_ARCH_PATH=... # Replace METIS_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/metis METIS_ARCH_PATH "\"$optionValue\"" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/metis METIS_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-scotch | -scotchVersion | --scotchVersion) -scotch | -scotchVersion | --scotchVersion)
# Replace SCOTCH_VERSION=... # Replace SCOTCH_VERSION=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/scotch SCOTCH_VERSION "$optionValue" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/scotch SCOTCH_VERSION "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-scotch-path | -scotchArchPath | --scotchArchPath) -scotch-path | -scotchArchPath | --scotchArchPath)
# Replace SCOTCH_ARCH_PATH=... # Replace SCOTCH_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/scotch SCOTCH_ARCH_PATH "\"$optionValue\"" shift "${nOptArgs:-0}"
adjusted=true
shift if [ -n "$optValue" ]
then
replaceEtc config.sh/scotch SCOTCH_ARCH_PATH "\"$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
@ -746,107 +904,156 @@ CONFIG_CSH
-paraview | -paraviewVersion | --paraviewVersion) -paraview | -paraviewVersion | --paraviewVersion)
# Replace ParaView_VERSION=... # Replace ParaView_VERSION=...
expected="[5-9][.0-9]*" # but also accept system expected="[5-9][.0-9]*" # but also accept system
optionValue=$(getOptionValue "$@") getOptionValue "$@"
_matches "$optionValue" "$expected" || \ _matches "$optValue" "$expected" || \
[ "$optionValue" != "${optionValue%system}" ] || \ [ "$optValue" != "${optValue%system}" ] || \
die "'$1' has bad value: '$optionValue'" die "'${1%=*}' has bad value: '$optValue'"
replaceEtc config.sh/paraview ParaView_VERSION "$optionValue"
replaceEtc config.csh/paraview ParaView_VERSION "$optionValue" shift "${nOptArgs:-0}"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/paraview ParaView_VERSION "$optValue"
replaceEtc config.csh/paraview ParaView_VERSION "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-paraview-qt) -paraview-qt)
# Replace ParaView_QT=... # Replace ParaView_QT=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/paraview ParaView_QT "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/paraview ParaView_QT "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/paraview ParaView_QT "$optValue"
replaceEtc config.csh/paraview ParaView_QT "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-paraview-path | -paraviewInstall | --paraviewInstall) -paraview-path | -paraviewInstall | --paraviewInstall)
# Replace ParaView_DIR=... # Replace ParaView_DIR=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/paraview ParaView_DIR \""$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh config.csh/paraview ParaView_DIR \""$optionValue\""
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/paraview ParaView_DIR \""$optValue\""
replaceEtcCsh config.csh/paraview ParaView_DIR \""$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-llvm) -llvm)
# Replace mesa_llvm=... # Replace mesa_llvm=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk mesa_llvm "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/vtk mesa_llvm "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk mesa_llvm "$optValue"
replaceEtc config.csh/vtk mesa_llvm "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-mesa) -mesa)
# Replace mesa_version=... # Replace mesa_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk mesa_version "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/vtk mesa_version "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk mesa_version "$optValue"
replaceEtc config.csh/vtk mesa_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-vtk) -vtk)
# Replace vtk_version=... # Replace vtk_version=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk vtk_version "$optionValue" shift "${nOptArgs:-0}"
replaceEtc config.csh/vtk vtk_version "$optionValue"
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk vtk_version "$optValue"
replaceEtc config.csh/vtk vtk_version "$optValue"
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-llvm-path) -llvm-path)
# Replace LLVM_ARCH_PATH=... # Replace LLVM_ARCH_PATH=...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk LLVM_ARCH_PATH \""$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh config.csh/vtk LLVM_ARCH_PATH \""$optionValue\""
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk LLVM_ARCH_PATH \""$optValue\""
replaceEtcCsh config.csh/vtk LLVM_ARCH_PATH \""$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-mesa-path) -mesa-path)
# Replace MESA_ARCH_PATH... # Replace MESA_ARCH_PATH...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk MESA_ARCH_PATH \""$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh config.csh/vtk MESA_ARCH_PATH \""$optionValue\""
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk MESA_ARCH_PATH \""$optValue\""
replaceEtcCsh config.csh/vtk MESA_ARCH_PATH \""$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
-vtk-path) -vtk-path)
# Replace VTK_DIR... # Replace VTK_DIR...
optionValue=$(getOptionValue "$@") getOptionValue "$@"
replaceEtc config.sh/vtk VTK_DIR \""$optionValue\"" shift "${nOptArgs:-0}"
replaceEtcCsh config.csh/vtk VTK_DIR \""$optionValue\""
adjusted=true if [ -n "$optValue" ]
shift then
replaceEtc config.sh/vtk VTK_DIR \""$optValue\""
replaceEtcCsh config.csh/vtk VTK_DIR \""$optValue\""
adjusted=true
else
: "${adjusted:=empty}"
fi
;; ;;
## Misc ## ## Misc ##
# Obsolete flags
-sigfpe | -no-sigfpe) -sigfpe | -no-sigfpe)
echo "Enable/disable FOAM_SIGFPE now via controlDict" 1>&2 echo "Enable/disable FOAM_SIGFPE now via controlDict" 1>&2
;; ;;
-archOption | --archOption) # Obsolete options
# Replace WM_ARCH_OPTION=... -archOption | --archOption | \
optionValue=$(getOptionValue "$@")
echo "Ignoring $1 option: no longer supported" 1>&2
shift
;;
-foamInstall | --foamInstall | -projectName | --projectName) -foamInstall | --foamInstall | -projectName | --projectName)
# Removed for 1812 echo "Ignoring obsolete option: $1" 1>&2
optionValue=$(getOptionValue "$@") getOptionValue "$@"
echo "Ignoring $1 option: obsolete" 1>&2 shift "${nOptArgs:-0}"
shift
;; ;;
*) *)