mirror of
https://github.com/OpenFOAM/ThirdParty-6.git
synced 2025-12-08 06:57:43 +00:00
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:
@ -2,7 +2,7 @@
|
||||
# ========= |
|
||||
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
# \\ / O peration |
|
||||
# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
# \\/ M anipulation |
|
||||
#------------------------------------------------------------------------------
|
||||
# License
|
||||
@ -32,7 +32,7 @@
|
||||
# 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_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()
|
||||
{
|
||||
[ "$#" -ge 1 ] && ParaView_VERSION="${1##paraview-}"
|
||||
|
||||
# the major version is "<digits>.<digits>"
|
||||
# The major version is "<digits>.<digits>"
|
||||
ParaView_MAJOR=$(echo $ParaView_VERSION | \
|
||||
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
|
||||
# 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
|
||||
# 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()
|
||||
{
|
||||
@ -135,7 +134,7 @@ checkVersion()
|
||||
}
|
||||
|
||||
#
|
||||
# set CMake cache variables
|
||||
# Set CMake cache variables
|
||||
#
|
||||
addCMakeVariable()
|
||||
{
|
||||
@ -148,7 +147,7 @@ addCMakeVariable()
|
||||
|
||||
|
||||
#
|
||||
# verbose makefiles
|
||||
# Verbose makefiles
|
||||
#
|
||||
addVerbosity()
|
||||
{
|
||||
@ -157,7 +156,7 @@ addVerbosity()
|
||||
|
||||
|
||||
#
|
||||
# define options for mpi support
|
||||
# Define options for mpi support
|
||||
#
|
||||
addMpiSupport()
|
||||
{
|
||||
@ -170,7 +169,7 @@ addMpiSupport()
|
||||
|
||||
|
||||
#
|
||||
# define options for python support
|
||||
# Define options for python support
|
||||
#
|
||||
addPythonSupport()
|
||||
{
|
||||
@ -181,7 +180,7 @@ addPythonSupport()
|
||||
then
|
||||
if [ -n "$PYTHON_LIBRARY" ]
|
||||
then
|
||||
# check $PYTHON_LIBRARY if it has been set
|
||||
# Check $PYTHON_LIBRARY if it has been set
|
||||
if [ ! -e "$PYTHON_LIBRARY" ]
|
||||
then
|
||||
echo "*** Error: libpython not found at location specified " \
|
||||
@ -208,7 +207,7 @@ addPythonSupport()
|
||||
pythonMajor=$(echo $PYTHON_LIBRARY | sed 's/.*libpython\(.*\)\.so.*/\1/')
|
||||
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" ] || {
|
||||
echo " No python headers found in $pythonInclude/"
|
||||
echo " Please install python headers or deactivate "
|
||||
@ -238,7 +237,7 @@ addPythonSupport()
|
||||
|
||||
|
||||
#
|
||||
# define options for mesa support
|
||||
# Define options for mesa support
|
||||
#
|
||||
addMesaSupport()
|
||||
{
|
||||
@ -289,7 +288,7 @@ addQtSupport()
|
||||
|
||||
if [ -n "$qmakeExe" ]
|
||||
then
|
||||
# use absolute path
|
||||
# Use absolute path
|
||||
if [ "${qmakeExe#/}" = "$qmakeExe" ]
|
||||
then
|
||||
qmakeExe="$(cd ${qmakeExe%/qmake} 2>/dev/null && pwd)/qmake"
|
||||
@ -303,7 +302,7 @@ addQtSupport()
|
||||
fi
|
||||
fi
|
||||
|
||||
# default to using qmake from the path
|
||||
# Default to using qmake from the path
|
||||
if [ -n "$qmakeExe" ]
|
||||
then
|
||||
addCMakeVariable "QT_QMAKE_EXECUTABLE:FILEPATH=$qmakeExe"
|
||||
@ -319,7 +318,7 @@ addQtSupport()
|
||||
# parse -> "Using Qt version X.Y.Z in ..."
|
||||
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')
|
||||
|
||||
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()
|
||||
{
|
||||
@ -365,7 +364,7 @@ configParaView()
|
||||
|
||||
if [ -n "$cmakeExe" ]
|
||||
then
|
||||
# use absolute path
|
||||
# Use absolute path
|
||||
if [ "${cmakeExe#/}" = "$cmakeExe" ]
|
||||
then
|
||||
cmakeExe="$(cd ${cmakeExe%/cmake} 2>/dev/null && pwd)/cmake"
|
||||
@ -379,10 +378,10 @@ configParaView()
|
||||
fi
|
||||
fi
|
||||
|
||||
# default to using cmake from the path
|
||||
# Default to using cmake from the path
|
||||
[ -n "$cmakeExe" ] || cmakeExe=cmake
|
||||
|
||||
# remove any existing build folder and recreate
|
||||
# Remove any existing build folder and recreate
|
||||
if [ -d $ParaView_BINARY_DIR ]
|
||||
then
|
||||
echo "removing old build directory"
|
||||
@ -393,7 +392,7 @@ configParaView()
|
||||
|
||||
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 "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)"
|
||||
@ -415,7 +414,7 @@ configParaView()
|
||||
echo "----"
|
||||
echo
|
||||
|
||||
# run cmake to create Makefiles
|
||||
# Run cmake to create Makefiles
|
||||
$cmakeExe \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
|
||||
$CMAKE_VARIABLES \
|
||||
@ -424,28 +423,28 @@ configParaView()
|
||||
|
||||
|
||||
#
|
||||
# invoke make
|
||||
# Invoke make
|
||||
# also link bin/ to lib/paraview-* for development without installation
|
||||
#
|
||||
makeParaView()
|
||||
{
|
||||
cd $ParaView_BINARY_DIR || exit 1 # change to build folder
|
||||
cd $ParaView_BINARY_DIR || exit 1 # Change to build folder
|
||||
echo " Starting make"
|
||||
time make -j $WM_NCOMPPROCS
|
||||
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)
|
||||
[ -L lib ] && rm lib 2>/dev/null
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# install the program
|
||||
# Install the program
|
||||
#
|
||||
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"
|
||||
|
||||
make install
|
||||
@ -453,11 +452,8 @@ installParaView()
|
||||
cat<< INFO
|
||||
---
|
||||
Installation complete for paraview-$ParaView_VERSION
|
||||
Set environment variables:
|
||||
|
||||
export ParaView_DIR=$ParaView_DIR
|
||||
export PATH=\$ParaView_DIR/bin:\$PATH
|
||||
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR
|
||||
Now set the environment variables:
|
||||
wmREFRESH
|
||||
---
|
||||
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 withQT QMAKE_PATH
|
||||
unset withMESA MESA_INCLUDE MESA_LIBRARY
|
||||
@ -474,14 +470,14 @@ unset CMAKE_VARIABLES
|
||||
unset OBJ_ADD
|
||||
unset buildType
|
||||
|
||||
# start with these general settings
|
||||
# Start with these general settings
|
||||
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"
|
||||
|
||||
# don't build test tree
|
||||
# Don't build test tree
|
||||
addCMakeVariable "BUILD_TESTING:BOOL=OFF"
|
||||
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user