1 #----------------------------------*-sh-*--------------------------------------
3 # \\ / F ield | foam-extend: Open Source CFD
4 # \\ / O peration | Version: 3.2
5 # \\ / A nd | Web: http://www.foam-extend.org
6 # \\/ M anipulation | For copyright notice see file Copyright
7 #------------------------------------------------------------------------------
9 # This file is part of foam-extend.
11 # foam-extend is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by the
13 # Free Software Foundation, either version 3 of the License, or (at your
14 # option) any later version.
16 # foam-extend is distributed in the hope that it will be useful, but
17 # WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 # General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 # Setup file for paraview-3.x
29 # Sourced from FOAM-*/etc/bashrc
32 # The env. variable 'ParaView_DIR' is required for building plugins
33 #------------------------------------------------------------------------------
35 # determine the cmake to be used
37 for cmake in cmake-2.6.4 cmake-2.6.2 cmake-2.4.6
39 cmake=$WM_THIRD_PARTY_DIR/$cmake/platforms/$WM_ARCH
42 export CMAKE_HOME=$cmake
43 export PATH=$CMAKE_HOME/bin:$PATH
48 # set MAJOR and VERSION variables if not already set
49 [ -z "$ParaView_MAJOR" ] && export ParaView_MAJOR=paraview-3.8
50 [ -z "$ParaView_VERSION" ] && export ParaView_VERSION=3.8.1
52 export ParaView_INST_DIR=$WM_THIRD_PARTY_DIR/ParaView-$ParaView_VERSION
53 export ParaView_DIR=$ParaView_INST_DIR/platforms/$WM_ARCH$WM_COMPILER
55 # add in python libraries if required
56 paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
57 if [ -r $paraviewPython ]
61 export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
63 export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
67 if [ "$PYTHONPATH" ]; then
68 export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping
70 export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping
72 if [ "$WM_ARCH_BASE" = "darwin" ]
74 export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/bin
77 if [ -r $ParaView_DIR ]
79 export PATH=$ParaView_DIR/bin:$PATH
80 export PV_PLUGIN_PATH=$FOAM_LIBBIN
81 if [ "$WM_ARCH_BASE" == "darwin" ]
83 export PATH=$ParaView_DIR/bin/paraview.app/Contents/MacOS:$PATH
84 export DYLD_LIBRARY_PATH=$ParaView_DIR/bin:$DYLD_LIBRARY_PATH
85 export DYLD_LIBRARY_PATH=$ParaView_DIR/lib/$ParaView_MAJOR:$DYLD_LIBRARY_PATH
87 # Move plugins to a separate directory because paraview crashes
88 # when it tries to load one of the other libraries in $FOAM_LIBBIN as a plugin
89 export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview
90 if [ ! -e $PV_PLUGIN_PATH ]
92 echo "Creating $PV_PLUGIN_PATH"
95 for i in $(find $FOAM_LIBBIN -depth 1 -name "libPV*")
97 ln -sf $i $PV_PLUGIN_PATH
102 unset cmake paraviewPython
103 # -----------------------------------------------------------------------------