diff --git a/etc/tools/ParaView3Functions b/etc/tools/ParaView3Functions index fe7e9fd..c0703bc 100644 --- a/etc/tools/ParaView3Functions +++ b/etc/tools/ParaView3Functions @@ -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 @@ -70,7 +70,7 @@ setDirs() # -# set ParaView_VERSION and adjust ParaView_MAJOR accordingly +# Set ParaView_VERSION and adjust ParaView_MAJOR accordingly # setVersion() { @@ -79,7 +79,7 @@ setVersion() ParaView_VERSION="${1##paraview-}" fi - # the major version is "." + # The major version is "." ParaView_MAJOR=$(echo $ParaView_VERSION | \ sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/') @@ -90,58 +90,27 @@ setVersion() #------------------------------------------------------------------------------ # -# 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 -# -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 +# Compare version information (specified vs what is found in CMakeLists.txt) +# Parse this type of content: +# set (PARAVIEW_VERSION_FULL "3.98.1") # 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" ] then echo "MISMATCH!" echo " specified $ParaView_VERSION" - echo " found $ver" + echo " found ${ver:-NONE}" fi } # -# set CMake cache variables +# Set CMake cache variables # addCMakeVariable() { @@ -154,7 +123,7 @@ addCMakeVariable() # -# verbose makefiles +# Verbose makefiles # addVerbosity() { @@ -166,7 +135,7 @@ addVerbosity() # -# define options for mpi support +# Define options for mpi support # addMpiSupport() { @@ -183,7 +152,7 @@ addMpiSupport() # -# define options for python support +# Define options for python support # addPythonSupport() { @@ -198,7 +167,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 " \ @@ -225,7 +194,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 " @@ -255,7 +224,7 @@ addPythonSupport() # -# define options for mesa support +# Define options for mesa support # addMesaSupport() { @@ -286,6 +255,7 @@ addMesaSupport() addQtSupport() { QtVersion=none + if [ "${withQT:=false}" != true ] then return @@ -312,7 +282,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" @@ -326,7 +296,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" @@ -342,7 +312,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 @@ -365,7 +335,7 @@ addQtSupport() # -# configure via cmake, but don't actually build anything +# Configure via cmake, but don't actually build anything # configParaView() { @@ -388,7 +358,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" @@ -402,13 +372,13 @@ configParaView() fi fi - # default to using cmake from the path + # Default to using cmake from the path if [ -z "$cmakeExe" ] then cmakeExe=cmake fi - # 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" @@ -417,7 +387,7 @@ configParaView() fi 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 "Configuring paraview-$ParaView_VERSION (major version: $ParaView_MAJOR)" @@ -438,7 +408,7 @@ configParaView() echo "----" echo - # run cmake to create Makefiles + # Run cmake to create Makefiles $cmakeExe \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ $CMAKE_VARIABLES \ @@ -447,17 +417,17 @@ 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) if [ -L lib ] then @@ -467,11 +437,11 @@ makeParaView() # -# 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 @@ -492,11 +462,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 update the environment by running: + wmREFRESH --- 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 withQT QMAKE_PATH unset withMESA MESA_INCLUDE MESA_LIBRARY @@ -513,15 +480,15 @@ unset CMAKE_VARIABLES unset OBJ_ADD -# start with these general settings +# Start with these general settings addCMakeVariable "VTK_USE_TK:BOOL=OFF" addCMakeVariable "BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF" addCMakeVariable "CMAKE_BUILD_TYPE:STRING=Release" -# include development files in "make install" +# Include development files in "make install" addCMakeVariable "PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON" -# don't build test tree +# Don't build test tree addCMakeVariable "BUILD_TESTING:BOOL=OFF" # remove dependency on WebKit diff --git a/etc/tools/ParaViewFunctions b/etc/tools/ParaViewFunctions index 0ba774a..e828ea8 100644 --- a/etc/tools/ParaViewFunctions +++ b/etc/tools/ParaViewFunctions @@ -90,52 +90,22 @@ setVersion() #------------------------------------------------------------------------------ # -# 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 -# -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 +# Compare version information (specified vs what is found in CMakeLists.txt) +# Parse this type of content: +# set (PARAVIEW_VERSION_FULL "5.0.1") # 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" ] then echo "MISMATCH!" echo " specified $ParaView_VERSION" - echo " found $ver" + echo " found ${ver:-NONE}" fi } @@ -511,7 +481,7 @@ cat<< INFO --- Installation complete for paraview-$ParaView_VERSION Now update the environment by running: - wmRefresh + wmREFRESH --- INFO } diff --git a/makeCCMIO b/makeCCMIO index 12b1137..8990572 100755 --- a/makeCCMIO +++ b/makeCCMIO @@ -34,7 +34,7 @@ . $WM_PROJECT_DIR/etc/config.sh/functions _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 #------------------------------------------------------------------------------ @@ -65,14 +65,14 @@ options: -help * Compile the proprietary libccmio library - $ccmio_version + $ccmioPACKAGE Users wishing to make use of the library should contact cd-adapco (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. @@ -93,7 +93,7 @@ do shift ;; libccmio-[1-9]*) - ccmio_version="${1%%/}" + ccmioPACKAGE="${1%%/}" shift ;; *) @@ -103,21 +103,21 @@ do done # warn if unavailable -if [ ! -d ${ccmio_version} ] +if [ ! -d ${ccmioPACKAGE} ] then - usage "missing source directory '$ccmio_version'" + usage "missing source directory '$ccmioPACKAGE'" fi #------------------------------------------------------------------------------ -CCMIO_ARCH_PATH=$installBASE/$ccmio_version +CCMIO_ARCH_PATH=$installBASE/$ccmioPACKAGE # # Build LIBCCMIO # echo "---------------" ( - cd $ccmio_version || exit 1 + cd $ccmioPACKAGE || exit 1 incDIR=$CCMIO_ARCH_PATH/include/libccmio libDIR=$CCMIO_ARCH_PATH/lib diff --git a/makeParaView b/makeParaView index 8016a86..9380008 100755 --- a/makeParaView +++ b/makeParaView @@ -96,13 +96,14 @@ options: -verbose verbose output in Makefiles -version VER specify an alternative version (current value: $ParaView_VERSION) -major VER specify an alternative major version for special builds + -buildType NAME specify the build type (default: Release) -mesa-include DIR location of mesa headers (current value: ${MESA_INCLUDE:-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}) -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 CMake options start with a capital letter and contain an '='. @@ -311,7 +312,6 @@ addMesaSupport # set MESA-specific options addQtSupport # add extra Qt support setDirs # where things are or should be put -echoDateStamp # report kitware source code date-stamp # Build and install diff --git a/makeParaView3 b/makeParaView3 index 28101ee..4d6ef61 100755 --- a/makeParaView3 +++ b/makeParaView3 @@ -102,7 +102,7 @@ options: -python-lib PATH path to python library (current value: ${PYTHON_LIBRARY:-none}) -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 CMake options start with a capital letter and contain an '='. @@ -294,7 +294,6 @@ addMesaSupport # set MESA-specific options addQtSupport # add extra Qt support setDirs # where things are or should be put -echoDateStamp # report kitware source code date-stamp # Build and install