buildParaView changes

- set CMAKE_INSTALL_PREFIX:PATH now
- allow separation between -config/-make/-install stages
- update for cmake 2.6
This commit is contained in:
Mark Olesen
2008-12-13 17:55:07 +01:00
parent 4c6a7ca707
commit aa522c93f1
4 changed files with 289 additions and 319 deletions

View File

@ -45,7 +45,7 @@ WITH_MPI=OFF
MPI_MAX_PROCS=32
# Python support:
# note: script will try to determine python library.
# 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=""
@ -72,6 +72,11 @@ options:
-verbose verbose cmake output
-help
For finer control, the build stages can be selected (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
@ -86,6 +91,10 @@ 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
@ -93,8 +102,28 @@ do
-h | -help)
usage
;;
-fast)
CMAKE_SKIP=YES
-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)
@ -121,15 +150,18 @@ done
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # set CMake verbosity
addVerbosity
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
# ~~~~~~~~~~~~~~~~~
buildParaView
installParaView
[ $runCONFIG = true ] && configParaView
[ $runMAKE = true ] && makeParaView
[ $runINSTALL = true ] && installParaView
echo "done"

View File

@ -1,75 +0,0 @@
#!/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.2.1
#
# Description
# Build and install ParaView
# - run from folder above ParaView source folder or place the
# ParaView source under $WM_PROJECT_INST_DIR
#
#------------------------------------------------------------------------------
. $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
PARAVIEW_SRC="ParaView3.2.1"
PARAVIEW_MAJOR_VERSION="3.2"
# User options:
# ~~~~~~~~~~~~~
WITH_MPI=ON
MPI_MAX_PROCS=32
WITH_PYTHON=ON
PYTHON_LIBRARY=""
WITH__MESA=OFF
#
# No further editing below this line
#------------------------------------------------------------------------------
# shortcut for repeated builds - use with caution
if [ "$1" = "-fast" ]
then
CMAKE_SKIP=YES
elif [ "$#" -gt 0 ]
then
echo "$0: only supports a -fast option"
exit 1
fi
# Set configure options
#~~~~~~~~~~~~~~~~~~~~~~
addVerbosity # set cmake verbosity
addMpiSupport # set MPI-specific options
addPythonSupport # set Python-specific options
addMesaSupport # set MESA-specific options
buildParaView
installParaView
echo "done"
#------------------------------------------------------------------------------

View File

@ -54,8 +54,7 @@ addMpiSupport()
[ "$WITH_MPI" = ON ] || return
OBJ_ADD="$OBJ_ADD-mpi"
addCMakeVariable PARAVIEW_USE_MPI=ON
addCMakeVariable VTK_USE_MPI=ON
addCMakeVariable PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON
addCMakeVariable MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include
addCMakeVariable MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so
addCMakeVariable VTK_MPIRUN_EXE=$MPI_ARCH_PATH/bin/mpirun
@ -156,7 +155,10 @@ addMesaSupport()
}
buildParaView()
#
# discover where things are or should be put
#
getPaths()
{
# set paraview environment
for i in $PWD $WM_THIRD_PARTY_DIR
@ -179,56 +181,63 @@ buildParaView()
}
fi
# ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER$OBJ_ADD
ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
# shortcut for repeated builds - use with caution
if [ "$CMAKE_SKIP" = YES ]
then
echo "ParaView_DIR=$ParaView_DIR"
}
# change to build/install folder
cd $ParaView_DIR || exit 1
else
# configure via cmake, but don't actually build anything
configParaView()
{
# remove any existing build folder and recreate
rm -rf $ParaView_DIR
mkdir -p $ParaView_DIR
cd $ParaView_DIR
echo "----"
echo "Building $PARAVIEW_SRC"
echo "Configuring $PARAVIEW_SRC"
echo " MPI support : $WITH_MPI"
echo " Python support : $WITH_PYTHON"
echo " MESA support : $WITH_MESA"
echo " Source : $ParaView_INST_DIR"
echo " Target : $ParaView_DIR"
echo "----"
# make paraview
cmake \
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
echo
echo cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_INST_DIR
fi
echo
echo "----"
echo
# change to build folder
# run cmake to create Makefiles
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
$CMAKE_VARIABLES \
$ParaView_INST_DIR
}
makeParaView()
{
# change to build/install folder
cd $ParaView_DIR || exit 1
echo " Starting make"
if [ -r /proc/cpuinfo ]
then
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
if [ $WM_NCOMPPROCS -gt 8 ]
then
WM_NCOMPPROCS=8
fi
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
make -j $WM_NCOMPPROCS
else
make
fi
make install
echo " Done make"
}
@ -255,15 +264,15 @@ fixCMakeHardLinks()
installParaView()
{
if [ ! -e "$ParaView_DIR/bin/paraview" ]
then
[ -e "$ParaView_DIR/bin/paraview" ] || {
echo " Cannot install - no paraview binary found"
return
fi
echo " Build complete"
}
cd $ParaView_DIR
# change to build/install folder
cd $ParaView_DIR || exit 1
echo " Installing ParaView"
echo " Replacing path hard links"
# Replace local ParaView_INST_DIR path with ParaView_INST_DIR
@ -317,7 +326,6 @@ unset WITH_MESA
unset WITH_PYTHON
unset PYTHON_LIBRARY
unset CMAKE_VARIABLES
unset CMAKE_SKIP
unset OBJ_ADD
# start with these general settings

View File

@ -31,14 +31,19 @@
#
#------------------------------------------------------------------------------
export CMAKE_HOME=$WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH
unset CMAKE_HOME
for cmake in cmake-2.6.2 cmake-2.4.6
do
cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
if [ -r $CMAKE_HOME ]
then
if [ -r $cmake ]
then
export CMAKE_HOME=$cmake
export PATH=$CMAKE_HOME/bin:$PATH
else
unset CMAKE_HOME
fi
break
fi
done
unset cmake
export ParaView_VERSION="3.3-cvs"