Merge branch 'master' of ssh://git.code.sf.net/p/foam-extend/foam-extend-3.2
[foam-extend-3.2.git] / etc / apps / paraview3 / bashrc
bloba61ec941b1f064d14d995aa73975a82811967877
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
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 #------------------------------------------------------------------------------
8 # License
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/>.
24 # Script
25 #     paraview3/bashrc
27 # Description
28 #     Setup file for paraview-3.x
29 #     Sourced from FOAM-*/etc/bashrc
31 # Note
32 #     The env. variable 'ParaView_DIR' is required for building plugins
33 #------------------------------------------------------------------------------
35 # determine the cmake to be used
36 unset CMAKE_HOME
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
40     if [ -r $cmake ]
41     then
42         export CMAKE_HOME=$cmake
43         export PATH=$CMAKE_HOME/bin:$PATH
44         break
45     fi
46 done
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 ]
58 then
59     if [ "$PYTHONPATH" ]
60     then
61         export PYTHONPATH=$PYTHONPATH:$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
62     else
63         export PYTHONPATH=$paraviewPython:$ParaView_DIR/lib/$ParaView_MAJOR
64     fi
67 if [ "$PYTHONPATH" ]; then
68     export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/Utilities/VTKPythonWrapping
69 else
70     export PYTHONPATH=$ParaView_DIR/Utilities/VTKPythonWrapping
72 if [ "$WM_ARCH_BASE" = "darwin" ]
73 then
74     export PYTHONPATH=$PYTHONPATH:$ParaView_DIR/bin
77 if [ -r $ParaView_DIR ]
78 then
79     export PATH=$ParaView_DIR/bin:$PATH
80     export PV_PLUGIN_PATH=$FOAM_LIBBIN
81     if [ "$WM_ARCH_BASE" == "darwin" ]
82     then
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 ]
91         then
92             echo "Creating $PV_PLUGIN_PATH"
93             mkdir $PV_PLUGIN_PATH
94         fi
95         for i in $(find $FOAM_LIBBIN -depth 1 -name "libPV*")
96         do
97             ln -sf $i $PV_PLUGIN_PATH
98         done
99     fi
102 unset cmake paraviewPython
103 # -----------------------------------------------------------------------------