intersection with triangle plane for miss
[OpenFOAM-1.5.x.git] / bin / buildParaView
blobcceee964873f6d4b2f2ed29875bb861da9ea38ba
1 #!/bin/sh
2 #------------------------------------------------------------------------------
3 # ========= |
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / O peration |
6 # \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 # \\/ M anipulation |
8 #------------------------------------------------------------------------------
9 # License
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software; you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM; if not, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 # Script
27 # buildParaView
29 # Description
30 # Build and install paraview
31 # - run from folder above paraview source folder or place the
32 # paraview source under $WM_THIRD_PARTY_DIR
34 #------------------------------------------------------------------------------
35 . $WM_PROJECT_DIR/bin/tools/buildParaViewFunctions
37 # User options:
38 # ~~~~~~~~~~~~~
40 # MPI support:
41 withMPI=false
42 MPI_MAX_PROCS=32
44 # Python support:
45 # note: script will try to determine the appropriate python library.
46 # If it fails, specify the path using the PYTHON_LIBRARY variable
47 withPYTHON=false
48 PYTHON_LIBRARY=""
49 # PYTHON_LIBRARY="/usr/lib64/libpython2.6.so.1.0"
51 # MESA graphics support:
52 withMESA=false
53 MESA_INCLUDE="/usr/include/GL"
54 MESA_LIBRARY="/usr/lib64/libOSMesa.so"
56 # extra QT gui support (useful for re-using the installation for engrid)
57 withQTSUPPORT=true
59 # Set the path to the Qt-4.3.? qmake if the system Qt is other than this version
60 QMAKE_PATH=""
61 #QMAKE_PATH=/usr/local/Trolltech/Qt-4.3.5/bin/qmake
62 #QMAKE_PATH=$WM_THIRD_PARTY_DIR/qt-x11-opensource-src-4.3.5/platforms/linux64GccDPOpt/bin/qmake
65 # No further editing below this line
66 #------------------------------------------------------------------------------
67 Script=${0##*/}
69 usage() {
70 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
71 cat<<USAGE
73 usage: $Script [OPTION]
74 options:
75 -rebuild for repeated builds (-make -install) *use with caution*
76 -mpi with mpi (if not already enabled)
77 -python with python (if not already enabled)
78 -mesa with mesa (if not already enabled)
79 -qt with extra Qt gui support (if not already enabled)
80 -verbose verbose output in Makefiles
81 -version VER specify an alternative version (default: $ParaView_VERSION)
82 -help
84 For finer control, the build stages can be also selected individually
85 (mutually exclusive)
86 -config
87 -make
88 -makedoc
89 -install
90 [-envpath] alter absolute paths in CMake files to use env variables
92 Build and install paraview-$ParaView_VERSION
93 - run from folder above the ParaView source folder or place the ParaView
94 source under \$WM_THIRD_PARTY_DIR ($WM_THIRD_PARTY_DIR)
96 USAGE
97 exit 1
100 #------------------------------------------------------------------------------
103 # add options based on script name:
105 case "$Script" in *-mpi*) withMPI=true;; esac
106 case "$Script" in *-python*) withPYTHON=true;; esac
107 case "$Script" in *-mesa*) withMESA=true;; esac
108 case "$Script" in *-qt*) withQTSUPPORT=true;; esac
111 # various building stages
113 runCONFIG=true
114 runMAKE=true
115 runMAKEDOC=true
116 runINSTALL=true
117 runENVPATH=false
120 # parse options
121 while [ "$#" -gt 0 ]
123 case "$1" in
124 -h | -help)
125 usage
127 -config) # stage 1: config only
128 runCONFIG=true
129 runMAKE=false
130 runMAKEDOC=false
131 runINSTALL=false
132 shift
134 -make) # stage 2: make only
135 runCONFIG=false
136 runMAKE=true
137 runMAKEDOC=false
138 runINSTALL=false
139 shift
141 -makedoc) # stage 3: generate html documentation
142 runCONFIG=false
143 runMAKE=false
144 runMAKEDOC=true
145 runINSTALL=false
146 shift
148 -install) # stage 4: install only
149 runCONFIG=false
150 runMAKE=false
151 runMAKEDOC=false
152 runINSTALL=true
153 shift
155 -envpath) # optional: change cmake files to use env variables
156 runCONFIG=false
157 runMAKE=false
158 runMAKEDOC=false
159 runINSTALL=false
160 runENVPATH=true
161 shift
163 -rebuild) # shortcut for rebuilding
164 runCONFIG=false
165 runMAKE=true
166 runMAKEDOC=false
167 runINSTALL=true
168 shift
170 -mpi)
171 withMPI=true
172 shift
174 -python)
175 withPYTHON=true
176 shift
178 -mesa)
179 withMESA=true
180 shift
182 -qt)
183 withQTSUPPORT=true
184 shift
186 -verbose)
187 withVERBOSE=true
188 shift
190 -version)
191 [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
192 export ParaView_VERSION=$2
193 shift 2
196 usage "unknown option/argument: '$*'"
198 esac
199 done
202 # Set configure options
203 #~~~~~~~~~~~~~~~~~~~~~~
204 addVerbosity # verbose makefiles
205 addMpiSupport # set MPI-specific options
206 addPythonSupport # set Python-specific options
207 addMesaSupport # set MESA-specific options
208 addQtSupport # add extra Qt support
210 getPaths # discover where things are or should be put
213 # Build and install
214 # ~~~~~~~~~~~~~~~~~
215 [ $runCONFIG = true ] && configParaView
216 [ $runMAKE = true ] && makeParaView
217 [ $runMAKEDOC = true ] && makeDocs
218 [ $runINSTALL = true ] && installParaView
219 [ $runENVPATH = true ] && fixCMakeFiles
221 echo "done"
222 #------------------------------------------------------------------------------