mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- missed detection of system libraries when installed with multiarch paths like /usr/lib/x86_64-linux-gnu CONFIG: improve handling of group/user config files (#928) - changed bashrc handling of FOAM_CONFIG_NOUSER to use FOAM_CONFIG_MODE instead. Propagate into foamEtcFile to make this a stickier control. This change allows better control, but also enables cluster installations to define their own value within the OpenFOAM prefs.sh file to prevent users accidentally mis-configuring things if necessary. - remove undocumented handling of an (a)ll mode in foamEtcFile to avoid potential pitfalls. - add support for FOAM_CONFIG_ETC handling. This allows injection of an extra search layer when finding project etc files ENH: improvements to foamConfigurePaths (#928) - handle FOAM_CONFIG_ETC implicitly, or explicitly with the new -etc option. STYLE: more explicit wording in foamConfigurePaths usage (#1602) - document that an absolute path (eg, -scotch-path) overrides/ignores the equivalent ThirdParty setting (eg, -scotch) - longer options -system-compiler and -third-compiler for -system and -third, respectively. Clearer as to their purpose. - adjust the location sanity check to look for META-INFO directory.
213 lines
6.4 KiB
Bash
213 lines
6.4 KiB
Bash
#----------------------------------*-sh-*--------------------------------------
|
|
# ========= |
|
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
# \\ / O peration |
|
|
# \\ / A nd | www.openfoam.com
|
|
# \\/ M anipulation |
|
|
#------------------------------------------------------------------------------
|
|
# Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
# Copyright (C) 2016-2020 OpenCFD Ltd.
|
|
#------------------------------------------------------------------------------
|
|
# License
|
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
|
#
|
|
# File
|
|
# etc/config.sh/paraview
|
|
# - sourced by OpenFOAM-*/etc/bashrc or via foamPV alias
|
|
#
|
|
# Description
|
|
# Setup for PARAVIEW (partially cmake, qt too)
|
|
#
|
|
# To disable use of the PV_PLUGIN_PATH:
|
|
# ParaView_VERSION=none
|
|
#
|
|
# For system-wide installations:
|
|
# cmake_version=cmake-system
|
|
# ParaView_QT=qt-system
|
|
# ParaView_VERSION=system [EXPERIMENTAL]
|
|
#
|
|
# Note
|
|
# The following env. variables are required for building plugins:
|
|
# ParaView_DIR
|
|
# PV_PLUGIN_PATH
|
|
# The OpenFOAM plugin must be the first in PV_PLUGIN_PATH and have
|
|
# paraview-major.minor encoded in its name.
|
|
#
|
|
# For central installations not located under ThirdParty, the environment
|
|
# values must be set manually. For example,
|
|
#
|
|
# export ParaView_DIR=/opt/paraview/paraview-5.6.0
|
|
# export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-5.6
|
|
#
|
|
# export PATH=$ParaView_DIR/bin:$PATH
|
|
# export LD_LIBRARY_PATH=$ParaView_DIR/lib:$LD_LIBRARY_PATH
|
|
# unset ParaView_VERSION # skip ThirdParty settings
|
|
#
|
|
# In paraview-5.4 and earlier, the libraries were in the sub-directory:
|
|
#
|
|
# export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-5.4:$LD_LIBRARY_PATH
|
|
#
|
|
# Note
|
|
# When _foamAddLib is unset (eg, called from makeParaView or from foamPV):
|
|
# - the ParaView_VERSION variable is retained.
|
|
#------------------------------------------------------------------------------
|
|
# USER EDITABLE PART: Changes made here may be lost with the next upgrade
|
|
|
|
ParaView_VERSION=5.6.3
|
|
ParaView_QT=qt-system
|
|
cmake_version=cmake-system
|
|
|
|
# END OF (NORMAL) USER EDITABLE PART
|
|
#------------------------------------------------------------------------------
|
|
pv_api=auto # Either auto or pair of (major.minor) digits
|
|
|
|
# Compiler-specific location for ThirdParty installations
|
|
archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
|
|
|
|
# Clean PATH and LD_LIBRARY_PATH
|
|
eval \
|
|
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=PATH \
|
|
$ParaView_DIR $archDir/ParaView- $archDir/qt- $archDir/cmake-)"
|
|
|
|
eval \
|
|
"$($WM_PROJECT_DIR/bin/foamCleanPath -sh-env=LD_LIBRARY_PATH \
|
|
$ParaView_DIR $archDir/ParaView- $archDir/qt-)"
|
|
|
|
# Evaluate command-line parameters for ParaView and cmake
|
|
for i
|
|
do
|
|
case "$i" in
|
|
(cmake*=* | ParaView*=*)
|
|
# name=value -> export name=value
|
|
eval "export $i"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
# ThirdParty cmake
|
|
cmake="$archDir/$cmake_version"
|
|
if [ -r "$cmake/bin/cmake" ]
|
|
then
|
|
# _foamAddPath not available when foamPV function is used
|
|
PATH="$cmake/bin:$PATH"
|
|
fi
|
|
|
|
case "$ParaView_VERSION" in
|
|
('')
|
|
# empty - do nothing
|
|
;;
|
|
|
|
(none)
|
|
unset ParaView_DIR PV_PLUGIN_PATH
|
|
|
|
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
|
|
then
|
|
echo "Using paraview (disabled)" 1>&2
|
|
fi
|
|
;;
|
|
|
|
(system)
|
|
unset PV_PLUGIN_PATH
|
|
eval "$($WM_PROJECT_DIR/bin/foamEtcFile -sh -config paraview-system)"
|
|
;;
|
|
|
|
(*)
|
|
# ParaView_VERSION set and non-empty
|
|
|
|
# Set API to correspond to VERSION
|
|
# pv_api is <digits>.<digits> from ParaView_VERSION
|
|
case "$ParaView_VERSION" in
|
|
("$pv_api".*)
|
|
# API and VERSION appear to correspond
|
|
;;
|
|
|
|
([0-9]*)
|
|
# Extract API from VERSION
|
|
pv_api=$(echo "$ParaView_VERSION" | \
|
|
sed -ne 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/p')
|
|
;;
|
|
esac
|
|
|
|
export ParaView_DIR="$archDir/ParaView-$ParaView_VERSION"
|
|
unset PV_PLUGIN_PATH
|
|
|
|
# Set paths if binaries are present
|
|
if [ -r "$ParaView_DIR" ]
|
|
then
|
|
# The OpenFOAM plugin directory must be the first in PV_PLUGIN_PATH
|
|
# and have paraview-major.minor encoded in its name
|
|
export PV_PLUGIN_PATH="$FOAM_LIBBIN/paraview-$pv_api"
|
|
export PATH="$ParaView_DIR/bin:$PATH"
|
|
|
|
# QT libraries as required, and Qt5_DIR for the root directory.
|
|
# Another possibility: "qtpaths --qt-version"
|
|
qtDir="$archDir/$ParaView_QT"
|
|
if [ -d "$qtDir" ]
|
|
then
|
|
case "$ParaView_QT" in
|
|
(*-5*)
|
|
export Qt5_DIR="$qtDir"
|
|
;;
|
|
esac
|
|
for libDir in "lib$WM_COMPILER_LIB_ARCH" "lib"
|
|
do
|
|
if [ -d "$qtDir/$libDir" ]
|
|
then
|
|
export LD_LIBRARY_PATH="$qtDir/$libDir:$LD_LIBRARY_PATH"
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
|
|
# ParaView libraries
|
|
# - 5.4 and earlier: lib/paraview-X.X
|
|
# - 5.5 and later: lib/, but could also be lib64/
|
|
for libDir in "lib$WM_COMPILER_LIB_ARCH" "lib"
|
|
do
|
|
pvLibDir="$libDir/paraview-$pv_api"
|
|
if [ -d "$ParaView_DIR/$pvLibDir" ]
|
|
then
|
|
case "$pv_api" in
|
|
(5.[0-4]*)
|
|
libDir="$pvLibDir" # Needs lib/paraview-X.X (not lib)
|
|
;;
|
|
esac
|
|
export LD_LIBRARY_PATH="$ParaView_DIR/$libDir:$LD_LIBRARY_PATH"
|
|
break
|
|
fi
|
|
unset pvLibDir
|
|
done
|
|
|
|
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
|
|
then
|
|
echo "Using paraview" 1>&2
|
|
echo " ParaView_DIR : $ParaView_DIR" 1>&2
|
|
echo " library dir : $pvLibDir" 1>&2
|
|
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH" 1>&2
|
|
fi
|
|
else
|
|
if [ -n "$FOAM_VERBOSE" ] && [ -n "$PS1" ]
|
|
then
|
|
echo "No paraview found" 1>&2
|
|
echo " ParaView_DIR : $ParaView_DIR" 1>&2
|
|
fi
|
|
|
|
unset ParaView_DIR PV_PLUGIN_PATH
|
|
fi
|
|
;;
|
|
esac
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
|
|
if command -v _foamAddLib >/dev/null # normal sourcing
|
|
then
|
|
unset ParaView_VERSION ParaView_QT
|
|
fi
|
|
|
|
unset archDir libDir
|
|
unset cmake cmake_version
|
|
unset pv_api pvLibDir pvPython qtDir
|
|
|
|
#------------------------------------------------------------------------------
|