mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: improve foamConfigurePaths, remove some antiquated tools
- add edit of llvm/mesa/vtk paths. Reduce some verbosity - include Darwin in foamInstallationTest, foamSystemCheck to avoid a false negative.
This commit is contained in:
@ -7,11 +7,10 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
# Copyright (C) 2017-2018 OpenCFD Ltd.
|
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM, licensed under GNU General Public License
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
# <http://www.gnu.org/licenses/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamCleanPath
|
# foamCleanPath
|
||||||
@ -41,7 +40,7 @@
|
|||||||
# cleaned=$(foamCleanPath -env=PATH dir1:dir2) && PATH=$cleaned
|
# cleaned=$(foamCleanPath -env=PATH dir1:dir2) && PATH=$cleaned
|
||||||
#
|
#
|
||||||
# - Using shell evaluation for the output
|
# - Using shell evaluation for the output
|
||||||
# eval $(foamCleanPath -sh=PATH $PATH" dir1:dir2)
|
# eval "$(foamCleanPath -sh=PATH "$PATH" dir1:dir2)"
|
||||||
# eval "$(foamCleanPath -sh=PATH -env=PATH dir1:dir2)"
|
# eval "$(foamCleanPath -sh=PATH -env=PATH dir1:dir2)"
|
||||||
# eval "$(foamCleanPath -sh-env=PATH dir1:dir2)"
|
# eval "$(foamCleanPath -sh-env=PATH dir1:dir2)"
|
||||||
#
|
#
|
||||||
@ -49,16 +48,17 @@
|
|||||||
# eval `foamCleanPath -csh-env=PATH dir1:dir2`
|
# eval `foamCleanPath -csh-env=PATH dir1:dir2`
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
printHelp() {
|
||||||
cat <<USAGE 1>&2
|
cat<<USAGE
|
||||||
|
|
||||||
Usage: foamCleanPath [OPTION] path [filter] .. [filter]
|
Usage: foamCleanPath [OPTION] path [filter] .. [filter]
|
||||||
foamCleanPath [OPTION] -env=name [filter] .. [filter]
|
foamCleanPath [OPTION] -env=name [filter] .. [filter]
|
||||||
options:
|
options:
|
||||||
-csh=NAME Produce 'setenv NAME ...' output for csh eval
|
|
||||||
-sh=NAME Produce 'NAME=...' output for sh eval
|
|
||||||
-csh-env=NAME As per -csh, with -env for initial content
|
|
||||||
-sh-env=NAME As per -sh, with -env for initial content
|
|
||||||
-env=NAME Evaluate NAME to obtain initial content
|
-env=NAME Evaluate NAME to obtain initial content
|
||||||
|
-csh=NAME Produce 'setenv NAME ...' output for csh eval
|
||||||
|
-csh-env=NAME Like -csh=NAME, with -env for initial content
|
||||||
|
-sh=NAME Produce 'NAME=...' output for sh eval
|
||||||
|
-sh-env=NAME Like -sh=NAME, with -env for initial content
|
||||||
-debug Print debug information to stderr
|
-debug Print debug information to stderr
|
||||||
-strip Remove inaccessible directories
|
-strip Remove inaccessible directories
|
||||||
-verbose Report some progress (input, output, ...)
|
-verbose Report some progress (input, output, ...)
|
||||||
@ -75,7 +75,7 @@ Exit status
|
|||||||
2 initial value of 'path' is empty
|
2 initial value of 'path' is empty
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 0 # A clean exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Report error and exit
|
# Report error and exit
|
||||||
@ -86,7 +86,7 @@ die()
|
|||||||
echo "Error encountered:"
|
echo "Error encountered:"
|
||||||
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
while [ "$#" -ge 1 ]; do echo " $1"; shift; done
|
||||||
echo
|
echo
|
||||||
echo "See 'foamCleanPath -help' for usage"
|
echo "See '${0##*/} -help' for usage"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
@ -95,41 +95,44 @@ die()
|
|||||||
|
|
||||||
# Input and outputs
|
# Input and outputs
|
||||||
unset dirList shellOutput
|
unset dirList shellOutput
|
||||||
|
unset optDebug optEnvName optStrip optVerbose
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
unset optDebug optEnvName optStrip optVerbose
|
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help*)
|
-h | -help*)
|
||||||
usage
|
printHelp
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-env=*)
|
||||||
|
optEnvName="${1#*=}"
|
||||||
|
[ -n "$optEnvName" ] || die "Option '$1' missing an ENVNAME"
|
||||||
|
;;
|
||||||
|
|
||||||
-csh=* | -sh=* | -csh-env=* | -sh-env=*)
|
-csh=* | -sh=* | -csh-env=* | -sh-env=*)
|
||||||
name="${1#*=}"
|
name="${1#*=}"
|
||||||
[ -n "$name" ] || die "Option '$1' missing an ENVNAME"
|
[ -n "$name" ] || die "Option '$1' missing an ENVNAME"
|
||||||
|
|
||||||
# Output prefix
|
|
||||||
case "$1" in
|
|
||||||
-csh*)
|
|
||||||
shellOutput="setenv $name " # eg, "setenv PATH xyz"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
shellOutput="$name=" # eg, "PATH=xyz"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# For (-csh-env | -sh-env) also use name for input evaluation
|
# For (-csh-env | -sh-env) also use name for input evaluation
|
||||||
case "$1" in
|
case "$1" in
|
||||||
*-env=*)
|
*-env=*)
|
||||||
optEnvName="$name"
|
optEnvName="$name"
|
||||||
|
name="$optEnvName"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Shell-specific output prefix ("setenv ENVNAME xyz" or "ENVNAME=xyz")
|
||||||
|
case "$1" in
|
||||||
|
-csh*)
|
||||||
|
shellOutput="setenv $name "
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
shellOutput="$name="
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
-env=*)
|
|
||||||
name="${1#*=}"
|
|
||||||
[ -n "$name" ] || die "Option '$1' missing an ENVNAME"
|
|
||||||
optEnvName="$name"
|
|
||||||
;;
|
|
||||||
-debug)
|
-debug)
|
||||||
optDebug=true
|
optDebug=true
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011-2015 OpenFOAM Foundation
|
# Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
# Copyright (C) 2019 OpenCFD Ltd.
|
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -354,13 +354,13 @@ checkHostName()
|
|||||||
checkOS()
|
checkOS()
|
||||||
{
|
{
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
Linux | LinuxAMD64 | SunOS )
|
Linux* | Darwin* | SunOS )
|
||||||
echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
|
echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "FATAL ERROR: Incompatible operating system \"$OSTYPE\"."
|
echo "FATAL ERROR: Incompatible operating system \"$OSTYPE\"."
|
||||||
echo " OpenFOAM ${FWM_PROJECT_VERSION} is currently "
|
echo " OpenFOAM ${FWM_PROJECT_VERSION} is currently "
|
||||||
echo " available for Linux and SunOS only."
|
echo " available for Linux, Darwin and SunOS only."
|
||||||
echo
|
echo
|
||||||
fatalError="x${fatalError}"
|
fatalError="x${fatalError}"
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2011 OpenFOAM Foundation
|
# Copyright (C) 2011 OpenFOAM Foundation
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM.
|
||||||
@ -114,13 +115,13 @@ fi
|
|||||||
# check os
|
# check os
|
||||||
OSTYPE=$(uname -s)
|
OSTYPE=$(uname -s)
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
Linux | LinuxAMD64 | SunOS )
|
Linux* | Darwin* | SunOS )
|
||||||
echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
|
echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "ERROR: Incompatible operating system \"$OSTYPE\"."
|
echo "ERROR: Incompatible operating system \"$OSTYPE\"."
|
||||||
echo " OpenFOAM $WM_PROJECT_VERSION is currently available for "
|
echo " OpenFOAM $WM_PROJECT_VERSION is currently available for "
|
||||||
echo " Linux, LinuxAMD64 and SunOS only."
|
echo " Linux, Darwin and SunOS only."
|
||||||
echo
|
echo
|
||||||
fatalError=true
|
fatalError=true
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -5,23 +5,10 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2017-2019 OpenCFD Ltd.
|
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
#
|
|
||||||
# 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/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# . change-sitedir.sh PREFIX [SUFFIX]
|
# . change-sitedir.sh PREFIX [SUFFIX]
|
||||||
@ -59,7 +46,7 @@ then
|
|||||||
|
|
||||||
foamOldDirs="$FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN \
|
foamOldDirs="$FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN \
|
||||||
$WM_PROJECT_SITE $WM_PROJECT_DIR/site"
|
$WM_PROJECT_SITE $WM_PROJECT_DIR/site"
|
||||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
foamClean="$WM_PROJECT_DIR/bin/foamCleanPath"
|
||||||
if [ -x "$foamClean" ]
|
if [ -x "$foamClean" ]
|
||||||
then
|
then
|
||||||
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
||||||
|
|||||||
@ -5,23 +5,10 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2017 OpenCFD Ltd.
|
# Copyright (C) 2017-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
#
|
|
||||||
# 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/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# . change-userdir.sh PREFIX [SUFFIX]
|
# . change-userdir.sh PREFIX [SUFFIX]
|
||||||
@ -59,7 +46,7 @@ then
|
|||||||
suffix="$2"
|
suffix="$2"
|
||||||
|
|
||||||
foamOldDirs="$FOAM_USER_APPBIN $FOAM_USER_LIBBIN"
|
foamOldDirs="$FOAM_USER_APPBIN $FOAM_USER_LIBBIN"
|
||||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
foamClean="$WM_PROJECT_DIR/bin/foamCleanPath"
|
||||||
if [ -x "$foamClean" ]
|
if [ -x "$foamClean" ]
|
||||||
then
|
then
|
||||||
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
cleaned=$($foamClean "$PATH" "$foamOldDirs") && PATH="$cleaned"
|
||||||
|
|||||||
@ -1,40 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
# \\ / O peration |
|
|
||||||
# \\ / A nd | www.openfoam.com
|
|
||||||
# \\/ M anipulation |
|
|
||||||
#-------------------------------------------------------------------------------
|
|
||||||
# Copyright (C) 2011 OpenFOAM Foundation
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# 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/>.
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# foamAllHC
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# execute operation $1 on all C,H,L files
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
if [ "$#" -gt 0 ]
|
|
||||||
then
|
|
||||||
find . -name "*.[CHL]" -type f -exec $1 {} \; -print
|
|
||||||
fi
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -29,18 +29,49 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
printHelp() {
|
printHelp() {
|
||||||
cat<<USAGE
|
|
||||||
|
case "$1" in
|
||||||
|
(*compat*)
|
||||||
|
cat<<HELP_COMPAT
|
||||||
|
Obsolete options:
|
||||||
|
-foamInstall DIR [obsolete]
|
||||||
|
-projectName NAME [obsolete]
|
||||||
|
-sigfpe|-no-sigfpe [obsolete - now under etc/controlDict]
|
||||||
|
-archOption 32|64 [obsolete setting of 'WM_ARCH_OPTION' - edit manually]
|
||||||
|
|
||||||
|
Equivalent options:
|
||||||
|
-version -foamVersion --projectVersion
|
||||||
|
-archOption --archOption
|
||||||
|
-third -ThirdParty
|
||||||
|
-paraview --paraviewVersion | -paraviewVersion
|
||||||
|
-paraview-path --paraviewInstall | -paraviewInstall
|
||||||
|
-scotch --scotchVersion | -scotchVersion
|
||||||
|
-scotch-path --scotchArchPath | -scotchArchPath
|
||||||
|
-system-compiler -system
|
||||||
|
-third-compiler -third
|
||||||
|
|
||||||
|
HELP_COMPAT
|
||||||
|
exit 0 # A clean exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
cat<<HELP_HEAD
|
||||||
|
|
||||||
usage: $0 options
|
usage: $0 options
|
||||||
|
|
||||||
|
Options
|
||||||
|
-h | -help Display short help and exit
|
||||||
|
-help-compat Display compatibility options and exit
|
||||||
|
-help-full Display full help and exit
|
||||||
|
|
||||||
Basic
|
Basic
|
||||||
-etc=DIR set FOAM_CONFIG_ETC for alternative project files
|
-etc=DIR set FOAM_CONFIG_ETC for alternative project files
|
||||||
-project-path DIR specify 'WM_PROJECT_DIR' (eg, /opt/openfoam1806-patch1)
|
-project-path DIR specify 'WM_PROJECT_DIR' (eg, /opt/openfoam1806-patch1)
|
||||||
-version VER specify project version (eg, v1806)
|
-version VER specify project version (eg, v1806)
|
||||||
-sp | -SP | -float32 single precision (WM_PRECISION_OPTION)
|
-sp | -SP | -float32 single precision (WM_PRECISION_OPTION)
|
||||||
-dp | -DP | -float64 double precision (WM_PRECISION_OPTION)
|
-dp | -DP | -float64 double precision (WM_PRECISION_OPTION)
|
||||||
-spdp | -SPDP mixed single/double precision
|
-spdp | -SPDP mixed precision (WM_PRECISION_OPTION)
|
||||||
-int32 | -int64 the 'WM_LABEL_SIZE'
|
-int32 | -int64 label-size (WM_LABEL_SIZE)
|
||||||
|
|
||||||
Compiler
|
Compiler
|
||||||
-system-compiler NAME The 'system' compiler to use (eg, Gcc, Clang, Icc,...)
|
-system-compiler NAME The 'system' compiler to use (eg, Gcc, Clang, Icc,...)
|
||||||
@ -57,16 +88,21 @@ MPI
|
|||||||
-openmpi-system use system openmpi
|
-openmpi-system use system openmpi
|
||||||
-openmpi-third use ThirdParty openmpi (using default version)
|
-openmpi-third use ThirdParty openmpi (using default version)
|
||||||
|
|
||||||
ThirdParty versions
|
Components versions (ThirdParty)
|
||||||
-adios VER specify 'adios2_version'
|
-adios VER specify 'adios2_version'
|
||||||
-boost VER specify 'boost_version'
|
-boost VER specify 'boost_version'
|
||||||
-cgal ver specify 'cgal_version'
|
-cgal VER specify 'cgal_version'
|
||||||
-cmake VER specify 'cmake_version'
|
-cmake VER specify 'cmake_version'
|
||||||
-fftw VER specify 'fffw_version'
|
-fftw VER specify 'fffw_version'
|
||||||
-kahip VER specify 'KAHIP_VERSION'
|
-kahip VER specify 'KAHIP_VERSION'
|
||||||
-metis ver specify 'METIS_VERSION'
|
-metis VER specify 'METIS_VERSION'
|
||||||
-scotch VER specify 'SCOTCH_VERSION' (eg, scotch_6.0.4)
|
-scotch VER specify 'SCOTCH_VERSION' (eg, scotch_6.0.4)
|
||||||
|
|
||||||
|
HELP_HEAD
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
(*full*)
|
||||||
|
cat<<HELP_FULL
|
||||||
Components specified by absolute path
|
Components specified by absolute path
|
||||||
-adios-path DIR Path for 'ADIOS2_ARCH_PATH' (overrides -adios)
|
-adios-path DIR Path for 'ADIOS2_ARCH_PATH' (overrides -adios)
|
||||||
-boost-path DIR Path for 'BOOST_ARCH_PATH' (overrides -boost)
|
-boost-path DIR Path for 'BOOST_ARCH_PATH' (overrides -boost)
|
||||||
@ -80,32 +116,24 @@ Graphics
|
|||||||
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1 or system)
|
-paraview VER specify 'ParaView_VERSION' (eg, 5.4.1 or system)
|
||||||
-paraview-qt VER specify 'ParaView_QT' (eg, qt-system)
|
-paraview-qt VER specify 'ParaView_QT' (eg, qt-system)
|
||||||
-paraview-path DIR specify 'ParaView_DIR' (eg, /opt/ParaView-5.4.1)
|
-paraview-path DIR specify 'ParaView_DIR' (eg, /opt/ParaView-5.4.1)
|
||||||
-vtk VER specify 'vtk_version' (eg, VTK-7.1.0)
|
-llvm VER specify 'mesa_llvm'
|
||||||
-mesa VER specify 'mesa_version' (eg, mesa-13.0.1)
|
-mesa VER specify 'mesa_version' (eg, mesa-13.0.1)
|
||||||
|
-vtk VER specify 'vtk_version' (eg, VTK-7.1.0)
|
||||||
|
-llvm-path DIR Path for 'LLVM_ARCH_PATH' (overrides -llvm)
|
||||||
|
-mesa-path DIR Path for 'MESA_ARCH_PATH' (overrides -mesa)
|
||||||
|
-vtk-path DIR Path for 'VTK_DIR' (overrides -vtk)
|
||||||
|
|
||||||
Misc
|
HELP_FULL
|
||||||
-foamInstall DIR [obsolete]
|
;;
|
||||||
-projectName NAME [obsolete]
|
esac
|
||||||
-sigfpe|-no-sigfpe [obsolete - now under etc/controlDict]
|
|
||||||
-archOption 32|64 [obsolete setting of 'WM_ARCH_OPTION' - edit manually]
|
|
||||||
|
|
||||||
|
cat<<HELP_TAIL_COMMON
|
||||||
|
Adjusts hardcoded versions and installation paths (POSIX and C-shell)
|
||||||
|
for OpenFOAM.
|
||||||
|
|
||||||
Adjusts hardcoded versions and installation paths (POSIX and C-shell).
|
HELP_TAIL_COMMON
|
||||||
|
|
||||||
|
exit 0 # A clean exit
|
||||||
Equivalent options:
|
|
||||||
-version -foamVersion --projectVersion
|
|
||||||
-archOption --archOption
|
|
||||||
-third -ThirdParty
|
|
||||||
-paraview --paraviewVersion | -paraviewVersion
|
|
||||||
-paraview-path --paraviewInstall | -paraviewInstall
|
|
||||||
-scotch --scotchVersion | -scotchVersion
|
|
||||||
-scotch-path --scotchArchPath | -scotchArchPath
|
|
||||||
-system-compiler -system
|
|
||||||
-third-compiler -third
|
|
||||||
|
|
||||||
USAGE
|
|
||||||
exit 0 # clean exit
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -123,11 +151,12 @@ die()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
projectDir="$(\pwd -L)" # Project dir
|
||||||
|
|
||||||
# Check that it appears to be an OpenFOAM installation
|
# Check that it appears to be an OpenFOAM installation
|
||||||
if [ -f etc/bashrc ] && [ -d "META-INFO" ]
|
if [ -f etc/bashrc ] && [ -d "META-INFO" ]
|
||||||
then
|
then
|
||||||
echo "Configuring OpenFOAM" 1>&2
|
echo "Configuring OpenFOAM ($projectDir)" 1>&2
|
||||||
else
|
else
|
||||||
die "Please run from the OpenFOAM top-level installation directory" \
|
die "Please run from the OpenFOAM top-level installation directory" \
|
||||||
"No etc/bashrc or META-INFO/ found"
|
"No etc/bashrc or META-INFO/ found"
|
||||||
@ -172,18 +201,22 @@ _inlineSed()
|
|||||||
local replacement="$3"
|
local replacement="$3"
|
||||||
local msg="$4"
|
local msg="$4"
|
||||||
local cmd='/^[^#]/s@'"$regexp"'@'"$replacement"'@'
|
local cmd='/^[^#]/s@'"$regexp"'@'"$replacement"'@'
|
||||||
|
local localFile
|
||||||
|
|
||||||
[ -f "$file" ] || {
|
[ -f "$file" ] || {
|
||||||
echo "Missing file: $file"
|
echo "Missing file: $file"
|
||||||
exit 2 # Fatal
|
exit 2 # Fatal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Local filename (for reporting)
|
||||||
|
localFile="$(echo "$file" | sed -e "s#^$projectDir/##")"
|
||||||
|
|
||||||
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
grep -q "$regexp" "$file" && sed -i -e "$cmd" "$file" || { \
|
||||||
echo "Failed: ${msg:-replacement} in $file"
|
echo "Failed: ${msg:-replacement} in $localFile"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
[ -n "$msg" ] && echo " $msg ($file)"
|
[ -n "$msg" ] && echo " $msg ($localFile)"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -209,7 +242,7 @@ replace()
|
|||||||
"$file" \
|
"$file" \
|
||||||
"$key=.*" \
|
"$key=.*" \
|
||||||
"$key=$val" \
|
"$key=$val" \
|
||||||
"Replaced $key setting by '$val'"
|
"Replaced $key by '$val'"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,9 +265,9 @@ replaceCsh()
|
|||||||
|
|
||||||
_inlineSed \
|
_inlineSed \
|
||||||
"$file" \
|
"$file" \
|
||||||
"setenv *$key [^ #]*" \
|
"setenv [ ]*$key [^ #]*" \
|
||||||
"setenv $key $val" \
|
"setenv $key $val" \
|
||||||
"Replaced $key setenv by '$val'"
|
"Replaced $key by '$val'"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +356,13 @@ unset adjusted optMpi
|
|||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help* | --help*)
|
-help-c*) # Compat help
|
||||||
|
printHelp -compat
|
||||||
|
;;
|
||||||
|
-help-f*) # Full help
|
||||||
|
printHelp -full
|
||||||
|
;;
|
||||||
|
-h | -help*) # Short help
|
||||||
printHelp
|
printHelp
|
||||||
;;
|
;;
|
||||||
'')
|
'')
|
||||||
@ -516,12 +555,12 @@ CONFIG_CSH
|
|||||||
_inlineSed $(_foamEtc config.sh/mpi) \
|
_inlineSed $(_foamEtc config.sh/mpi) \
|
||||||
"FOAM_MPI=$expected" \
|
"FOAM_MPI=$expected" \
|
||||||
"FOAM_MPI=$optMpi" \
|
"FOAM_MPI=$optMpi" \
|
||||||
"Replaced 'FOAM_MPI=$expected' setting by 'FOAM_MPI=$optMpi'"
|
"Replaced 'FOAM_MPI=$expected' by 'FOAM_MPI=$optMpi'"
|
||||||
|
|
||||||
_inlineSed $(_foamEtc config.csh/mpi) \
|
_inlineSed $(_foamEtc config.csh/mpi) \
|
||||||
"FOAM_MPI $expected" \
|
"FOAM_MPI $expected" \
|
||||||
"FOAM_MPI $optMpi" \
|
"FOAM_MPI $optMpi" \
|
||||||
"Replaced 'FOAM_MPI $expected' setting by 'FOAM_MPI $optMpi'"
|
"Replaced 'FOAM_MPI $expected' by 'FOAM_MPI $optMpi'"
|
||||||
|
|
||||||
replaceEtc bashrc WM_MPLIB OPENMPI
|
replaceEtc bashrc WM_MPLIB OPENMPI
|
||||||
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
replaceEtcCsh cshrc WM_MPLIB OPENMPI
|
||||||
@ -711,11 +750,11 @@ CONFIG_CSH
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-vtk)
|
-llvm)
|
||||||
# Replace vtk_version=...
|
# Replace mesa_llvm=...
|
||||||
optionValue=$(getOptionValue "$@")
|
optionValue=$(getOptionValue "$@")
|
||||||
replaceEtc config.sh/vtk vtk_version "$optionValue"
|
replaceEtc config.sh/vtk mesa_llvm "$optionValue"
|
||||||
replaceEtc config.csh/vtk vtk_version "$optionValue"
|
replaceEtc config.csh/vtk mesa_llvm "$optionValue"
|
||||||
adjusted=true
|
adjusted=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@ -729,6 +768,42 @@ CONFIG_CSH
|
|||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-vtk)
|
||||||
|
# Replace vtk_version=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk vtk_version "$optionValue"
|
||||||
|
replaceEtc config.csh/vtk vtk_version "$optionValue"
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-llvm-path)
|
||||||
|
# Replace LLVM_ARCH_PATH=...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk LLVM_ARCH_PATH \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk LLVM_ARCH_PATH \""$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-mesa-path)
|
||||||
|
# Replace MESA_ARCH_PATH...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk MESA_ARCH_PATH \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk MESA_ARCH_PATH \""$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
-vtk-path)
|
||||||
|
# Replace VTK_DIR...
|
||||||
|
optionValue=$(getOptionValue "$@")
|
||||||
|
replaceEtc config.sh/vtk VTK_DIR \""$optionValue\""
|
||||||
|
replaceEtcCsh config.csh/vtk VTK_DIR \""$optionValue\""
|
||||||
|
adjusted=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
## Misc ##
|
## Misc ##
|
||||||
|
|
||||||
|
|||||||
@ -241,7 +241,7 @@ $MESA_ARCH_PATH $LLVM_ARCH_PATH \
|
|||||||
$MPI_ARCH_PATH $SCOTCH_ARCH_PATH \
|
$MPI_ARCH_PATH $SCOTCH_ARCH_PATH \
|
||||||
$FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN $WM_PROJECT_SITE \
|
$FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN $WM_PROJECT_SITE \
|
||||||
$FOAM_USER_APPBIN $FOAM_USER_LIBBIN"
|
$FOAM_USER_APPBIN $FOAM_USER_LIBBIN"
|
||||||
foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
|
foamClean="$WM_PROJECT_DIR/bin/foamCleanPath"
|
||||||
|
|
||||||
if [ -x "$foamClean" ]
|
if [ -x "$foamClean" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -6,23 +6,10 @@
|
|||||||
# \\ / A nd | www.openfoam.com
|
# \\ / A nd | www.openfoam.com
|
||||||
# \\/ M anipulation |
|
# \\/ M anipulation |
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Copyright (C) 2019 OpenCFD Ltd.
|
# Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# License
|
# License
|
||||||
# This file is part of OpenFOAM.
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
#
|
|
||||||
# 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/>.
|
|
||||||
#
|
#
|
||||||
# Script
|
# Script
|
||||||
# foamExec <application> ...
|
# foamExec <application> ...
|
||||||
@ -31,17 +18,20 @@
|
|||||||
# Runs an application (with arguments) after first sourcing the OpenFOAM
|
# Runs an application (with arguments) after first sourcing the OpenFOAM
|
||||||
# etc/bashrc file from the project directory
|
# etc/bashrc file from the project directory
|
||||||
#
|
#
|
||||||
# This script must exist in $WM_PROJECT_DIR/bin/tools
|
|
||||||
#
|
|
||||||
# Can useful for parallel runs. For example,
|
# Can useful for parallel runs. For example,
|
||||||
#
|
#
|
||||||
# mpirun -n <nProcs> \
|
# mpirun -n <nProcs> \
|
||||||
# projectDir/bin/tools/foamExec <simpleFoam> ... -parallel
|
# projectDir/bin/tools/foamExec <simpleFoam> ... -parallel
|
||||||
#
|
#
|
||||||
|
# Note
|
||||||
|
# This script normally exists in the project 'bin/tools' directory.
|
||||||
|
# Do not copy/move/link to other locations unless you also edit it!
|
||||||
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
usage() {
|
toolsDir="${0%/*}" # The bin/tools dir
|
||||||
exec 1>&2
|
projectDir="${toolsDir%/bin/tools}" # Project dir
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
|
||||||
|
printHelp() {
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
Usage: ${0##*/} [OPTION] <application> ...
|
Usage: ${0##*/} [OPTION] <application> ...
|
||||||
@ -49,11 +39,12 @@ Usage: ${0##*/} [OPTION] <application> ...
|
|||||||
options:
|
options:
|
||||||
-help Print the usage
|
-help Print the usage
|
||||||
|
|
||||||
Runs an application (with arguments) after first sourcing the OpenFOAM
|
Run an application (with arguments) after first sourcing
|
||||||
etc/bashrc file from the project directory
|
the OpenFOAM etc/bashrc file from the project directory:
|
||||||
|
($projectDir)
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 0 # A clean exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Report error and exit
|
# Report error and exit
|
||||||
@ -70,15 +61,13 @@ die()
|
|||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
toolsDir="${0%/*}" # The bin/tools dir
|
|
||||||
projectDir="${toolsDir%/bin/tools}" # Project dir
|
|
||||||
|
|
||||||
# Parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help*)
|
-h | -help*)
|
||||||
usage
|
printHelp
|
||||||
;;
|
;;
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
@ -116,6 +105,7 @@ sourceBashrc()
|
|||||||
. "$projectDir/etc/bashrc" $FOAM_SETTINGS
|
. "$projectDir/etc/bashrc" $FOAM_SETTINGS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
sourceBashrc
|
sourceBashrc
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
||||||
|
|||||||
36
bin/tools/help-filter
Executable file
36
bin/tools/help-filter
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# ========= |
|
||||||
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
# \\ / O peration |
|
||||||
|
# \\ / A nd | www.openfoam.com
|
||||||
|
# \\/ M anipulation |
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Copyright (C) 2020 OpenCFD Ltd.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# License
|
||||||
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
||||||
|
#
|
||||||
|
# Script
|
||||||
|
# help-filter
|
||||||
|
#
|
||||||
|
# Description
|
||||||
|
# Feed with output from -help-full.
|
||||||
|
#
|
||||||
|
# For example,
|
||||||
|
# blockMesh -help-full | ./help-filter
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
sed -ne '1,/^[Oo]ptions:/d' \
|
||||||
|
-e '/^ \{8\}/d;' \
|
||||||
|
-e 's/^ *//; /^$/d; /^[^-]/d; /^--/d; /^-help-man/d;' \
|
||||||
|
-e '/^-hostRoots /d; /^-roots /d;' \
|
||||||
|
-e '/^-lib /d;' \
|
||||||
|
-e '/^-[a-z]*-switch /d;' \
|
||||||
|
-e 'y/,/ /; s/=.*$/=/;' \
|
||||||
|
-e '/^-[^ ]* </{ s/^\(-[^ ]* <\).*$/\1/; p; d }' \
|
||||||
|
-e 's/^\(-[^ ]*\).*$/\1/; p; /^-help-full/q;' \
|
||||||
|
-
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
@ -22,8 +22,14 @@
|
|||||||
# LIBEXT if these failed. A DIR ending in "-none" or "-system" is skipped.
|
# LIBEXT if these failed. A DIR ending in "-none" or "-system" is skipped.
|
||||||
#
|
#
|
||||||
# output -csh: setenv LD_LIBRARY_PATH dir/lib:$LD_LIBRARY_PATH
|
# output -csh: setenv LD_LIBRARY_PATH dir/lib:$LD_LIBRARY_PATH
|
||||||
# output -make: -Ldir/lib
|
|
||||||
# output -sh: LD_LIBRARY_PATH=dir/lib:$LD_LIBRARY_PATH
|
# output -sh: LD_LIBRARY_PATH=dir/lib:$LD_LIBRARY_PATH
|
||||||
|
# output -make: -Ldir/lib
|
||||||
|
#
|
||||||
|
# Note
|
||||||
|
# LD_LIBRARY_PATH automatically changes to DYLD_LIBRARY_PATH for Darwin.
|
||||||
|
#
|
||||||
|
# Environment
|
||||||
|
# WM_COMPILER_LIB_ARCH
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
printHelp() {
|
printHelp() {
|
||||||
@ -34,9 +40,9 @@ Usage: ${0##*/} [OPTION] DIR [LIBEXT]
|
|||||||
options:
|
options:
|
||||||
-sh Emit POSIX shell syntax (default)
|
-sh Emit POSIX shell syntax (default)
|
||||||
-csh Emit C-shell shell syntax
|
-csh Emit C-shell shell syntax
|
||||||
-sh-verbose As per -sh, with additional verbosity
|
-sh-verbose Like -sh, with additional verbosity
|
||||||
-csh-verbose As per -csh, with additional verbosity
|
-csh-verbose Like -csh, with additional verbosity
|
||||||
-make Emit content for a makefile
|
-make Emit content for a Makefile
|
||||||
-help Print the usage
|
-help Print the usage
|
||||||
|
|
||||||
Resolves for the existence of DIR/lib64 and DIR/lib, or uses the fallback
|
Resolves for the existence of DIR/lib64 and DIR/lib, or uses the fallback
|
||||||
@ -139,10 +145,10 @@ then
|
|||||||
# Fallback
|
# Fallback
|
||||||
case "$alt" in
|
case "$alt" in
|
||||||
/*)
|
/*)
|
||||||
resolved=$alt
|
resolved="$alt"
|
||||||
;;
|
;;
|
||||||
(*)
|
(*)
|
||||||
resolved=$dir/$alt
|
resolved="$dir/$alt"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
exit 0
|
exit 0
|
||||||
@ -177,6 +183,7 @@ then
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
# Default is -sh
|
||||||
echo "LD_LIBRARY_PATH=$resolved:$LD_LIBRARY_PATH"
|
echo "LD_LIBRARY_PATH=$resolved:$LD_LIBRARY_PATH"
|
||||||
if [ -n "$verboseOutput" ]
|
if [ -n "$verboseOutput" ]
|
||||||
then
|
then
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
# Generate Packages file on debian repositories.
|
|
||||||
|
|
||||||
for D in `find . -mindepth 4 -type d`
|
|
||||||
do
|
|
||||||
dpkg-scanpackages $D | gzip -9c > ${D}/Packages.gz
|
|
||||||
done
|
|
||||||
Reference in New Issue
Block a user