Commit 76d618fa authored by henry's avatar henry
Browse files

Include the ParaView3 build scripts

parent 0e5a8b80
#!/bin/sh
set -x
# ParaView 3.x build script
# - run from folder above source folder
PARAVIEW_SRC="ParaView3.2.1"
VERBOSE="OFF"
INCLUDE_MPI="ON"
MPI_MAX_PROCS=32
INCLUDE_PYTHON="ON"
INCLUDE_MESA="OFF"
# initialisation
CMAKE_VARIABLES=""
PWD=`pwd`
OBJ_ADD=""
# set general options
CMAKE_VARIABLES="$CMAKE_VARIABLES -DBUILD_SHARED_LIBS:BOOL=ON"
if [ "$VERBOSE" = "ON" ]; then
CMAKE_VARIABLES="$CMAKE_VARIABLES -DCMAKE_VERBOSE_MAKEFILE=TRUE"
fi
# set MPI specific options
if [ "$INCLUDE_MPI" = "ON" ]; then
OBJ_ADD="$OBJ_ADD-mpi"
if [ "$WM_MPLIB" = "OPENMPI" ]; then
MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include
MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so
MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun
elif [ "$WM_MPLIB" = "LAM" ]; then
MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include
MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so
MPI_RUN=$LAM_ARCH_PATH/bin/mpirun
elif [ "$WM_MPLIB" = "MPICH" ]; then
MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include
MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so
MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun
fi
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_USE_MPI=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_USE_MPI=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_INCLUDE_PATH=$MPI_INCLUDE_PATH"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_LIBRARY=$MPI_LIBRARY"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPIRUN_EXE=$MPI_RUN"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
fi
# set python specific options
if [ "$INCLUDE_PYTHON" = "ON" ]; then
WHICH_PYTHON=`which python`
if [ "$WHICH_PYTHON" != "" ]; then
OBJ_ADD="$OBJ_ADD-py"
PYTHON_LIBRARY=`ldd $WHICH_PYTHON | grep libpython | \
sed 's/.* => \(.*\) (.*/\1/'`
PYTHON_MAJOR_VERSION=`echo $PYTHON_LIBRARY | \
sed 's/.*libpython\(.*\).so.*/\1/'`
PYTHON_INCLUDE_DIR=/usr/include/python$PYTHON_MAJOR_VERSION
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_ENABLE_PYTHON=ON"
CMAKE_VARIABLES= \
"$CMAKE_VARIABLES -DPYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_DIR"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPYTHON_LIBRARY=$PYTHON_LIBRARY"
else
echo "*** Warning: Unable to determine python libray"
echo "*** De-activating python support"
INCLUDE_PYTHON="OFF"
fi
fi
# set MESA specific options
if [ "$INCLUDE_MESA" = "ON" ]; then
OBJ_ADD="$OBJ_ADD-mesa"
MESA_INCLUDE_DIR=/usr/include/GL
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_OPENGL_HAS_OSMESA=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_LIBRARY=$MESA_LIBRARY"
fi
# set paraview environment
PARAVIEW_SRC_DIR=$PWD/$PARAVIEW_SRC
#PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS
# remove existing build folder if present
if [ -e "$PARAVIEW_OBJ_DIR" ]; then
rm -rf $PARAVIEW_OBJ_DIR
fi
# create paraview build folder
mkdir -p $PARAVIEW_OBJ_DIR
cd $PARAVIEW_OBJ_DIR
echo "Building $PARAVIEW_SRC"
echo " MPI support : $INCLUDE_MPI"
echo " Python support : $INCLUDE_PYTHON"
echo " MESA support : $INCLUDE_MESA"
echo " Source : $PARAVIEW_SRC_DIR"
echo " Target : $PARAVIEW_OBJ_DIR"
# make paraview
cmake \
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
$CMAKE_VARIABLES \
$PARAVIEW_SRC_DIR
if [ -r /proc/cpuinfo ]; then
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
if [ $WM_NCOMPPROCS -gt 8 ]; then
WM_NCOMPPROCS=8
fi
make -j $WM_NCOMPPROCS
else
make
fi
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
echo " Build complete"
# replace local links with ParaView_INST_DIR environment variables
echo " Replacing path hard links"
find . -iname \*.cmake -execdir sed -i \
"s,$PARAVIEW_SRC_DIR,\$ENV{ParaView_INST_DIR},g" {} ';' \
-print
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
echo " Creating paraview 3.2 soft link to /bin"
( mkdir lib && cd lib && ln -s ../bin paraview-3.2 )
# info on symlinks to screen
echo ""
echo " ---"
echo " Installation complete"
echo " Set environment variables:"
echo " - ParaView_INST_DIR to $PARAVIEW_SRC_DIR"
echo " - ParaView_DIR to $PARAVIEW_OBJ_DIR"
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
echo " Add $PARAVIEW_OBJ_DIR/bin to PATH"
#echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
echo " ---"
echo "done."
fi
# finalisation
cd $PWD
#!/bin/sh
set -x
# ParaView 3.x build script
# - run from folder above source folder
PARAVIEW_SRC="ParaView3.3-cvs"
VERBOSE="OFF"
INCLUDE_MPI="ON"
MPI_MAX_PROCS=32
INCLUDE_PYTHON="ON"
INCLUDE_MESA="OFF"
# initialisation
CMAKE_VARIABLES=""
PWD=`pwd`
OBJ_ADD=""
# set general options
CMAKE_VARIABLES="$CMAKE_VARIABLES -DBUILD_SHARED_LIBS:BOOL=ON"
if [ "$VERBOSE" = "ON" ]; then
CMAKE_VARIABLES="$CMAKE_VARIABLES -DCMAKE_VERBOSE_MAKEFILE=TRUE"
fi
# set MPI specific options
if [ "$INCLUDE_MPI" = "ON" ]; then
OBJ_ADD="$OBJ_ADD-mpi"
if [ "$WM_MPLIB" = "OPENMPI" ]; then
MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include
MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so
MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun
elif [ "$WM_MPLIB" = "LAM" ]; then
MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include
MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so
MPI_RUN=$LAM_ARCH_PATH/bin/mpirun
elif [ "$WM_MPLIB" = "MPICH" ]; then
MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include
MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so
MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun
fi
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_USE_MPI=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_USE_MPI=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_INCLUDE_PATH=$MPI_INCLUDE_PATH"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DMPI_LIBRARY=$MPI_LIBRARY"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPIRUN_EXE=$MPI_RUN"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_MPI_MAX_NUMPROCS=$MPI_MAX_PROCS"
fi
# set python specific options
if [ "$INCLUDE_PYTHON" = "ON" ]; then
WHICH_PYTHON=`which python`
if [ "$WHICH_PYTHON" != "" ]; then
OBJ_ADD="$OBJ_ADD-py"
PYTHON_LIBRARY=`ldd $WHICH_PYTHON | grep libpython | \
sed 's/.* => \(.*\) (.*/\1/'`
PYTHON_MAJOR_VERSION=`echo $PYTHON_LIBRARY | \
sed 's/.*libpython\(.*\).so.*/\1/'`
PYTHON_INCLUDE_DIR=/usr/include/python$PYTHON_MAJOR_VERSION
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPARAVIEW_ENABLE_PYTHON=ON"
CMAKE_VARIABLES= \
"$CMAKE_VARIABLES -DPYTHON_INCLUDE_PATH=$PYTHON_INCLUDE_DIR"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DPYTHON_LIBRARY=$PYTHON_LIBRARY"
else
echo "*** Warning: Unable to determine python libray"
echo "*** De-activating python support"
INCLUDE_PYTHON="OFF"
fi
fi
# set MESA specific options
if [ "$INCLUDE_MESA" = "ON" ]; then
OBJ_ADD="$OBJ_ADD-mesa"
MESA_INCLUDE_DIR=/usr/include/GL
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
CMAKE_VARIABLES="$CMAKE_VARIABLES -DVTK_OPENGL_HAS_OSMESA=ON"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_INCLUDE_DIR=$MESA_INCLUDE_DIR"
CMAKE_VARIABLES="$CMAKE_VARIABLES -DOSMESA_LIBRARY=$MESA_LIBRARY"
fi
# set paraview environment
PARAVIEW_SRC_DIR=$PWD/$PARAVIEW_SRC
#PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS/obj$OBJ_ADD
PARAVIEW_OBJ_DIR=$PARAVIEW_SRC_DIR/platforms/$WM_OPTIONS
# remove existing build folder if present
if [ -e "$PARAVIEW_OBJ_DIR" ]; then
rm -rf $PARAVIEW_OBJ_DIR
fi
# create paraview build folder
mkdir -p $PARAVIEW_OBJ_DIR
cd $PARAVIEW_OBJ_DIR
echo "Building $PARAVIEW_SRC"
echo " MPI support : $INCLUDE_MPI"
echo " Python support : $INCLUDE_PYTHON"
echo " MESA support : $INCLUDE_MESA"
echo " Source : $PARAVIEW_SRC_DIR"
echo " Target : $PARAVIEW_OBJ_DIR"
# make paraview
cmake \
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
$CMAKE_VARIABLES \
$PARAVIEW_SRC_DIR
if [ -r /proc/cpuinfo ]; then
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
if [ $WM_NCOMPPROCS -gt 8 ]; then
WM_NCOMPPROCS=8
fi
make -j $WM_NCOMPPROCS
else
make
fi
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
echo " Build complete"
# replace local links with ParaView_INST_DIR environment variables
echo " Replacing path hard links"
find . -iname \*.cmake -execdir sed -i \
"s,$PARAVIEW_SRC_DIR,\$ENV{ParaView_INST_DIR},g" {} ';' \
-print
# create a softlink to the $PARAVIEW_OBJ_DIR/bin folder
echo " Creating paraview 3.2 soft link to /bin"
( mkdir lib && cd lib && ln -s ../bin paraview-3.2 )
# info on symlinks to screen
echo ""
echo " ---"
echo " Installation complete"
echo " Set environment variables:"
echo " - ParaView_INST_DIR to $PARAVIEW_SRC_DIR"
echo " - ParaView_DIR to $PARAVIEW_OBJ_DIR"
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
echo " Add $PARAVIEW_OBJ_DIR/bin to PATH"
#echo " Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
echo " ---"
echo "done."
fi
# finalisation
cd $PWD
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment