/[escript]/branches/doubleplusgood/doc/install/srclinux.tex
ViewVC logotype

Contents of /branches/doubleplusgood/doc/install/srclinux.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2568 - (show annotations)
Fri Jul 31 05:37:41 2009 UTC (9 years, 8 months ago) by jfenwick
Original Path: trunk/doc/install/srclinux.tex
File MIME type: application/x-tex
File size: 10371 byte(s)
Updated install guide to include the correct version of python.
Updated Mac build instructions not to use numarray or frameworks.
Removed (commented out) references to MacPorts in the Mac instructions.
- These need to be updated and Artak isn't here.

Removed (commented out) references to windows in the install guide.
CSIRO won't have a windows release ready yet. 


1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Copyright (c) 2003-2009 by University of Queensland
4 % Earth Systems Science Computational Center (ESSCC)
5 % http://www.uq.edu.au/esscc
6 %
7 % Primary Business: Queensland, Australia
8 % Licensed under the Open Software License version 3.0
9 % http://www.opensource.org/licenses/osl-3.0.php
10 %
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12
13 \section{Installing from source for \linux}
14 \label{sec:srclinux}
15
16 \subsection{Preliminaries}
17
18 The following instructions assume you are running the \filename{bash} shell.
19 Comments are indicated with \# characters.
20
21 Make sure you have the following installed:
22 \begin{itemize}
23 \item \filename{g++} and associated tools.
24 \item \filename{make}
25 % I suspect that these are only needed by VTK and if we aren't using it anymore they could be removed
26 % \item \filename{libXext.so}\footnote{In Debian this is in the libXext-dev package.}
27 % \item \filename{libxt.so}\footnote{In Debian this is in the libxt-dev package.}
28 \end{itemize}
29
30 You will also need a copy of the \esfinley source code.
31 If you retrieved the source using subversion, don't forget that one can use the export command instead of checkout to get a smaller copy.
32 For additional visualization functionality see \Sec{sec:addfunc}.
33
34 These instructions will produce the following directory structure:
35 \begin{itemize}
36 \item[] \filename{stand} \begin{itemize}
37 \item[] \filename{escript.d}
38 \item[] \filename{pkg}
39 \item[] \filename{pkg_src}
40 \item[] \filename{build}
41 \item[] \filename{doc}
42 \end{itemize}
43 \end{itemize}
44
45 Before you start copy the \esfinley source into the \filename{escript.d} directory.
46 The following instructions refer to software versions in the \filename{escript-support-3-src} bundle.
47 If you download your own versions of those packages substitute their version numbers and names as appropriate.
48 There are a number of uses of the \filename{make} command in the following instructions.
49 If your computer has multiple cores/processors you can speed up the compilation process by adding -j 2 after the make command.
50 For example to use all processors on a computer with 4 cores:
51 \begin{shellCode}
52 make
53 \end{shellCode}
54 becomes
55 \begin{shellCode}
56 make -j 4
57 \end{shellCode}
58
59 \begin{shellCode}
60 mkdir stand
61 cd stand
62 mkdir build doc pkg pkg_src
63 export PKG_ROOT=$(pwd)/pkg
64 \end{shellCode}
65
66 \subsection{Building the dependencies}
67
68 Copy the compressed sources for the packages into \filename{stand/pkg_src}.
69 If you are using the support bundles, decompress them in the stand directory:
70 \begin{shellCode}
71 tar -xjf escript-support-3-src.tar.bz2
72 \end{shellCode}
73
74 Copy documentation files into \filename{doc} then unpack the archives:
75
76 \begin{shellCode}
77 cd build
78 tar -jxf ../pkg_src/Python-2.6.2.tar.bz2
79 tar -jxf ../pkg_src/boost_1_39_0.tar.bz2
80 tar -zxf ../pkg_src/scons-1.2.0.tar.gz
81 tar -zxf ../pkg_src/numpy-1.3.0.tar.gz
82 tar -zxf ../pkg_src/netcdf-4.0.tar.gz
83 tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz
84 \end{shellCode}
85
86 \begin{itemize}
87
88 \item Build Python:
89 \begin{shellCode}
90 cd Python*
91 ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \
92 | tee tt.configure.out
93 make
94 make install 2>&1 | tee tt.make.out
95
96 cd ..
97
98 export PATH=$PKG_ROOT/python/bin:$PATH
99 export PYTHONHOME=$PKG_ROOT/python
100 export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH
101
102 pushd ../pkg
103 ln -s python-2.6.2/ python
104 popd
105 \end{shellCode}
106
107 Run the new python executable to make sure it works.
108
109 \item Now build NumPy:
110 \begin{shellCode}
111 cd numpy-1.3.0
112 python setup.py build
113 python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
114 cd ..
115 pushd ../pkg
116 ln -s numpy-1.3.0 numpy
117 popd
118 export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
119 \end{shellCode}
120
121 % \begin{shellCode}
122 % cd numarray-1.5.2
123 %
124 % python setup.py install \
125 % --gencode --install-lib=$PKG_ROOT/numarray-1.5.2/lib \
126 % --install-headers=$PKG_ROOT=$PKG_ROOT/numarray-1.5.2/include/numarray \
127 % 2>&1 | tee tt.install.out
128 %
129 %
130 % export PYTHONPATH=$PKG_ROOT/numarray/lib:$PYTHONPATH
131 % cd ..
132 % pushd ../pkg
133 % ln -s numarray-1.5.2 numarray
134 % popd
135 % \end{shellCode}
136
137 \item Next build scons:
138 \begin{shellCode}
139 cd scons-1.2.0
140 python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
141
142 export PATH=$PKG_ROOT/scons/bin:$PATH
143 cd ..
144 pushd ../pkg
145 ln -s scons-1.2.0 scons
146 popd
147 \end{shellCode}
148
149 \item The Boost libraries...:
150 \begin{shellCode}
151 pushd ../pkg
152 mkdir boost_1_39_0
153 ln -s boost_1_39_0 boost
154 popd
155 cd boost_1_39_0
156 ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost
157 ./bjam
158 ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
159 export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
160 cd ..
161 pushd ../pkg/boost/lib/
162 ln *.so.* libboost_python.so
163 popd
164 \end{shellCode}
165
166 \item ...and NetCDF:
167 \begin{shellCode}
168 cd netcdf-4.0
169 CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
170 FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
171 ./configure --prefix=$PKG_ROOT/netcdf-4.0
172
173 make
174 make install
175
176 export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
177 cd ..
178 pushd ../pkg
179 ln -s netcdf-4.0 netcdf
180 popd
181 \end{shellCode}
182
183 \item Finally matplotlib:
184 \begin{shellCode}
185 cd matplotlib-0.98.5.3
186 python setup.py build
187 python setup.py install --prefix=$PKG_ROOT/matplotlib-0.98.5.3
188 cd ..
189 pushd ../pkg
190 ln -s matplotlib-0.98.5.3 matplotlib
191 popd
192 cd ..
193 \end{shellCode}
194
195 \end{itemize}
196
197 % \subsection{VTK support}
198 % VTK is only required for pyvisi. To build it you need CMake and Mesa.
199 % The packages can be downloaded independently or in the \filename{escript-support-visi-3-src}.
200 % If you will not be using pyvisi, then skip to \Sec{sec:compileescriptlinux}
201 %
202 % Copy the compressed sources for the packages into \filename{stand/pkg_src}.
203 % If you are using the support bundles, decompress them in the stand directory.
204 % \begin{shellCode}
205 % tar -xjf escript-support-visi-3-src.tar.bz2
206 % \end{shellCode}
207 %
208 % \begin{shellCode}
209 % cd build
210 % tar -jxf ../pkg_src/MesaLib-7.2.tar.bz2
211 % tar -zxf ../pkg_src/vtk-5.2.1.tar.gz
212 % tar -zxf ../pkg_src/vtkdata-5.2.1.tar.gz
213 % tar -zxf ../pkg_src/cmake-2.6.3.tar.gz
214 % \end{shellCode}
215 %
216 % \begin{itemize}
217 %
218 % \item Build CMake:
219 % \begin{shellCode}
220 % cd cmake-2.6.3
221 % ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
222 % make
223 % make install
224 %
225 % export PATH=$PKG_ROOT/cmake/bin:$PATH
226 % cd ..
227 % pushd ../pkg
228 % ln -s cmake-2.6.3 cmake
229 % popd
230 % \end{shellCode}
231 %
232 % \item Build Mesa:
233 % \begin{shellCode}
234 % cd Mesa-7.2
235 % ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa --with-driver=xlib
236 %
237 % make
238 % make install
239 %
240 % export LD_LIBRARY_PATH=$PKG_ROOT/mesa/lib:$LD_LIBRARY_PATH
241 % cd ..
242 % pushd ../pkg
243 % ln -s mesa-7.2 mesa
244 % popd
245 % \end{shellCode}
246 % These instructions do not compile MesaDemos or GLUT.
247 % If you need to check if Mesa compiled correctly, then the demos are a good test.
248 %
249 % \item Finally, build VTK:
250 % \begin{shellCode}
251 % cd VTK
252 % cmake .
253 % \end{shellCode}
254 %
255 % Now edit the \filename{CMakeCache.txt} file and make the following changes.
256 % Where .... appears please replace it with the absolute path to the pkg directory.
257 % For example, replace \filename{CMAKE_INSTALL_PREFIX:PATH=..../vtk-5.2.1} with
258 % \filename{CMAKE_INSTALL_PREFIX:PATH=/home/bob/stand/pkg/vtk-5.2.1}
259 % (Search for the text before the =).
260 % \begin{shellCode}
261 % BUILD_EXAMPLES:BOOL=OFF
262 % BUILD_SHARED_LIBS:BOOL=ON
263 % CMAKE_INSTALL_PREFIX:PATH=..../vtk-5.2.1
264 % CMAKE_VERBOSE_MAKEFILE:BOOL=TRUE
265 % VTK_OPENGL_HAS_OSMESA:BOOL=TRUE
266 % VTK_USE_64BIT_IDS:BOOL=ON
267 % VTK_WRAP_PYTHON:BOOL=ON
268 % VTK_USE_MANGLED_MESA:BOOL=OFF
269 % \end{shellCode}
270 %
271 % Now rerun cmake (it won't work but it adds some variables you need).
272 %
273 % \begin{shellCode}
274 % cmake .
275 % \end{shellCode}
276 %
277 % Edit \filename{CMakeCache.txt} and change the following variables:
278 %
279 % \begin{shellCode}
280 % VTK_USE_OFFSCREEN:BOOL=ON
281 % VTK_USE_TK:BOOL=OFF
282 % OSMESA_INCLUDE_DIR:PATH=..../mesa/include
283 % OSMESA_LIBRARY:FILEPATH=..../mesa/lib/libOSMesa.so
284 % PYTHON_INCLUDE_PATH:PATH=..../python/include/python2.6
285 % PYTHON_LIBRARY:FILEPATH=..../python/lib/libpython2.6.so
286 % OPENGL_INCLUDE_DIR:PATH=..../mesa/include
287 % OPENGL_gl_LIBRARY:FILEPATH=..../mesa/lib/libGL.so
288 % \end{shellCode}
289 %
290 % The following steps will take a while so grab a coffee while it compiles.
291 % \begin{shellCode}
292 % cmake .
293 % make
294 % chmod +w Utilities/vtktiff/tif_fax3sm.c
295 % make install
296 %
297 % cd ../../pkg
298 % ln -s vtk-5.2.1 vtk
299 % cd ..
300 % \end{shellCode}
301 %
302 % \end{itemize}
303
304 \subsection{Compiling escript}\label{sec:compileescriptlinux}
305
306 Change to the directory containing your escript source (\filename{stand/escript.d}), then:
307
308 \begin{shellCode}
309 cd escript.d/scons
310 cp linux_standalone_options_example.py YourMachineName_options.py
311
312 echo $PKG_ROOT
313 \end{shellCode}
314
315 Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
316 For example:
317 \begin{shellCode}
318 PKG_ROOT="/home/bob/stand/pkg"
319 \end{shellCode}
320
321 \begin{shellCode}
322 cd ../bin
323 \end{shellCode}
324
325 Modify the STANDALONE line of \filename{escript} to read:
326
327 STANDALONE=1
328
329 Start a new terminal and go to the \filename{stand} directory.
330
331 \begin{shellCode}
332 export PATH=$(pwd)/pkg/scons/bin:$PATH
333 cd escript.d
334 eval $(bin/escript -e)
335 scons
336 \end{shellCode}
337
338 If you wish to test your build, then you can do the following.
339 Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
340 \begin{shellCode}
341 scons all_tests
342 \end{shellCode}
343
344 \subsection{Cleaning up}
345 Once you are satisfied, the \filename{escript.d/build} and \filename{\$PKG_ROOT/build} directories can be removed.
346
347 If you \emph{really} want to save space and do not wish to be able to edit or recompile \esfinley, you can remove the following:
348 \begin{itemize}
349 \item From the \filename{escript.d} directory:\begin{itemize}
350 \item Everything except: \filename{bin}, \filename{include}, \filename{lib}, \filename{esys},
351 \filename{README_LICENSE}.
352 \item Hidden files, which can be removed using
353 \begin{shellCode}
354 find . -name .?* | xargs rm -rf
355 \end{shellCode}
356 in the \filename{escript.d} directory.
357 \end{itemize}
358 \item from the \filename{pkg} directory:
359 \begin{itemize}
360 \item \filename{scons}, \filename{scons-1.2.0}, \filename{cmake-2.6.3} and \filename{cmake}
361 \end{itemize}
362 \item \filename{package\_src}\footnote{Do not remove this if you intend to redistribute.}.
363 \end{itemize}
364
365 Please note that removing all these files may make it more difficult for us to diagnose problems.
366
367

  ViewVC Help
Powered by ViewVC 1.1.26