ThirdParty-dev/etc/tools/ParaViewFunctions: Updated docs

Including patch from Bruno Santos
Resolves report http://www.openfoam.org/mantisbt/view.php?id=1997
This commit is contained in:
Henry Weller
2016-02-16 08:56:26 +00:00
parent dfe9e823de
commit 43f2b36945

View File

@ -2,7 +2,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# License # License
@ -32,7 +32,7 @@
# buildBASE, installBASE defined from tools/ThirdPartyFunctions # buildBASE, installBASE defined from tools/ThirdPartyFunctions
# #
# where things are or should be put # Where things are or should be put
# ParaView_VERSION and ParaView_MAJOR should already have been set # ParaView_VERSION and ParaView_MAJOR should already have been set
# #
# ParaView_SOURCE_DIR : location of the original sources # ParaView_SOURCE_DIR : location of the original sources
@ -67,13 +67,13 @@ setDirs()
# #
# set ParaView_VERSION and adjust ParaView_MAJOR accordingly # Set ParaView_VERSION and adjust ParaView_MAJOR accordingly
# #
setVersion() setVersion()
{ {
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}" [ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}"
# the major version is "<digits>.<digits>" # The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \ ParaView_MAJOR=$(echo $ParaView_VERSION | \
sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/')
@ -84,7 +84,7 @@ setVersion()
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# extract and echo date stamp information from # Extract and echo date stamp information from
# VTK/Utilities/kwsys/kwsysDateStamp.cmake # VTK/Utilities/kwsys/kwsysDateStamp.cmake
# since the order of the entries is already correct, can use simple sed script # since the order of the entries is already correct, can use simple sed script
# #
@ -101,9 +101,8 @@ echoDateStamp()
) )
} }
# #
# extract version information from # Extract version information from
# CMakeLists.txt # CMakeLists.txt
# since the order of the entries is already correct, can use simple sed script # since the order of the entries is already correct, can use simple sed script
# #
@ -121,7 +120,7 @@ getVersion()
} }
# #
# compare version information # Compare version information
# #
checkVersion() checkVersion()
{ {
@ -135,7 +134,7 @@ checkVersion()
} }
# #
# set CMake cache variables # Set CMake cache variables
# #
addCMakeVariable() addCMakeVariable()
{ {
@ -148,7 +147,7 @@ addCMakeVariable()
# #
# verbose makefiles # Verbose makefiles
# #
addVerbosity() addVerbosity()
{ {
@ -157,7 +156,7 @@ addVerbosity()
# #
# define options for mpi support # Define options for mpi support
# #
addMpiSupport() addMpiSupport()
{ {
@ -170,7 +169,7 @@ addMpiSupport()
# #
# define options for python support # Define options for python support
# #
addPythonSupport() addPythonSupport()
{ {
@ -181,7 +180,7 @@ addPythonSupport()
then then
if [ -n "$PYTHON_LIBRARY" ] if [ -n "$PYTHON_LIBRARY" ]
then then
# check $PYTHON_LIBRARY if it has been set # Check $PYTHON_LIBRARY if it has been set
if [ ! -e "$PYTHON_LIBRARY" ] if [ ! -e "$PYTHON_LIBRARY" ]
then then
echo "*** Error: libpython not found at location specified " \ echo "*** Error: libpython not found at location specified " \
@ -208,7 +207,7 @@ addPythonSupport()
pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/') pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/')
pythonInclude=/usr/include/python$pythonMajor pythonInclude=/usr/include/python$pythonMajor
# note - we could also allow for a PYTHON_INCLUDE variable ... # Note - we could also allow for a PYTHON_INCLUDE variable ...
[ -d "$pythonInclude" ] || { [ -d "$pythonInclude" ] || {
echo " No python headers found in $pythonInclude/" echo " No python headers found in $pythonInclude/"
echo " Please install python headers or deactivate " echo " Please install python headers or deactivate "
@ -238,7 +237,7 @@ addPythonSupport()
# #
# define options for mesa support # Define options for mesa support
# #
addMesaSupport() addMesaSupport()
{ {
@ -289,7 +288,7 @@ addQtSupport()
if [ -n "$qmakeExe" ] if [ -n "$qmakeExe" ]
then then
# use absolute path # Use absolute path
if [ "${qmakeExe#/}" = "$qmakeExe" ] if [ "${qmakeExe#/}" = "$qmakeExe" ]
then then
qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake" qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake"
@ -303,7 +302,7 @@ addQtSupport()
fi fi
fi fi
# default to using qmake from the path # Default to using qmake from the path
if [ -n "$qmakeExe" ] if [ -n "$qmakeExe" ]
then then
addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe" addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe"
@ -319,7 +318,7 @@ addQtSupport()
# parse -> "Using Qt version X.Y.Z in ..." # parse -> "Using Qt version X.Y.Z in ..."
QtVersion=$($qmakeExe -query QT_VERSION) QtVersion=$($qmakeExe -query QT_VERSION)
# split Major.Minor.Revision - could also use IFS hacking # Split Major.Minor.Revision - could also use IFS hacking
set -- $(echo "$QtVersion" | sed -e 's/\./ /g') set -- $(echo "$QtVersion" | sed -e 's/\./ /g')
QtMajor=$1 QtMajor=$1
@ -342,7 +341,7 @@ addQtSupport()
# #
# configure via cmake, but don't actually build anything # Configure via cmake, but don't actually build anything
# #
configParaView() configParaView()
{ {
@ -365,7 +364,7 @@ configParaView()
if [ -n "$cmakeExe" ] if [ -n "$cmakeExe" ]
then then
# use absolute path # Use absolute path
if [ "${cmakeExe#/}" = "$cmakeExe" ] if [ "${cmakeExe#/}" = "$cmakeExe" ]
then then
cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake" cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake"
@ -379,10 +378,10 @@ configParaView()
fi fi
fi fi
# default to using cmake from the path # Default to using cmake from the path
[ -n "$cmakeExe" ] || cmakeExe=cmake [ -n "$cmakeExe" ] || cmakeExe=cmake
# remove any existing build folder and recreate # Remove any existing build folder and recreate
if [ -d $ParaView_BINARY_DIR ] if [ -d $ParaView_BINARY_DIR ]
then then
echo "removing old build directory" echo "removing old build directory"
@ -393,7 +392,7 @@ configParaView()
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType" addCMakeVariable "CMAKE_BUILD_TYPE:STRING=$buildType"
cd $ParaView_BINARY_DIR || exit 1 # change to build folder cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
echo "----" echo "----"
echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)" echo "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
@ -415,7 +414,7 @@ configParaView()
echo "----" echo "----"
echo echo
# run cmake to create Makefiles # Run cmake to create Makefiles
$cmakeExe \ $cmakeExe \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \ $CMAKE_VARIABLES \
@ -424,28 +423,28 @@ configParaView()
# #
# invoke make # Invoke make
# also link bin/ to lib/paraview-* for development without installation # also link bin/ to lib/paraview-* for development without installation
# #
makeParaView() makeParaView()
{ {
cd $ParaView_BINARY_DIR || exit 1 # change to build folder cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
echo " Starting make" echo " Starting make"
time make -j $WM_NCOMPPROCS time make -j $WM_NCOMPPROCS
echo " Done make" echo " Done make"
# remove lib if it is a link # Remove lib if it is a link
# (how this was previously handled before 'make install' worked) # (how this was previously handled before 'make install' worked)
[ -L lib ] && rm lib 2>/dev/null [ -L lib ] && rm lib 2>/dev/null
} }
# #
# install the program # Install the program
# #
installParaView() installParaView()
{ {
cd $ParaView_BINARY_DIR || exit 1 # change to build folder cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
echo " Installing ParaView to $ParaView_DIR" echo " Installing ParaView to $ParaView_DIR"
make install make install
@ -453,11 +452,8 @@ installParaView()
cat<< INFO cat<< INFO
--- ---
Installation complete for paraview-$ParaView_VERSION Installation complete for paraview-$ParaView_VERSION
Set environment variables: Now set the environment variables:
wmREFRESH
export ParaView_DIR=$ParaView_DIR
export PATH=\$ParaView_DIR/bin:\$PATH
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR
--- ---
INFO INFO
} }
@ -465,7 +461,7 @@ INFO
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# clear the referenced variables before using any of the functions # Clear the referenced variables before using any of the functions
unset withMPI withVERBOSE unset withMPI withVERBOSE
unset withQT QMAKE_PATH unset withQT QMAKE_PATH
unset withMESA MESA_INCLUDE MESA_LIBRARY unset withMESA MESA_INCLUDE MESA_LIBRARY
@ -474,14 +470,14 @@ unset CMAKE_VARIABLES
unset OBJ_ADD unset OBJ_ADD
unset buildType unset buildType
# start with these general settings # Start with these general settings
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF"
# include development files in "make install" # Include development files in "make install"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON" addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT_FILES:BOOL=ON"
# don't build test tree # Don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF" addCMakeVariable "BUILD_TESTING:BOOL=OFF"
# ----------------------------------------------------------------- end-of-file #------------------------------------------------------------------------------