BUG: _foamAddPath not available when foamPV alias/function is used

STYLE: only use paraview settings when actually available

- this means executing makeParaView prior to building OpenFOAM itself,
  but is consistent with the instructions given by makeParaView,
  and elminates anticipating the source location from the paraview
  config file, which increases the build flexibilty for ThirdParty
This commit is contained in:
Mark Olesen
2016-11-28 15:35:27 +01:00
parent 21251970ac
commit dec8bd46c3
5 changed files with 44 additions and 12 deletions

View File

@ -35,7 +35,7 @@
#------------------------------------------------------------------------------
#
# Use other (shipped) paraview.csh with a different ParaView_VERSION
# Use other (shipped) paraview with a different ParaView_VERSION
#
set foamFile=`$WM_PROJECT_DIR/bin/foamEtcFile -mode o config.csh/paraview`

View File

@ -60,6 +60,12 @@ case OPENMPI:
# Tell OpenMPI where to find its install directory
setenv OPAL_PREFIX $MPI_ARCH_PATH
if ($?FOAM_VERBOSE && $?prompt) then
echo "Using OPENMPI:"
echo " OPAL_PREFIX : $OPAL_PREFIX"
echo " FOAM_MPI : $FOAM_MPI"
endif
_foamAddPath $MPI_ARCH_PATH/bin
_foamAddLib $MPI_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH
_foamAddMan $MPI_ARCH_PATH/share/man

View File

@ -66,7 +66,8 @@ if ( $status == 0 ) setenv PATH $cleaned
# ThirdParty cmake
set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake_version
if ( -r $cmake/bin/cmake ) then
_foamAddPath $cmake/bin
# _foamAddPath not available when foamPV alias is used
setenv PATH $cmake/bin:${PATH}
endif
# Evaluate command-line parameters for ParaView
@ -101,12 +102,11 @@ if ( $?ParaView_VERSION ) then
set pvName=ParaView-$ParaView_VERSION
set pvMajor=paraview-$ParaView_MAJOR
set pvSrcDir=$WM_THIRD_PARTY_DIR/$pvName
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$pvName
# Set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $pvSrcDir ) then
# Set paths if binaries are present
if ( -r $ParaView_DIR ) then
set pvLibDir=${ParaView_DIR}/lib/$pvMajor
set pvPython=$ParaView_DIR/Utilities/VTKPythonWrapping
@ -132,13 +132,18 @@ if ( $?ParaView_VERSION ) then
echo " PV_PLUGIN_PATH : $PV_PLUGIN_PATH"
endif
else
if ($?FOAM_VERBOSE && $?prompt) then
echo "No paraview found"
echo " ParaView_DIR : $ParaView_DIR"
endif
unsetenv ParaView_INCLUDE_DIR PV_PLUGIN_PATH
setenv ParaView_DIR # Defined but empty (used by foamPV alias)
endif
endif
unset cleaned cmake cmake_version pvName pvMajor pvSrcDir pvLibDir pvPython
unsetenv ParaView_VERSION ParaView_MAJOR
unset cleaned cmake cmake_version pvName pvMajor pvLibDir pvPython
unsetenv ParaView_MAJOR ParaView_VERSION
#------------------------------------------------------------------------------