Upgraded the ParaView build scripts to version 3.3-cvs.
[OpenFOAM-1.5.x.git] / bin / tools / buildParaView3.3
blob88b86a91adf3ad2c5b264fa9f82fd39f56be5c9d
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 # buildParaView3.3-cvs
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 . ./buildParaViewFunctions
37 PARAVIEW_SRC=ParaView3.3-cvs
38 PARAVIEW_MAJOR_VERSION=3.3
40 # User options:
41 # ~~~~~~~~~~~~~
43 # MPI support:
44 WITH_MPI=OFF
45 MPI_MAX_PROCS=32
47 # Python support:
48 # note: script will try to determine the appropriate python library.
49 # If it fails, specify the path using the PYTHON_LIBRARY variable
50 WITH_PYTHON=OFF
51 PYTHON_LIBRARY=""
52 # PYTHON_LIBRARY="/usr/lib64/libpython2.5.so.1.0"
54 # MESA graphics support:
55 WITH_MESA=OFF
58 # No further editing below this line
59 #------------------------------------------------------------------------------
60 Script=${0##*/}
62 usage() {
63 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
64 cat<<USAGE
66 usage: ${0##*/} [OPTION]
67 options:
68 -fast for repeated builds (-make -install) *use with caution*
69 -mpi with mpi (if not already enabled)
70 -python with python (if not already enabled)
71 -mesa with mesa (if not already enabled)
72 -verbose verbose output in Makefiles
73 -help
75 For finer control, the build stages can be also selected individually
76 (mutually exclusive)
77 -config
78 -make
79 -makedoc
80 -install
81 [-envpath] alter absolute paths in CMake files to use env variables
83 Build and install $PARAVIEW_SRC
84 - run from folder above the ParaView source folder or place the
85 ParaView source under \$WM_THIRD_PARTY_DIR
87 USAGE
88 exit 1
91 # add options based on script name:
92 case "$Script" in *-mpi*) WITH_MPI=ON;; esac
93 case "$Script" in *-python*) WITH_PYTHON=ON;; esac
94 case "$Script" in *-mesa*) WITH_MESA=ON;; esac
96 runCONFIG=true
97 runMAKE=true
98 runMAKEDOC=true
99 runINSTALL=true
100 runENVPATH=false
102 # parse options
103 while [ "$#" -gt 0 ]
105 case "$1" in
106 -h | -help)
107 usage
109 -config) # stage 1: config only
110 runCONFIG=true
111 runMAKE=false
112 runMAKEDOC=false
113 runINSTALL=false
114 shift
116 -make) # stage 2: make only
117 runCONFIG=false
118 runMAKE=true
119 runMAKEDOC=false
120 runINSTALL=false
121 shift
123 -makedoc) # stage 3: generate html documentation
124 runCONFIG=false
125 runMAKE=false
126 runMAKEDOC=true
127 runINSTALL=false
128 shift
130 -install) # stage 4: install only
131 runCONFIG=false
132 runMAKE=false
133 runMAKEDOC=false
134 runINSTALL=true
135 shift
137 -envpath) # optional: change cmake files to use env variables
138 runCONFIG=false
139 runMAKE=false
140 runMAKEDOC=false
141 runINSTALL=false
142 runENVPATH=true
143 shift
145 -fast) # shortcut for rebuild
146 runCONFIG=false
147 runMAKE=true
148 runMAKEDOC=false
149 runINSTALL=true
150 shift
152 -mpi)
153 WITH_MPI=ON
154 shift
156 -python)
157 WITH_PYTHON=ON
158 shift
160 -mesa)
161 WITH_MESA=ON
162 shift
164 -verbose)
165 VERBOSE=ON
166 shift
169 usage "unknown option/argument: '$*'"
171 esac
172 done
174 # Set configure options
175 #~~~~~~~~~~~~~~~~~~~~~~
176 addVerbosity # verbose makefiles
177 addMpiSupport # set MPI-specific options
178 addPythonSupport # set Python-specific options
179 addMesaSupport # set MESA-specific options
181 getPaths # discover where things are or should be put
183 # Build and install
184 # ~~~~~~~~~~~~~~~~~
185 [ $runCONFIG = true ] && configParaView
186 [ $runMAKE = true ] && makeParaView
187 [ $runENVPATH = true ] && fixCMakeFiles
188 [ $runMAKEDOC = true ] && makeDocs
189 [ $runINSTALL = true ] && installParaView
191 echo "done"
192 #------------------------------------------------------------------------------