Changed buildParaView3.3 to a new buildParaView which builds the version of
[OpenFOAM-1.5.x.git] / bin / buildParaView
blobde0fe411507fbf6d3d275512c837d47ce704e9d4
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=/usr/local/Trolltech/Qt-4.3.4/bin/qmake
63 # No further editing below this line
64 #------------------------------------------------------------------------------
65 Script=${0##*/}
67 usage() {
68 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
69 cat<<USAGE
71 usage: $Script [OPTION]
72 options:
73 -rebuild for repeated builds (-make -install) *use with caution*
74 -mpi with mpi (if not already enabled)
75 -python with python (if not already enabled)
76 -mesa with mesa (if not already enabled)
77 -qt with extra Qt gui support (if not already enabled)
78 -verbose verbose output in Makefiles
79 -version VER specify an alternative version (default: $ParaView_VERSION)
80 -help
82 For finer control, the build stages can be also selected individually
83 (mutually exclusive)
84 -config
85 -make
86 -makedoc
87 -install
88 [-envpath] alter absolute paths in CMake files to use env variables
90 Build and install paraview-$ParaView_VERSION
91 - run from folder above the ParaView source folder or place the ParaView
92 source under \$WM_THIRD_PARTY_DIR ($WM_THIRD_PARTY_DIR)
94 USAGE
95 exit 1
98 #------------------------------------------------------------------------------
101 # add options based on script name:
103 case "$Script" in *-mpi*) withMPI=true;; esac
104 case "$Script" in *-python*) withPYTHON=true;; esac
105 case "$Script" in *-mesa*) withMESA=true;; esac
106 case "$Script" in *-qt*) withQTSUPPORT=true;; esac
109 # various building stages
111 runCONFIG=true
112 runMAKE=true
113 runMAKEDOC=true
114 runINSTALL=true
115 runENVPATH=false
118 # parse options
119 while [ "$#" -gt 0 ]
121 case "$1" in
122 -h | -help)
123 usage
125 -config) # stage 1: config only
126 runCONFIG=true
127 runMAKE=false
128 runMAKEDOC=false
129 runINSTALL=false
130 shift
132 -make) # stage 2: make only
133 runCONFIG=false
134 runMAKE=true
135 runMAKEDOC=false
136 runINSTALL=false
137 shift
139 -makedoc) # stage 3: generate html documentation
140 runCONFIG=false
141 runMAKE=false
142 runMAKEDOC=true
143 runINSTALL=false
144 shift
146 -install) # stage 4: install only
147 runCONFIG=false
148 runMAKE=false
149 runMAKEDOC=false
150 runINSTALL=true
151 shift
153 -envpath) # optional: change cmake files to use env variables
154 runCONFIG=false
155 runMAKE=false
156 runMAKEDOC=false
157 runINSTALL=false
158 runENVPATH=true
159 shift
161 -rebuild) # shortcut for rebuilding
162 runCONFIG=false
163 runMAKE=true
164 runMAKEDOC=false
165 runINSTALL=true
166 shift
168 -mpi)
169 withMPI=true
170 shift
172 -python)
173 withPYTHON=true
174 shift
176 -mesa)
177 withMESA=true
178 shift
180 -qt)
181 withQTSUPPORT=true
182 shift
184 -verbose)
185 withVERBOSE=true
186 shift
188 -version)
189 [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
190 export ParaView_VERSION=$2
191 shift 2
194 usage "unknown option/argument: '$*'"
196 esac
197 done
200 # Set configure options
201 #~~~~~~~~~~~~~~~~~~~~~~
202 addVerbosity # verbose makefiles
203 addMpiSupport # set MPI-specific options
204 addPythonSupport # set Python-specific options
205 addMesaSupport # set MESA-specific options
206 addQtSupport # add extra Qt support
208 getPaths # discover where things are or should be put
211 # Build and install
212 # ~~~~~~~~~~~~~~~~~
213 [ $runCONFIG = true ] && configParaView
214 [ $runMAKE = true ] && makeParaView
215 [ $runMAKEDOC = true ] && makeDocs
216 [ $runINSTALL = true ] && installParaView
217 [ $runENVPATH = true ] && fixCMakeFiles
219 echo "done"
220 #------------------------------------------------------------------------------