updated scripts for paraview 3.3
* install into paraview-3.3 instead of ParaView3.X.x for consistency with LD_LIBRARY_PATH
This commit is contained in:
parent
f9f39234d2
commit
9d4b64bdbe
81
bin/paraFoam
81
bin/paraFoam
@ -33,33 +33,33 @@
|
|||||||
Script=${0##*/}
|
Script=${0##*/}
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: $Script [-case dir]
|
usage: $Script [-case dir]
|
||||||
|
|
||||||
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
* start paraview $ParaView_VERSION with the OpenFOAM libraries
|
||||||
|
|
||||||
USAGE
|
USAGE
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# parse options
|
# parse options
|
||||||
if [ "$#" -gt 0 ]; then
|
if [ "$#" -gt 0 ]; then
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-case)
|
-case)
|
||||||
shift
|
shift
|
||||||
caseDir=$1
|
caseDir=$1
|
||||||
[ "$#" -ge 1 ] || usage "'-case' option requires an argument"
|
[ "$#" -ge 1 ] || usage "'-case' option requires an argument"
|
||||||
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage "unknown option/argument: '$*'"
|
usage "unknown option/argument: '$*'"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# get a sensible caseName
|
# get a sensible caseName
|
||||||
@ -67,41 +67,38 @@ caseName=${PWD##*/}
|
|||||||
|
|
||||||
# parent directory for normal or parallel results
|
# parent directory for normal or parallel results
|
||||||
case "$caseName" in
|
case "$caseName" in
|
||||||
processor*) parentDir=".." ;;
|
processor*) parentDir=".." ;;
|
||||||
*) parentDir="." ;;
|
*) parentDir="." ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# check existence of essential files
|
# check existence of essential files
|
||||||
for check in system/controlDict system/fvSchemes system/fvSolution
|
for check in system/controlDict system/fvSchemes system/fvSolution
|
||||||
do
|
do
|
||||||
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
||||||
done
|
done
|
||||||
|
|
||||||
OpenFoamExt="foam"
|
caseFile="$caseName.foam"
|
||||||
# OpenFoamExt="OpenFOAM"
|
# caseFile="$caseName.OpenFOAM"
|
||||||
|
|
||||||
if [ "$ParaView_VERSION" = "3" ]; then
|
case "$ParaView_VERSION" in
|
||||||
|
2*)
|
||||||
|
# Clean up on termination and on Ctrl-C
|
||||||
|
trap "rm -f paraFoam.pvs $caseFile 2>/dev/null; exit 0" EXIT TERM INT
|
||||||
|
touch $caseFile
|
||||||
|
|
||||||
# check existence of essential files
|
# since we are now in the cwd, %CASE% is '$PWD/$caseFile'
|
||||||
for check in system/controlDict system/fvSchemes system/fvSolution
|
sed -e s@%CASE%@$PWD/$caseFile@g \
|
||||||
do
|
$WM_PROJECT_DIR/bin/paraFoam.pvs > paraFoam.pvs
|
||||||
[ -s "$parentDir/$check" ] || usage "file does not exist: '$parentDir/$check'"
|
|
||||||
done
|
|
||||||
|
|
||||||
touch $caseName.$OpenFoamExt
|
paraview paraFoam.pvs
|
||||||
paraview --data=$caseName.$OpenFoamExt
|
;;
|
||||||
rm $caseName.$OpenFoamExt 2>/dev/null
|
|
||||||
|
|
||||||
else
|
*)
|
||||||
|
# Clean up on termination and on Ctrl-C
|
||||||
# since we are now in the cwd, FOAM_ROOT/FOAM_CASE is '$PWD'
|
trap "rm -f $caseFile 2>/dev/null; exit 0" EXIT TERM INT
|
||||||
sed -e s%FOAM_ROOT/FOAM_CASE%$PWD%g \
|
touch $caseFile
|
||||||
-e s%FOAM_CASE%$caseName%g $WM_PROJECT_DIR/bin/paraFoam.pvs > paraFoam.pvs
|
paraview --data=$caseFile
|
||||||
|
;;
|
||||||
touch $caseName.$OpenFoamExt
|
|
||||||
paraview paraFoam.pvs
|
|
||||||
rm paraFoam.pvs $caseName.$OpenFoamExt 2>/dev/null
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
esac
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
12
bin/paraFoam.pvs
Normal file
12
bin/paraFoam.pvs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# ParaView State Version 2.2
|
||||||
|
|
||||||
|
set kw(vtkTemp2) [$Application GetMainWindow]
|
||||||
|
set kw(vtkTemp29) [$kw(vtkTemp2) GetMainView]
|
||||||
|
set kw(vtkTemp980) [$kw(vtkTemp2) GetAnimationManager]
|
||||||
|
[$kw(vtkTemp2) GetRotateCameraButton] SetState 1
|
||||||
|
$kw(vtkTemp2) ChangeInteractorStyle 1
|
||||||
|
set kw(vtkTemp840) [$kw(vtkTemp2) InitializeReadCustom "FoamReader" "%CASE%"]
|
||||||
|
$kw(vtkTemp2) ReadFileInformation $kw(vtkTemp840) "%CASE%"
|
||||||
|
$kw(vtkTemp2) FinalizeRead $kw(vtkTemp840) "%CASE%"
|
||||||
|
set kw(vtkTemp868) [$kw(vtkTemp840) GetPVWidget {Filename}]
|
||||||
|
$kw(vtkTemp868) SetValue "%CASE%"
|
2
bin/tools/README
Normal file
2
bin/tools/README
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Misc. tools for building applications, etc that are useful to have
|
||||||
|
but which don't really need to be in the PATH.
|
193
bin/tools/buildParaView3.3
Executable file
193
bin/tools/buildParaView3.3
Executable file
@ -0,0 +1,193 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# ParaView 3.x build script
|
||||||
|
# - normally run from folder above source folder
|
||||||
|
|
||||||
|
# use the version number and the installation location specified
|
||||||
|
# in etc/apps/paraview3/{bashrc,cshrc}
|
||||||
|
: ${ParaView_VERSION:=3.3}
|
||||||
|
: ${ParaView_INST_DIR:=$WM_PROJECT_INST_DIR/paraview-$ParaView_VERSION}
|
||||||
|
|
||||||
|
#!!User:
|
||||||
|
# set to location of paraview sources and where to build paraview
|
||||||
|
# PARAVIEW_SRC_DIR=$WM_PROJECT_INST_DIR/src/other/ParaView3
|
||||||
|
PARAVIEW_SRC_DIR=/data/cfd2/work/cfdadmin/cvs/ParaView3
|
||||||
|
PARAVIEW_BUILD_DIR=$PARAVIEW_SRC_DIR/platforms
|
||||||
|
|
||||||
|
# TODO: extract the version number from the CMakeLists.txt variables:
|
||||||
|
# PARAVIEW_VERSION_MAJOR, and PARAVIEW_VERSION_MINOR
|
||||||
|
# ParaView_VERSION="3.3"
|
||||||
|
|
||||||
|
# SET(PARAVIEW_VERSION_MAJOR 3)
|
||||||
|
# SET(PARAVIEW_VERSION_MINOR 3)
|
||||||
|
|
||||||
|
#!!User:
|
||||||
|
# select desired features, include Python whenever possible
|
||||||
|
VERBOSE=OFF
|
||||||
|
INCLUDE_MPI=OFF
|
||||||
|
MPI_MAX_PROCS=32
|
||||||
|
INCLUDE_PYTHON=ON
|
||||||
|
INCLUDE_MESA=OFF
|
||||||
|
|
||||||
|
# initialisation
|
||||||
|
oldpwd=$PWD
|
||||||
|
unset OBJ_ADD
|
||||||
|
|
||||||
|
# always build shared libraries
|
||||||
|
CMAKE_VARIABLES="-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||||
|
|
||||||
|
if [ "$VERBOSE" = ON ]; then
|
||||||
|
CMAKE_VARIABLES="$CMAKE_VARIABLES -DCMAKE_VERBOSE_MAKEFILE=TRUE"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#****************************************************************************
|
||||||
|
# FIX: Attempt to get around seg-fault when building documentation
|
||||||
|
#CMAKE_VARIABLES="$CMAKE_VARIABLES -BUILD_DOCUMENTATION-ADVANCED:INTERNAL=0"
|
||||||
|
#****************************************************************************
|
||||||
|
|
||||||
|
# set python specific options
|
||||||
|
# NOTE - you'll need both python and python-devel packages installed
|
||||||
|
# - might need to create a symbolic link to the python library
|
||||||
|
# - anything after the '.so' gets in the way...
|
||||||
|
# - might need to run cmake -> make twice to pick up all the links...
|
||||||
|
if [ "$INCLUDE_PYTHON" = ON ]; then
|
||||||
|
PYTHON_INCLUDE_DIR=/usr/include/python2.5
|
||||||
|
PYTHON_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libpython2.5.so
|
||||||
|
|
||||||
|
if [ -d "$PYTHON_INCLUDE_DIR" ]; then
|
||||||
|
OBJ_ADD="$OBJ_ADD-py"
|
||||||
|
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 "non-existent PYTHON_INCLUDE_DIR: $PYTHON_INCLUDE_DIR"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set MPI specific options
|
||||||
|
if [ "$INCLUDE_MPI" = ON ]; then
|
||||||
|
case "$WM_MPLIB" in
|
||||||
|
OPENMPI)
|
||||||
|
MPI_INCLUDE_PATH=$OPENMPI_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$OPENMPI_ARCH_PATH/lib/libmpi.so
|
||||||
|
MPI_RUN=$OPENMPI_ARCH_PATH/bin/mpirun
|
||||||
|
;;
|
||||||
|
LAM)
|
||||||
|
MPI_INCLUDE_PATH=$LAM_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$LAM_ARCH_PATH/lib/libmpi.so
|
||||||
|
MPI_RUN=$LAM_ARCH_PATH/bin/mpirun
|
||||||
|
;;
|
||||||
|
MPICH)
|
||||||
|
MPI_INCLUDE_PATH=$MPICH_ARCH_PATH/include
|
||||||
|
MPI_LIBRARY=$MPICH_ARCH_PATH/lib/libmpich.so
|
||||||
|
MPI_RUN=$MPICH_ARCH_PATH/bin/mpirun
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
unset INCLUDE_MPI
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [ "$INCLUDE_MPI" ]; then
|
||||||
|
OBJ_ADD="$OBJ_ADD-mpi"
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
echo "unknown/unsupported mpi: $WM_MPLIB"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# set MESA specific options
|
||||||
|
if [ "$INCLUDE_MESA" = ON ]; then
|
||||||
|
MESA_INCLUDE_DIR=/usr/include/GL
|
||||||
|
MESA_LIBRARY=/usr/lib$WM_COMPILER_LIB_ARCH/libOSMesa.so
|
||||||
|
|
||||||
|
if [ -d "$MESA_INCLUDE_DIR" -a -f "$MESA_LIBRARY" ]; then
|
||||||
|
OBJ_ADD="$OBJ_ADD-mesa"
|
||||||
|
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"
|
||||||
|
else
|
||||||
|
echo "no MESA information found ... skipping"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
# finalize the build/install environment
|
||||||
|
PARAVIEW_OBJ_DIR=$PARAVIEW_BUILD_DIR/$WM_OPTIONS$OBJ_ADD
|
||||||
|
PARAVIEW_APP_DIR=$ParaView_INST_DIR/platforms/$WM_OPTIONS$OBJ_ADD
|
||||||
|
|
||||||
|
# create paraview build folder
|
||||||
|
mkdir -p $PARAVIEW_OBJ_DIR
|
||||||
|
cd $PARAVIEW_OBJ_DIR
|
||||||
|
|
||||||
|
#
|
||||||
|
# make paraview
|
||||||
|
#
|
||||||
|
|
||||||
|
# provide a backdoor to skip cmake for repeated builds
|
||||||
|
if [ -z "$build_no_cmake" ]
|
||||||
|
then
|
||||||
|
cmake \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=$PARAVIEW_APP_DIR \
|
||||||
|
$CMAKE_VARIABLES \
|
||||||
|
$PARAVIEW_SRC_DIR
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -r /proc/cpuinfo ]; then
|
||||||
|
WM_NCOMPPROCS=`egrep "^processor" /proc/cpuinfo | wc -l`
|
||||||
|
|
||||||
|
[ $WM_NCOMPPROCS -le 8 ] || WM_NCOMPPROCS=8
|
||||||
|
|
||||||
|
make -j $WM_NCOMPPROCS
|
||||||
|
else
|
||||||
|
make
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if [ -e "$PARAVIEW_OBJ_DIR/bin/paraview" ]; then
|
||||||
|
echo "Info: Installation completed - proceeding to install"
|
||||||
|
make install
|
||||||
|
|
||||||
|
# copy VTK headers to install directory
|
||||||
|
echo "Info: Copying VTK headers"
|
||||||
|
cp -r $PARAVIEW_SRC_DIR/VTK $PARAVIEW_APP_DIR
|
||||||
|
cp -r $PARAVIEW_OBJ_DIR/VTK/vtkConfigure.h $PARAVIEW_APP_DIR/VTK
|
||||||
|
cp -r $PARAVIEW_OBJ_DIR/VTK/vtkstd $PARAVIEW_APP_DIR/VTK
|
||||||
|
|
||||||
|
# copy all .so files to the lib folder
|
||||||
|
# - NOTE: shouldn't be necessary - but some libs not copied over to the
|
||||||
|
# install folder
|
||||||
|
## echo "Info: Copying libs"
|
||||||
|
## cp $PARAVIEW_OBJ_DIR/bin/*.so* $PARAVIEW_APP_DIR/lib/paraview-$ParaView_VERSION
|
||||||
|
|
||||||
|
echo "Info: Copying ParaViewConfig.cmake"
|
||||||
|
cp $PARAVIEW_OBJ_DIR/ParaViewConfig.cmake $PARAVIEW_APP_DIR
|
||||||
|
|
||||||
|
if [ "$OBJ_ADD" ]; then
|
||||||
|
echo "Creating symbolic link in $ParaView_INST_DIR/platforms from $WM_OPTIONS$OBJ_ADD to $WM_OPTIONS"
|
||||||
|
( cd $ParaView_INST_DIR/platforms && ln -s $WM_OPTIONS$OBJ_ADD $WM_OPTIONS )
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Installation complete"
|
||||||
|
echo "Set environment variables:"
|
||||||
|
echo " - ParaView_DIR to $PARAVIEW_APP_DIR"
|
||||||
|
echo " - ParaView_INST_DIR to $PARAVIEW_APP_DIR"
|
||||||
|
echo " - PV_PLUGIN_PATH to $FOAM_LIBBIN"
|
||||||
|
echo "Add $ParaView_INST_DIR/bin to PATH"
|
||||||
|
echo "Add $ParaView_INST_DIR/lib to LD_LIBRARY_PATH"
|
||||||
|
|
||||||
|
echo "done."
|
||||||
|
else
|
||||||
|
echo "*** Error: Installation failed - see output window"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# finalisation
|
||||||
|
cd $oldpwd
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------- end-of-file
|
@ -41,18 +41,26 @@ export CMAKE_HOME=$WM_PROJECT_INST_DIR/$WM_ARCH/cmake-2.4.6
|
|||||||
|
|
||||||
if [ -r $CMAKE_HOME ]; then
|
if [ -r $CMAKE_HOME ]; then
|
||||||
export PATH=$CMAKE_HOME/bin:$PATH
|
export PATH=$CMAKE_HOME/bin:$PATH
|
||||||
|
else
|
||||||
|
unset CMAKE_HOME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export ParaView_VERSION=3
|
# export ParaView_VERSION="3.3-cvs"
|
||||||
|
export ParaView_VERSION=3.3
|
||||||
|
|
||||||
export ParaView_INST_DIR=$WM_PROJECT_INST_DIR/ParaView3.3-cvs
|
export ParaView_INST_DIR=$WM_PROJECT_INST_DIR/paraview-$ParaView_VERSION
|
||||||
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_OPTIONS
|
export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_OPTIONS
|
||||||
|
|
||||||
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/bin:$ParaView_DIR/Utilities/VTKPythonWrapping
|
if [ "$PYTHONPATH" ]; then
|
||||||
|
export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
|
else
|
||||||
|
export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -r $ParaView_DIR ]; then
|
if [ -r $ParaView_DIR ]; then
|
||||||
export PATH=$ParaView_DIR/bin:$PATH
|
export PATH=$ParaView_DIR/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=${ParaView_DIR}/bin:${LD_LIBRARY_PATH}
|
export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_VERSION:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
export PV_PLUGIN_PATH=$FOAM_LIBBIN
|
export PV_PLUGIN_PATH=$FOAM_LIBBIN
|
||||||
fi
|
fi
|
||||||
|
@ -41,11 +41,14 @@ setenv CMAKE_HOME $WM_PROJECT_INST_DIR/$WM_ARCH/cmake-2.4.6
|
|||||||
|
|
||||||
if ( -r $CMAKE_HOME ) then
|
if ( -r $CMAKE_HOME ) then
|
||||||
set path=($CMAKE_HOME/bin $path)
|
set path=($CMAKE_HOME/bin $path)
|
||||||
|
else
|
||||||
|
unset CMAKE_HOME
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setenv ParaView_VERSION 3
|
# setenv ParaView_VERSION 3.3-cvs
|
||||||
|
setenv ParaView_VERSION 3.3
|
||||||
|
|
||||||
setenv ParaView_INST_DIR $WM_PROJECT_INST_DIR/ParaView3.3-cvs
|
export ParaView_INST_DIR=$WM_PROJECT_INST_DIR/paraview-$ParaView_VERSION
|
||||||
setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_OPTIONS
|
setenv ParaView_DIR $ParaView_INST_DIR/platforms/$WM_OPTIONS
|
||||||
|
|
||||||
if ($?PYTHONPATH) then
|
if ($?PYTHONPATH) then
|
||||||
@ -56,7 +59,7 @@ 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 LD_LIBRARY_PATH $ParaView_DIR/lib/paraview-$ParaView_VERSION:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
setenv PV_PLUGIN_PATH $FOAM_LIBBIN
|
setenv PV_PLUGIN_PATH $FOAM_LIBBIN
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user