cshrc 3.54 KB
Newer Older
1
2
3
4
#----------------------------------*-sh-*--------------------------------------
# =========                 |
# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
#  \\    /   O peration     |
5
#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
6
7
8
9
10
#    \\/     M anipulation  |
#------------------------------------------------------------------------------
# License
#     This file is part of OpenFOAM.
#
11
12
13
14
#     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 3 of the License, or
#     (at your option) any later version.
15
16
17
18
19
20
21
#
#     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
22
#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
23
#
24
# File
Mark Olesen's avatar
Mark Olesen committed
25
#     paraview3/cshrc
26
27
#
# Description
28
#     Setup file for paraview-3.x
29
#     Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias
30
#
31
# Note
32
33
#     The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
#     are required for building plugins
34
35
#------------------------------------------------------------------------------

36
# clean the PATH
37
38
set cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/cmake- $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-"`
if ( $status == 0 ) setenv PATH $cleaned
39

40
41
# determine the cmake to be used
unsetenv CMAKE_HOME
42
foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
43
    set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
44
45
    if ( -r $cmake ) then
        setenv CMAKE_HOME $cmake
46
        setenv PATH ${CMAKE_HOME}/bin:${PATH}
47
48
49
        break
    endif
end
50

51
# set VERSION and MAJOR (version) variables if not already set
52
if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.8.0
53
if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
54
55
56
57

# if needed, set MAJOR version to correspond to VERSION
# ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
switch ("$ParaView_VERSION")
58
case "$ParaView_MAJOR".*:
59
60
61
    # version and major appear to correspond
    breaksw

62
63
case [0-9]*:
    # extract major from the version
64
65
66
67
68
    setenv ParaView_MAJOR `echo ${ParaView_VERSION} | \
        sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/'`
    breaksw
endsw

69

70
set paraviewInstDir=$WM_THIRD_PARTY_DIR/paraview-${ParaView_VERSION}
71
setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-${ParaView_VERSION}
72

73
74
# set paths if binaries or source are present
if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
75
    setenv PATH ${ParaView_DIR}/bin:${PATH}
76
    setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}"
77
    setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
78

79
80
81
82
83
84
85
86
    # add in python libraries if required
    set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
    if ( -r $paraviewPython ) then
        if ($?PYTHONPATH) then
            setenv PYTHONPATH ${PYTHONPATH}:${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
        else
            setenv PYTHONPATH ${paraviewPython}:$ParaView_DIR/lib/paraview-${ParaView_MAJOR}
        endif
87
    endif
88
89
else
    unsetenv PV_PLUGIN_PATH
Mattijs Janssens's avatar
Mattijs Janssens committed
90
endif
91
92


93
unset cleaned cmake paraviewInstDir paraviewPython
94
# -----------------------------------------------------------------------------