Commit bee5ef0d authored by mark's avatar mark

ENH: makeParaView now accepts paraview-VERSION directly as argument

- Symmetrical with the usage for most other ThirdParty build
  scripts. For example,

      "makeParaView ParaView-5.0.1"

- As a convenience, also allow a number directly. For example,

      "makeParaView 5.0.1"

  This should be clearer than the old instruction and does not
  rely on an alias:

      "foamPV 5.0.1; ./makeParaView"

BUG: heuristics for activating GL2 rendering backend missed when
     paraview version was specified from the command-line
parent 34023f31
......@@ -3,7 +3,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
......@@ -72,12 +72,16 @@ setDirs()
#
# Set ParaView_VERSION and adjust ParaView_MAJOR accordingly
#
# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0
#
setVersion()
{
if [ "$#" -ge 1 ]
then
ParaView_VERSION="${1##paraview-}"
fi
[ $# -gt 0 ] || {
echo "Error: function setVersion() called without an argument"
exit 1
}
ParaView_VERSION="${1##*-}"
# The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
......@@ -410,7 +414,7 @@ configParaView()
echo
# Run cmake to create Makefiles
$cmakeExe \
$cmakeExe -Wno-dev \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_SOURCE_DIR
......
......@@ -72,12 +72,16 @@ setDirs()
#
# Set ParaView_VERSION and adjust ParaView_MAJOR accordingly
#
# $1 can contain something something like 4.4.0, paraview-4.4.0, ParaView-4.0.0
#
setVersion()
{
if [ "$#" -ge 1 ]
then
ParaView_VERSION="${1##paraview-}"
fi
[ $# -gt 0 ] || {
echo "Error: function setVersion() called without an argument"
exit 1
}
ParaView_VERSION="${1##*-}"
# The major version is "<digits>.<digits>"
ParaView_MAJOR=$(echo $ParaView_VERSION | \
......
......@@ -31,7 +31,7 @@
# (note capitalisation)
#
#------------------------------------------------------------------------------
# run from third-party directory only
# Run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
......@@ -71,11 +71,9 @@ QMAKE_PATH=""
# Set the path to cmake
CMAKE_PATH=""
# new rendering backend (starting with paraview 5.0)
withGL2=true
if [ "${ParaView_VERSION%%.*}" = 4 ]
then withGL2=false
fi
# New rendering backend (starting with paraview 5.0).
# Default to auto-config based on paraview version
withGL2=auto
#
# NO FURTHER EDITING BELOW THIS LINE
......@@ -88,7 +86,7 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [CMAKE-OPTION]
usage: $Script [OPTION] [paraview-VERSION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-gl2 with new rendering backend (if not already enabled)
......@@ -130,9 +128,10 @@ For finer control, the build stages can be selected or deselected individually:
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
To change the paraview version, use the 'foamPV' command prior to '$Script'.
To make a different paraview version, simply specify on the command-line.
For example,
foamPV 4.4.0 ; ./makeParaview
./makeParaview 4.4.0
USAGE
exit 1
......@@ -152,8 +151,8 @@ case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# set ParaView_MAJOR based on current value of ParaView_VERSION
setVersion
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setVersion ${ParaView_VERSION:-none}
#
# various building stages
......@@ -169,6 +168,9 @@ do
-h | -help)
usage
;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
......@@ -272,7 +274,7 @@ do
;;
-version)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setVersion "$2"
setVersion "${2%%/}"
shift
;;
-major)
......@@ -292,6 +294,25 @@ do
shift
done
[ -n "$ParaView_VERSION" ] || die "The paraview-VERSION was not specified"
# nothing to build
if _foamIsNone "$ParaView_VERSION"
then
echo "Using paraview-none (skip ThirdParty build of ParaView)"
exit 0
fi
# Version-specific adjustments
if [ "$withGL2" = auto ]
then
if [ "${ParaView_VERSION%%.*}" = 4 ]
then
withGL2=false
else
withGL2=true
fi
fi
if [ "$runDEFAULT" = true ]
then
......
......@@ -4,7 +4,7 @@
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
# \\/ M anipulation |
# \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
......@@ -31,7 +31,7 @@
# (note capitalisation)
#
#------------------------------------------------------------------------------
# run from third-party directory only
# Run from third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
......@@ -82,7 +82,7 @@ usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: $Script [OPTION] [CMAKE-OPTION]
usage: $Script [OPTION] [paraview-VERSION] [CMAKE-OPTION]
options:
-rebuild for repeated builds (-make -install) *use with caution*
-mesa with mesa (if not already enabled)
......@@ -121,9 +121,10 @@ For finer control, the build stages can be selected or deselected individually:
\$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
-> \$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-$ParaView_VERSION
To make a different paraview version, use the 'foamPV' command prior to '$Script'.
To make a different paraview version, simply specify on the command-line.
For example,
foamPV 3.14.0 ; ./makeParaview
./makeParaview 3.14.1
USAGE
exit 1
......@@ -143,8 +144,8 @@ case "$Script" in *-mpi*) withMPI=true;; esac
case "$Script" in *-python*) withPYTHON=true;; esac
case "$Script" in *-qt*) withQT=true;; esac
# set ParaView_MAJOR based on current value of ParaView_VERSION
setVersion
# Set initial ParaView_MAJOR based on current value of ParaView_VERSION
setVersion ${ParaView_VERSION:-none}
#
# various building stages
......@@ -159,6 +160,9 @@ do
-h | -help)
usage
;;
[0-9]* | paraview-[0-9]* | ParaView-[0-9]*) # paraview version
setVersion "${1%%/}"
;;
[A-Z]*=*) # cmake variables
addCMakeVariable "$1"
;;
......@@ -249,7 +253,7 @@ do
;;
-version)
[ "$#" -ge 2 ] || die "'$1' option requires an argument"
setVersion "$2"
setVersion "${2%%/}"
shift
;;
-major)
......@@ -264,6 +268,14 @@ do
shift
done
[ -n "$ParaView_VERSION" ] || die "The paraview-VERSION was not specified"
# nothing to build
if _foamIsNone "$ParaView_VERSION"
then
echo "Using paraview-none (skip ThirdParty build of ParaView)"
exit 0
fi
if [ "$runDEFAULT" = true ]
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