Commit f056e59d authored by Mark Olesen's avatar Mark Olesen
Browse files

CONFIG: simplify paraview lib path for 5.5 (issue #793)

- note that the python paths also seem to be treated differently
parent de72a04a
......@@ -13,17 +13,19 @@
# config.csh/example/paraview
#
# Description
# Example of chaining to the standard config.csh/paraview with a
# different ParaView_VERSION
# Example of defining a different ParaView_VERSION but retaining
# the standard config.csh/paraview mechanism
#
# 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 standard paraview config file (-mode=o) with a different ParaView_VERSION
eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=5.5.0-mpipy`
set pv=5.5.0
set pv=5.5.0-mpipy
eval `foamEtcFile -csh -config -mode=o paraview -- ParaView_VERSION=$pv`
#------------------------------------------------------------------------------
......@@ -50,7 +50,7 @@ set cmake_version=cmake-system
# END OF (NORMAL) USER EDITABLE PART
#------------------------------------------------------------------------------
set pv_api=auto # Normally auto or pair of digits (eg, '5.4' etc)
set pv_api=auto # Either auto or pair of digits (eg, '5.4' etc)
if (! $?ParaView_DIR ) setenv ParaView_DIR
if (! $?WM_COMPILER_LIB_ARCH ) setenv WM_COMPILER_LIB_ARCH
......@@ -101,18 +101,26 @@ if ( $?ParaView_VERSION ) then
endsw
setenv ParaView_DIR $archDir/ParaView-$ParaView_VERSION
set pvSubDir=paraview-$pv_api
# Set paths if binaries are present
if ( -r $ParaView_DIR ) then
set pvLibDir=${ParaView_DIR}/lib/$pvSubDir
set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
setenv PATH ${ParaView_DIR}/bin:${PATH}
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/$pvSubDir
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/$pvSubDir
# Add in qt libraries as required
setenv ParaView_INCLUDE_DIR $ParaView_DIR/include/paraview-$pv_api
setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-$pv_api
set pvLibDir=${ParaView_DIR}/lib/paraview-$pv_api
#OBSOLETE? set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
#OBSOLETE? # Python libraries as required
#OBSOLETE? if ( -r $pvPython ) then
#OBSOLETE? if ($?PYTHONPATH) then
#OBSOLETE? setenv PYTHONPATH ${PYTHONPATH}:${pvPython}:$pvLibDir
#OBSOLETE? else
#OBSOLETE? setenv PYTHONPATH ${pvPython}:$pvLibDir
#OBSOLETE? endif
#OBSOLETE? endif
# QT libraries as required
set qtDir="$archDir/$ParaView_QT"
if ( -d "$qtDir" ) then
foreach qtLibDir ("$qtDir/lib$WM_COMPILER_LIB_ARCH" "$qtDir/lib")
......@@ -123,19 +131,17 @@ if ( $?ParaView_VERSION ) then
end
endif
# Add in python libraries if required
if ( -r $pvPython ) then
if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:${pvPython}:$pvLibDir
else
setenv PYTHONPATH ${pvPython}:$pvLibDir
endif
endif
# Prepend paraview libraries.
# ParaView 5.4 and earlier - requires lib/paraview-X.X only
# ParaView 5.5 - requires lib/
setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib:${pvLibDir}:${LD_LIBRARY_PATH}"
# ParaView libraries
# - 5.4 and earlier: lib/paraview-X.X
# - 5.5 and later: lib/
switch ("$pv_api")
case 5.[0-4]*:
setenv LD_LIBRARY_PATH $pvLibDir:${LD_LIBRARY_PATH}
breaksw
default:
setenv LD_LIBRARY_PATH ${ParaView_DIR}/lib:${LD_LIBRARY_PATH}
breaksw
endsw
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using paraview"
......@@ -158,7 +164,7 @@ endif
unset cleaned archDir
unset cmake cmake_version
unset pv_api pvSubDir pvLibDir pvPython qtDir qtLibDir
unset pv_api pvLibDir pvPython qtDir qtLibDir
unsetenv ParaView_VERSION ParaView_QT
#------------------------------------------------------------------------------
......@@ -13,17 +13,19 @@
# config.sh/example/paraview
#
# Description
# Example of chaining to the standard config.sh/paraview with a
# different ParaView_VERSION
# Example of defining a different ParaView_VERSION but retaining
# the standard config.sh/paraview mechanism
#
# 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 standard paraview config file (-mode=o) with a different ParaView_VERSION
eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=5.5.0-mpipy)
pv=5.5.0
pv=5.5.0-mpipy
eval $(foamEtcFile -sh -config -mode=o paraview -- ParaView_VERSION=$pv)
#------------------------------------------------------------------------------
......@@ -53,7 +53,7 @@ cmake_version=cmake-system
# END OF (NORMAL) USER EDITABLE PART
#------------------------------------------------------------------------------
pv_api=auto # Normally auto or pair of digits (eg, '5.4' etc)
pv_api=auto # Either auto or pair of digits (eg, '5.4' etc)
# Compiler-specific location for ThirdParty installations
archDir="$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER"
......@@ -111,19 +111,24 @@ then
esac
export ParaView_DIR=$archDir/ParaView-$ParaView_VERSION
pvSubDir=paraview-$pv_api
# Set paths if binaries are present
if [ -r $ParaView_DIR ]
then
pvLibDir=$ParaView_DIR/lib/$pvSubDir
pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
export PATH=$ParaView_DIR/bin:$PATH
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/$pvSubDir
export PV_PLUGIN_PATH=$FOAM_LIBBIN/$pvSubDir
export ParaView_INCLUDE_DIR=$ParaView_DIR/include/paraview-$pv_api
export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$pv_api
pvLibDir=$ParaView_DIR/lib/paraview-$pv_api
#OBSOLETE? pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
#OBSOLETE? # Python libraries as required
#OBSOLETE? if [ -r $pvPython ]
#OBSOLETE? then
#OBSOLETE? export PYTHONPATH=$PYTHONPATH:${PYTHONPATH:+:}$pvPython:$pvLibDir
#OBSOLETE? fi
# Add in qt libraries as required
# QT libraries as required
qtDir="$archDir/$ParaView_QT"
if [ -d "$qtDir" ]
then
......@@ -137,21 +142,17 @@ then
done
fi
# Prepend paraview libraries.
# ParaView 5.4 and earlier - requires lib/paraview-X.X only
# ParaView 5.5 - requires lib/
export LD_LIBRARY_PATH=$ParaView_DIR/lib:$pvLibDir:$LD_LIBRARY_PATH
# Add in python libraries if required
if [ -r $pvPython ]
then
if [ "$PYTHONPATH" ]
then
export PYTHONPATH=$PYTHONPATH:$pvPython:$pvLibDir
else
export PYTHONPATH=$pvPython:$pvLibDir
fi
fi
# ParaView libraries
# - 5.4 and earlier: lib/paraview-X.X
# - 5.5 and later: lib/
case "$pv_api" in
5.[0-4]*)
export LD_LIBRARY_PATH=$pvLibDir:$LD_LIBRARY_PATH
;;
*)
export LD_LIBRARY_PATH=$ParaView_DIR/lib:$LD_LIBRARY_PATH
;;
esac
if [ "$FOAM_VERBOSE" -a "$PS1" ]
then
......@@ -176,7 +177,7 @@ fi
unset -f _foamParaviewEval 2> /dev/null
unset cleaned archDir
unset cmake cmake_version
unset pv_api pvSubDir pvLibDir pvPython qtDir qtLibDir
unset pv_api pvLibDir pvPython qtDir qtLibDir
if command -v _foamAddLib > /dev/null 2>&1 # normal sourcing
then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment