update build scripts and etc/apps/paraview3 settings for paraview-3.5 (cvs)

- The new cmake seems to be even smarter. If we try to use env variables in
  the .cmake files (eg, with And's sed fixup), they are rewritten in a
  subsequent re-make and take much longer).  Adjusting the compiler values
  themselves causes a full remake. On the positive side, disabling the rpath
  seems to mean we may not need any of this.

  In summary - yuck!
This commit is contained in:
Mark Olesen
2008-12-15 22:06:54 +01:00
parent bf057f99c0
commit 49bbb29ac8
7 changed files with 293 additions and 94 deletions

View File

@ -1 +0,0 @@
buildParaView3.3-cvs

169
bin/buildParaView3.5-cvs Executable file
View File

@ -0,0 +1,169 @@
#!/bin/sh
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# buildParaView3.5-cvs
#
# Description
# Build and install ParaView
# - run from folder above ParaView source folder or place the
# ParaView source under $WM_THIRD_PARTY_DIR
#
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
PARAVIEW_SRC=paraview-3.5-cvs
PARAVIEW_MAJOR_VERSION=3.5
# User options:
# ~~~~~~~~~~~~~
# MPI support:
WITH_MPI=OFF
MPI_MAX_PROCS=32
# Python support:
# note: script will try to determine the appropriate python library.
# If it fails, specify the path using the PYTHON_LIBRARY variable
WITH_PYTHON=OFF
PYTHON_LIBRARY=""
# PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
# MESA graphics support:
WITH_MESA=OFF
#
# No further editing below this line
#------------------------------------------------------------------------------
Script=${0##*/}
usage() {
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION]
options:
-fast skip configure for repeated builds - use with caution
-mpi with mpi (if not already enabled)
-python with python (if not already enabled)
-mesa with mesa (if not already enabled)
-verbose verbose output in Makefiles
-help
For finer control, the build stages can be also selected individually
(mutually exclusive)
-config
-make
-install
Build and install $PARAVIEW_SRC
- run from folder above the ParaView source folder or place the
ParaView source under \$WM_THIRD_PARTY_DIR
USAGE
exit 1
}
# options based on the script name:
case "$Script" in *-fast*) CMAKE_SKIP=ON;; esac
case "$Script" in *-mpi*) WITH_MPI=ON;; esac
case "$Script" in *-python*) WITH_PYTHON=ON;; esac
case "$Script" in *-mesa*) WITH_MESA=ON;; esac
runCONFIG=true
runMAKE=true
runINSTALL=true
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-config) # stage 1: config only
runCONFIG=true
runMAKE=false
runINSTALL=false
shift
;;
-make) # stage 2: make only
runCONFIG=false
runMAKE=true
runINSTALL=false
shift
;;
-install) # stage 3: install only
runCONFIG=false
runMAKE=false
runINSTALL=true
shift
;;
-fast) # shortcut for rebuild
runCONFIG=false
runMAKE=true
runINSTALL=true
shift
;;
-mpi)
WITH_MPI=ON
shift
;;
-python)
WITH_PYTHON=ON
shift
;;
-mesa)
WITH_MESA=ON
shift
;;
-verbose)
VERBOSE=ON
shift
;;
*)
usage "unknown option/argument: '$*'"
;;
esac
done
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
getPaths # discover where things are or should be put
# Build and install
# ~~~~~~~~~~~~~~~~~
[ $runCONFIG = true ] && configParaView
[ $runMAKE = true ] && makeParaView
[ $runINSTALL = true ] && installParaView
echo "done"
#------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
buildParaView3.5-cvs

View File

@ -34,8 +34,8 @@
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions . $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
PARAVIEW_SRC="ParaView3.3-cvs" PARAVIEW_SRC=ParaView3.3-cvs
PARAVIEW_MAJOR_VERSION="3.3" PARAVIEW_MAJOR_VERSION=3.3
# User options: # User options:
# ~~~~~~~~~~~~~ # ~~~~~~~~~~~~~
@ -65,14 +65,15 @@ usage() {
usage: ${0##*/} [OPTION] usage: ${0##*/} [OPTION]
options: options:
-fast skip cmake for repeated builds - use with caution -fast skip configure for repeated builds - use with caution
-mpi with mpi (if not already enabled) -mpi with mpi (if not already enabled)
-python with python (if not already enabled) -python with python (if not already enabled)
-mesa with mesa (if not already enabled) -mesa with mesa (if not already enabled)
-verbose verbose cmake output -verbose verbose output in Makefiles
-help -help
For finer control, the build stages can be selected (mutually exclusive) For finer control, the build stages can be also selected individually
(mutually exclusive)
-config -config
-make -make
-install -install
@ -150,7 +151,7 @@ done
# Set configure options # Set configure options
#~~~~~~~~~~~~~~~~~~~~~~ #~~~~~~~~~~~~~~~~~~~~~~
addVerbosity addVerbosity # verbose makefiles
addMpiSupport # set MPI-specific options addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options addMesaSupport # set MESA-specific options

View File

@ -208,7 +208,7 @@ configParaView()
echo cmake \ echo cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \ $CMAKE_VARIABLES \
$ParaView_INST_DIR ../..
echo echo
echo "----" echo "----"
echo echo
@ -217,7 +217,7 @@ configParaView()
cmake \ cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \ -DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \ $CMAKE_VARIABLES \
$ParaView_INST_DIR ../..
} }
@ -232,24 +232,27 @@ makeParaView()
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l) WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8 [ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
make -j $WM_NCOMPPROCS time make -j $WM_NCOMPPROCS
else else
make time make
fi fi
make install
echo " Done make" echo " Done make"
} }
# adjust hard-links # adjust hard-links
# Note: use loop with grep to avoid touching too many files # Note: use loop with grep to avoid touching too many files
fixCMakeHardLinks() fixHardLinks()
{ {
fileSpec=$1 envName=$1
string=$2 string=$2
envName=$3 shift 2
echo -n " for \$$envName " echo "-- Replacing path hard links for \$$envName"
for fileSpec
do
echo -n " $fileSpec: "
for i in $(find . -type f -iname "$fileSpec") for i in $(find . -type f -iname "$fileSpec")
do do
if grep -q "$string" $i if grep -q "$string" $i
@ -259,6 +262,38 @@ fixCMakeHardLinks()
fi fi
done done
echo echo
done
}
fixCMakeFiles()
{
# change to build/install folder
cd $ParaView_DIR || exit 1
# Replace path with env variable: ParaView_DIR
fixHardLinks ParaView_DIR "$ParaView_DIR" '*.cmake'
# Replace path with env variable: ParaView_INST_DIR
fixHardLinks ParaView_INST_DIR "$ParaView_INST_DIR" '*.cmake'
# Replace path with env variable: MPI_ARCH_PATH
if [ "$WITH_MPI" = ON ]
then
fixHardLinks MPI_ARCH_PATH "$MPI_ARCH_PATH" '*.cmake'
fi
# Replace path with env variable: CMAKE_HOME
if [ -r "$CMAKE_HOME" ]
then
fixHardLinks CMAKE_HOME "$CMAKE_HOME" '*cmake*'
fi
# Replace path with env variable: WM_COMPILER_DIR
# (include cmake.check_cache)
## SKIP THIS - it (it always triggers a complete rebuild)
## when using cmake-2.6.2
## fixHardLinks WM_COMPILER_DIR "$WM_COMPILER_DIR" '*cmake*'
} }
@ -273,65 +308,47 @@ installParaView()
cd $ParaView_DIR || exit 1 cd $ParaView_DIR || exit 1
echo " Installing ParaView" echo " Installing ParaView"
echo " Replacing path hard links" ## This triggers a partial rebuild, but might let us find our files
## fixCMakeFiles
# Replace local ParaView_INST_DIR path with ParaView_INST_DIR # skip the normal 'make install' in favour of simply creating
# environment variable # a softlink to the $ParaView_DIR/bin folder
fixCMakeHardLinks '*.cmake' "$ParaView_INST_DIR" ParaView_INST_DIR # - this seems to keep things portable (except documentation)
echo " Creating link lib/paraview-$PARAVIEW_MAJOR_VERSION/ -> bin/ "
# Replace local MPI_ARCH_PATH path with MPI_ARCH_PATH
# environment variable
if [ "$WITH_MPI" = ON ]
then
fixCMakeHardLinks '*.cmake' "$MPI_ARCH_PATH" MPI_ARCH_PATH
fi
# Replace local CMAKE_HOME path with CMAKE_HOME
# environment variable
if [ -r "$CMAKE_HOME" ]
then
fixCMakeHardLinks '*cmake*' "$CMAKE_HOME" CMAKE_HOME
fi
# Replace local WM_COMPILER_DIR path with WM_COMPILER_DIR
# environment variable
fixCMakeHardLinks '*cmake*' "$WM_COMPILER_DIR" WM_COMPILER_DIR
# create a softlink to the $ParaView_DIR/bin folder
# - workaround for chosen install location
echo " Creating lib/paraview-$PARAVIEW_MAJOR_VERSION soft link to 'bin'"
rm -rf lib/paraview-$PARAVIEW_MAJOR_VERSION rm -rf lib/paraview-$PARAVIEW_MAJOR_VERSION
[ -d lib ] || mkdir lib mkdir lib 2>/dev/null
( cd lib && ln -s ../bin paraview-$PARAVIEW_MAJOR_VERSION ) ( cd lib && ln -s ../bin paraview-$PARAVIEW_MAJOR_VERSION )
# info on symlinks to screen # info on symlinks to screen
echo "" cat << INFO
echo " ---" ---
echo " Installation complete" Installation complete
echo " Set environment variables:" Set environment variables:
echo " - ParaView_INST_DIR to $ParaView_INST_DIR"
echo " - ParaView_DIR to $ParaView_DIR" export ParaView_INST_DIR=$ParaView_INST_DIR
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN" export ParaView_DIR=$ParaView_DIR
echo " Add $ParaView_DIR/bin to PATH" export PV_PLUGIN_PATH=$FOAM_LIBBIN
# echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH" export PATH=\$ParaView_DIR/bin:\$PATH
echo " ---"
---
NB: if you move the paraview installation, you will need to change this file
\$ParaView_DIR/bin/pqClientDocFinder.txt
---
INFO
} }
# clear all the variables used before using any of the functions # clear all the variables used before using any of the functions
unset VERBOSE unset VERBOSE
unset WITH_MPI unset WITH_MPI WITH_MESA
unset WITH_MESA unset WITH_PYTHON PYTHON_LIBRARY
unset WITH_PYTHON
unset PYTHON_LIBRARY
unset CMAKE_VARIABLES unset CMAKE_VARIABLES
unset OBJ_ADD unset OBJ_ADD
# start with these general settings # start with these general settings
addCMakeVariable VTK_USE_TK=FALSE addCMakeVariable VTK_USE_TK=FALSE
addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF
addCMakeVariable VTK_USE_RPATH:BOOL=OFF
addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -26,16 +26,16 @@
# paraview3/bashrc # paraview3/bashrc
# #
# Description # Description
# Setup file for ParaView3. # Setup file for paraview-3.x
# Sourced from OpenFOAM-?.?/etc/bashrc # Sourced from OpenFOAM-?.?/etc/bashrc
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# determine the cmake to be used
unset CMAKE_HOME unset CMAKE_HOME
for cmake in cmake-2.6.2 cmake-2.4.6 for cmake in cmake-2.6.2 cmake-2.4.6
do do
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
if [ -r $cmake ] if [ -r $cmake ]
then then
export CMAKE_HOME=$cmake export CMAKE_HOME=$cmake
@ -43,26 +43,30 @@ do
break break
fi fi
done done
unset cmake
export ParaView_VERSION="3.3-cvs" paraviewMajor=paraview-3.5
export ParaView_VERSION=3.5-cvs
export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
if [ "$PYTHONPATH" ] # add in python libraries if required
paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
if [ -r $paraviewPython ]
then then
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 if [ "$PYTHONPATH" ]
else then
export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/$paraviewMajor
else
export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/$paraviewMajor
fi
fi fi
if [ -r $ParaView_DIR ] if [ -r $ParaView_DIR ]
then then
export PATH=$ParaView_DIR/bin:$PATH export PATH=$ParaView_DIR/bin:$PATH
export LD_LIBRARY_PATH=$ParaView_DIR/bin:$LD_LIBRARY_PATH
export PV_PLUGIN_PATH=$FOAM_LIBBIN export PV_PLUGIN_PATH=$FOAM_LIBBIN
fi fi
unset cmake paraviewMajor paraviewPython
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

View File

@ -26,34 +26,42 @@
# paraview3/cshrc # paraview3/cshrc
# #
# Description # Description
# Startup File for Paraview3 # Startup File for paraview-3.x
# Sourced from OpenFOAM-?.?/etc/cshrc # Sourced from OpenFOAM-?.?/etc/cshrc
# #
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
setenv CMAKE_HOME $WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH # determine the cmake to be used
unsetenv CMAKE_HOME
if ( -r $CMAKE_HOME ) then foreach cmake ( cmake-2.6.2 cmake-2.4.6 )
set cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
if ( -r $cmake ) then
setenv CMAKE_HOME $cmake
set path=($CMAKE_HOME/bin $path) set path=($CMAKE_HOME/bin $path)
else break
unsetenv CMAKE_HOME endif
endif end
setenv ParaView_VERSION 3.3-cvs set paraviewMajor=paraview-3.5
setenv ParaView_VERSION 3.5-cvs
setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/ParaView$ParaView_VERSION setenv ParaView_INST_DIR $WM_THIRD_PARTY_DIR/paraview-$ParaView_VERSION
setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
if ($?PYTHONPATH) then # add in python libraries if required
setenv PYTHONPATH ${PYTHONPATH}:$ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
else if ( -r $paraviewPython ) then
setenv PYTHONPATH $ParaView_DIR/Utilities/VTKPythonWrapping:$ParaView_DIR/lib/paraview-3.3 if ($?PYTHONPATH) then
setenv PYTHONPATH ${PYTHONPATH}:$paraviewPython:$ParaView_DIR/lib/${paraviewMajor}
else
setenv PYTHONPATH $paraviewPython:$ParaView_DIR/lib/${paraviewMajor}
endif
endif endif
if ( -r $ParaView_INST_DIR ) then if ( -r $ParaView_INST_DIR ) then
set path=($ParaView_DIR/bin $path) set path=($ParaView_DIR/bin $path)
setenv LD_LIBRARY_PATH $ParaView_DIR/bin:$LD_LIBRARY_PATH
setenv PV_PLUGIN_PATH $FOAM_LIBBIN setenv PV_PLUGIN_PATH $FOAM_LIBBIN
endif endif
unset cmake paraviewMajor paraviewPython
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------