STYLE: slight cleanup of paraview make

- align comments in ParaView3Functions with ParaViewFunctions
  (makes it easier to spot differences)

- mention '-buildType' option in usage
- fix the version extraction reporting
- drop broken date-stamp check

STYLE: align some naming in makeCCMIO with other files
This commit is contained in:
mark
2016-06-15 08:43:08 +02:00
parent d75ec96234
commit dc0ed1606a
5 changed files with 62 additions and 126 deletions

View File

@ -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
@ -70,7 +70,7 @@ setDirs()
# #
# set ParaView_VERSION and adjust ParaView_MAJOR accordingly # Set ParaView_VERSION and adjust ParaView_MAJOR accordingly
# #
setVersion() setVersion()
{ {
@ -79,7 +79,7 @@ setVersion()
ParaView_VERSION="${1##paraview-}" ParaView_VERSION="${1##paraview-}"
fi fi
# 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/')
@ -90,58 +90,27 @@ setVersion()
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# extract and echo date stamp information from # Compare version information (specified vs what is found in CMakeLists.txt)
# VTK/Utilities/kwsys/kwsysDateStamp.cmake # Parse this type of content:
# since the order of the entries is already correct, can use simple sed script # set (PARAVIEW_VERSION_FULL "3.98.1")
#
echoDateStamp()
{
(
set -- $(
sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake
)
IFS='-'
echo "date-stamp: $*"
)
}
#
# extract version information from
# CMakeLists.txt
# since the order of the entries is already correct, can use simple sed script
#
getVersion()
{
(
set -- $(
sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
IFS='.'
echo "$*"
)
}
#
# compare version information
# #
checkVersion() checkVersion()
{ {
local ver=$(getVersion) local ver=$(
sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
if [ "$ParaView_VERSION" != "$ver" ] if [ "$ParaView_VERSION" != "$ver" ]
then then
echo "MISMATCH!" echo "MISMATCH!"
echo " specified $ParaView_VERSION" echo " specified $ParaView_VERSION"
echo " found $ver" echo " found ${ver:-NONE}"
fi fi
} }
# #
# set CMake cache variables # Set CMake cache variables
# #
addCMakeVariable() addCMakeVariable()
{ {
@ -154,7 +123,7 @@ addCMakeVariable()
# #
# verbose makefiles # Verbose makefiles
# #
addVerbosity() addVerbosity()
{ {
@ -166,7 +135,7 @@ addVerbosity()
# #
# define options for mpi support # Define options for mpi support
# #
addMpiSupport() addMpiSupport()
{ {
@ -183,7 +152,7 @@ addMpiSupport()
# #
# define options for python support # Define options for python support
# #
addPythonSupport() addPythonSupport()
{ {
@ -198,7 +167,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 " \
@ -225,7 +194,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 "
@ -255,7 +224,7 @@ addPythonSupport()
# #
# define options for mesa support # Define options for mesa support
# #
addMesaSupport() addMesaSupport()
{ {
@ -286,6 +255,7 @@ addMesaSupport()
addQtSupport() addQtSupport()
{ {
QtVersion=none QtVersion=none
if [ "${withQT:=false}" != true ] if [ "${withQT:=false}" != true ]
then then
return return
@ -312,7 +282,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"
@ -326,7 +296,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"
@ -342,7 +312,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
@ -365,7 +335,7 @@ addQtSupport()
# #
# configure via cmake, but don't actually build anything # Configure via cmake, but don't actually build anything
# #
configParaView() configParaView()
{ {
@ -388,7 +358,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"
@ -402,13 +372,13 @@ configParaView()
fi fi
fi fi
# default to using cmake from the path # Default to using cmake from the path
if [ -z "$cmakeExe" ] if [ -z "$cmakeExe" ]
then then
cmakeExe=cmake cmakeExe=cmake
fi fi
# 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"
@ -417,7 +387,7 @@ configParaView()
fi fi
mkdir -p $ParaView_BINARY_DIR mkdir -p $ParaView_BINARY_DIR
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)"
@ -438,7 +408,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 \
@ -447,17 +417,17 @@ 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)
if [ -L lib ] if [ -L lib ]
then then
@ -467,11 +437,11 @@ makeParaView()
# #
# 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
@ -492,11 +462,8 @@ installParaView()
cat<< INFO cat<< INFO
--- ---
Installation complete for paraview-$ParaView_VERSION Installation complete for paraview-$ParaView_VERSION
Set environment variables: Now update the environment by running:
wmREFRESH
export ParaView_DIR=$ParaView_DIR
export PATH=\$ParaView_DIR/bin:\$PATH
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview-$ParaView_MAJOR
--- ---
INFO INFO
} }
@ -504,7 +471,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
@ -513,15 +480,15 @@ unset CMAKE_VARIABLES
unset OBJ_ADD unset OBJ_ADD
# start with these general settings # Start with these general settings
addCMakeVariable "VTK_USE_TK:BOOL=OFF" addCMakeVariable "VTK_USE_TK:BOOL=OFF"
addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF"
addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release"
# include development files in "make install" # Include development files in "make install"
addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON" addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON"
# don't build test tree # Don't build test tree
addCMakeVariable "BUILD_TESTING:BOOL=OFF" addCMakeVariable "BUILD_TESTING:BOOL=OFF"
# remove dependency on WebKit # remove dependency on WebKit

View File

@ -90,52 +90,22 @@ setVersion()
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# #
# Extract and echo date stamp information from # Compare version information (specified vs what is found in CMakeLists.txt)
# VTK/Utilities/kwsys/kwsysDateStamp.cmake # Parse this type of content:
# since the order of the entries is already correct, can use simple sed script # set (PARAVIEW_VERSION_FULL "5.0.1")
#
echoDateStamp()
{
(
set -- $(
sed -ne 's/^SET(KWSYS_DATE_STAMP_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/VTK/Utilities/kwsys/kwsysDateStamp.cmake
)
IFS='-'
echo "date-stamp: $*"
)
}
#
# Extract version information from
# CMakeLists.txt
# since the order of the entries is already correct, can use simple sed script
#
getVersion()
{
(
set -- $(
sed -ne 's/^SET(PARAVIEW_VERSION_[A-Z]*\([ 0-9]*\)).*$/\1/p' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
IFS='.'
echo "$*"
)
}
#
# Compare version information
# #
checkVersion() checkVersion()
{ {
local ver=$(getVersion) local ver=$(
sed -ne 's/^ *set *( *PARAVIEW_VERSION_FULL[ "]*\([.0-9]*\).*$/\1/ip' \
$ParaView_SOURCE_DIR/CMakeLists.txt
)
if [ "$ParaView_VERSION" != "$ver" ] if [ "$ParaView_VERSION" != "$ver" ]
then then
echo "MISMATCH!" echo "MISMATCH!"
echo " specified $ParaView_VERSION" echo " specified $ParaView_VERSION"
echo " found $ver" echo " found ${ver:-NONE}"
fi fi
} }
@ -511,7 +481,7 @@ cat<< INFO
--- ---
Installation complete for paraview-$ParaView_VERSION Installation complete for paraview-$ParaView_VERSION
Now update the environment by running: Now update the environment by running:
wmRefresh wmREFRESH
--- ---
INFO INFO
} }

View File

@ -34,7 +34,7 @@
. $WM_PROJECT_DIR/etc/config.sh/functions . $WM_PROJECT_DIR/etc/config.sh/functions
_foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/libccmio) _foamSource $($WM_PROJECT_DIR/bin/foamEtcFile config.sh/libccmio)
ccmio_version=${ccmio_version:-libccmio-2.6.1} ccmioPACKAGE=${ccmio_version:-libccmio-2.6.1}
targetType=libso targetType=libso
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
@ -65,14 +65,14 @@ options:
-help -help
* Compile the proprietary libccmio library * Compile the proprietary libccmio library
$ccmio_version $ccmioPACKAGE
Users wishing to make use of the library should contact cd-adapco Users wishing to make use of the library should contact cd-adapco
(Siemens PLM) for possible download and terms of use. (Siemens PLM) for possible download and terms of use.
After obtaining the $ccmio_version library, place in folder After obtaining the $ccmioPACKAGE library, place in folder
$WM_THIRD_PARTY_DIR/$ccmio_version/ $WM_THIRD_PARTY_DIR/$ccmioPACKAGE/
prior to running this script. prior to running this script.
@ -93,7 +93,7 @@ do
shift shift
;; ;;
libccmio-[1-9]*) libccmio-[1-9]*)
ccmio_version="${1%%/}" ccmioPACKAGE="${1%%/}"
shift shift
;; ;;
*) *)
@ -103,21 +103,21 @@ do
done done
# warn if unavailable # warn if unavailable
if [ ! -d ${ccmio_version} ] if [ ! -d ${ccmioPACKAGE} ]
then then
usage "missing source directory '$ccmio_version'" usage "missing source directory '$ccmioPACKAGE'"
fi fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
CCMIO_ARCH_PATH=$installBASE/$ccmio_version CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE
# #
# Build LIBCCMIO # Build LIBCCMIO
# #
echo "---------------" echo "---------------"
( (
cd $ccmio_version || exit 1 cd $ccmioPACKAGE || exit 1
incDIR=$CCMIO_ARCH_PATH/include/libccmio incDIR=$CCMIO_ARCH_PATH/include/libccmio
libDIR=$CCMIO_ARCH_PATH/lib libDIR=$CCMIO_ARCH_PATH/lib

View File

@ -96,13 +96,14 @@ options:
-verbose verbose output in Makefiles -verbose verbose output in Makefiles
-version VER specify an alternative version (current value: $ParaView_VERSION) -version VER specify an alternative version (current value: $ParaView_VERSION)
-major VER specify an alternative major version for special builds -major VER specify an alternative major version for special builds
-buildType NAME specify the build type (default: Release)
-mesa-include DIR -mesa-include DIR
location of mesa headers (current value: ${MESA_INCLUDE:-none}) location of mesa headers (current value: ${MESA_INCLUDE:-none})
-mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none}) -mesa-lib PATH path to mesa library (current value: ${MESA_LIBRARY:-none})
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none}) -python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help -help
The -no-FEATURE option can be disable these features (if not already disabled): The -no-FEATURE option can be used to forcibly disable these features:
mesa mpi python qt mesa mpi python qt
CMake options start with a capital letter and contain an '='. CMake options start with a capital letter and contain an '='.
@ -311,7 +312,6 @@ addMesaSupport # set MESA-specific options
addQtSupport # add extra Qt support addQtSupport # add extra Qt support
setDirs # where things are or should be put setDirs # where things are or should be put
echoDateStamp # report kitware source code date-stamp
# Build and install # Build and install

View File

@ -102,7 +102,7 @@ options:
-python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none}) -python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none})
-help -help
The -no-FEATURE option can be disable these features (if not already disabled): The -no-FEATURE option can be used to forcibly disable these features:
mesa mpi python qt mesa mpi python qt
CMake options start with a capital letter and contain an '='. CMake options start with a capital letter and contain an '='.
@ -294,7 +294,6 @@ addMesaSupport # set MESA-specific options
addQtSupport # add extra Qt support addQtSupport # add extra Qt support
setDirs # where things are or should be put setDirs # where things are or should be put
echoDateStamp # report kitware source code date-stamp
# Build and install # Build and install