mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -45,7 +45,7 @@ WITH_MPI=OFF
|
|||||||
MPI_MAX_PROCS=32
|
MPI_MAX_PROCS=32
|
||||||
|
|
||||||
# Python support:
|
# 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
|
# If it fails, specify the path using the PYTHON_LIBRARY variable
|
||||||
WITH_PYTHON=OFF
|
WITH_PYTHON=OFF
|
||||||
PYTHON_LIBRARY=""
|
PYTHON_LIBRARY=""
|
||||||
@ -72,6 +72,11 @@ options:
|
|||||||
-verbose verbose cmake output
|
-verbose verbose cmake output
|
||||||
-help
|
-help
|
||||||
|
|
||||||
|
For finer control, the build stages can be selected (mutually exclusive)
|
||||||
|
-config
|
||||||
|
-make
|
||||||
|
-install
|
||||||
|
|
||||||
Build and install $PARAVIEW_SRC
|
Build and install $PARAVIEW_SRC
|
||||||
- run from folder above the ParaView source folder or place the
|
- run from folder above the ParaView source folder or place the
|
||||||
ParaView source under \$WM_THIRD_PARTY_DIR
|
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 *-python*) WITH_PYTHON=ON;; esac
|
||||||
case "$Script" in *-mesa*) WITH_MESA=ON;; esac
|
case "$Script" in *-mesa*) WITH_MESA=ON;; esac
|
||||||
|
|
||||||
|
runCONFIG=true
|
||||||
|
runMAKE=true
|
||||||
|
runINSTALL=true
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
@ -93,8 +102,28 @@ do
|
|||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-fast)
|
-config) # stage 1: config only
|
||||||
CMAKE_SKIP=YES
|
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
|
shift
|
||||||
;;
|
;;
|
||||||
-mpi)
|
-mpi)
|
||||||
@ -121,15 +150,18 @@ done
|
|||||||
|
|
||||||
# Set configure options
|
# Set configure options
|
||||||
#~~~~~~~~~~~~~~~~~~~~~~
|
#~~~~~~~~~~~~~~~~~~~~~~
|
||||||
addVerbosity # set CMake verbosity
|
addVerbosity
|
||||||
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
|
||||||
|
|
||||||
|
getPaths # discover where things are or should be put
|
||||||
|
|
||||||
# Build and install
|
# Build and install
|
||||||
# ~~~~~~~~~~~~~~~~~
|
# ~~~~~~~~~~~~~~~~~
|
||||||
buildParaView
|
[ $runCONFIG = true ] && configParaView
|
||||||
installParaView
|
[ $runMAKE = true ] && makeParaView
|
||||||
|
[ $runINSTALL = true ] && installParaView
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
|
|||||||
@ -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"
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
@ -54,8 +54,7 @@ addMpiSupport()
|
|||||||
[ "$WITH_MPI" = ON ] || return
|
[ "$WITH_MPI" = ON ] || return
|
||||||
OBJ_ADD="$OBJ_ADD-mpi"
|
OBJ_ADD="$OBJ_ADD-mpi"
|
||||||
|
|
||||||
addCMakeVariable PARAVIEW_USE_MPI=ON
|
addCMakeVariable PARAVIEW_USE_MPI=ON VTK_USE_MPI=ON
|
||||||
addCMakeVariable VTK_USE_MPI=ON
|
|
||||||
addCMakeVariable MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include
|
addCMakeVariable MPI_INCLUDE_PATH=$MPI_ARCH_PATH/include
|
||||||
addCMakeVariable MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so
|
addCMakeVariable MPI_LIBRARY=$MPI_ARCH_PATH/lib/libmpi.so
|
||||||
addCMakeVariable VTK_MPIRUN_EXE=$MPI_ARCH_PATH/bin/mpirun
|
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
|
# set paraview environment
|
||||||
for i in $PWD $WM_THIRD_PARTY_DIR
|
for i in $PWD $WM_THIRD_PARTY_DIR
|
||||||
@ -179,56 +181,63 @@ buildParaView()
|
|||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER$OBJ_ADD
|
# ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER$OBJ_ADD
|
||||||
ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
|
ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
|
||||||
|
|
||||||
# shortcut for repeated builds - use with caution
|
echo "ParaView_DIR=$ParaView_DIR"
|
||||||
if [ "$CMAKE_SKIP" = YES ]
|
}
|
||||||
then
|
|
||||||
|
|
||||||
# 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
|
# remove any existing build folder and recreate
|
||||||
rm -rf $ParaView_DIR
|
rm -rf $ParaView_DIR
|
||||||
mkdir -p $ParaView_DIR
|
mkdir -p $ParaView_DIR
|
||||||
cd $ParaView_DIR
|
cd $ParaView_DIR
|
||||||
|
|
||||||
echo "----"
|
echo "----"
|
||||||
echo "Building $PARAVIEW_SRC"
|
echo "Configuring $PARAVIEW_SRC"
|
||||||
echo " MPI support : $WITH_MPI"
|
echo " MPI support : $WITH_MPI"
|
||||||
echo " Python support : $WITH_PYTHON"
|
echo " Python support : $WITH_PYTHON"
|
||||||
echo " MESA support : $WITH_MESA"
|
echo " MESA support : $WITH_MESA"
|
||||||
echo " Source : $ParaView_INST_DIR"
|
echo " Source : $ParaView_INST_DIR"
|
||||||
echo " Target : $ParaView_DIR"
|
echo " Target : $ParaView_DIR"
|
||||||
echo "----"
|
echo "----"
|
||||||
|
echo
|
||||||
# make paraview
|
echo cmake \
|
||||||
cmake \
|
-DCMAKE_INSTALL_PREFIX:PATH=$ParaView_DIR \
|
||||||
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
|
|
||||||
$CMAKE_VARIABLES \
|
$CMAKE_VARIABLES \
|
||||||
$ParaView_INST_DIR
|
$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"
|
echo " Starting make"
|
||||||
|
|
||||||
if [ -r /proc/cpuinfo ]
|
if [ -r /proc/cpuinfo ]
|
||||||
then
|
then
|
||||||
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
|
WM_NCOMPPROCS=$(egrep "^processor" /proc/cpuinfo | wc -l)
|
||||||
|
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
|
||||||
if [ $WM_NCOMPPROCS -gt 8 ]
|
|
||||||
then
|
|
||||||
WM_NCOMPPROCS=8
|
|
||||||
fi
|
|
||||||
|
|
||||||
make -j $WM_NCOMPPROCS
|
make -j $WM_NCOMPPROCS
|
||||||
else
|
else
|
||||||
make
|
make
|
||||||
fi
|
fi
|
||||||
|
make install
|
||||||
|
echo " Done make"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -255,15 +264,15 @@ fixCMakeHardLinks()
|
|||||||
|
|
||||||
installParaView()
|
installParaView()
|
||||||
{
|
{
|
||||||
if [ ! -e "$ParaView_DIR/bin/paraview" ]
|
[ -e "$ParaView_DIR/bin/paraview" ] || {
|
||||||
then
|
|
||||||
echo " Cannot install - no paraview binary found"
|
echo " Cannot install - no paraview binary found"
|
||||||
return
|
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"
|
echo " Replacing path hard links"
|
||||||
|
|
||||||
# Replace local ParaView_INST_DIR path with ParaView_INST_DIR
|
# Replace local ParaView_INST_DIR path with ParaView_INST_DIR
|
||||||
@ -317,7 +326,6 @@ unset WITH_MESA
|
|||||||
unset WITH_PYTHON
|
unset WITH_PYTHON
|
||||||
unset PYTHON_LIBRARY
|
unset PYTHON_LIBRARY
|
||||||
unset CMAKE_VARIABLES
|
unset CMAKE_VARIABLES
|
||||||
unset CMAKE_SKIP
|
|
||||||
unset OBJ_ADD
|
unset OBJ_ADD
|
||||||
|
|
||||||
# start with these general settings
|
# start with these general settings
|
||||||
|
|||||||
@ -31,14 +31,19 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
export CMAKE_HOME=$WM_THIRD_PARTY_DIR/cmake-2.4.6/platforms/$WM_ARCH
|
|
||||||
|
|
||||||
if [ -r $CMAKE_HOME ]
|
|
||||||
then
|
|
||||||
export PATH=$CMAKE_HOME/bin:$PATH
|
|
||||||
else
|
|
||||||
unset CMAKE_HOME
|
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 ]
|
||||||
|
then
|
||||||
|
export CMAKE_HOME=$cmake
|
||||||
|
export PATH=$CMAKE_HOME/bin:$PATH
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
|
unset cmake
|
||||||
|
|
||||||
export ParaView_VERSION="3.3-cvs"
|
export ParaView_VERSION="3.3-cvs"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user