/[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 2462 - (show annotations)
Fri Jun 5 06:04:01 2009 UTC (9 years, 10 months ago) by jfenwick
Original Path: trunk/doc/install/srclinux.tex
File MIME type: application/x-tex
File size: 9324 byte(s)
Modified wrapper script to correctly point at numpy in standalone builds.
Updated build from source doco for linux to take numpy into account.
Also removed backticks in favour of $()  - it should be the same but latex won't eat them
1
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % Copyright (c) 2003-2008 by University of Queensland
5 % Earth Systems Science Computational Center (ESSCC)
6 % http://www.uq.edu.au/esscc
7 %
8 % Primary Business: Queensland, Australia
9 % Licensed under the Open Software License version 3.0
10 % http://www.opensource.org/licenses/osl-3.0.php
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 \section{Installing from source for \linux}
15 \label{sec:srclinux}
16 The following instructions assume you are running the \filename{bash} shell.
17 Comments are indicated with \# characters.
18
19 Make sure you have the following installed:
20 \begin{itemize}
21 \item \filename{g++} and associated tools.
22 \item \filename{make}
23 \item \filename{libXext.so}\footnote{In Debian this is in the libXext-dev package.}
24 \item \filename{libxt.so}\footnote{In Debian this is in the libxt-dev package.}
25 \end{itemize}
26
27 You will also need a copy of the \esfinley source code.
28 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.
29 For additional visualisation functionality see Section~\ref{sec:linaddfunc}.
30
31 These instructions will produce the following structure:
32 \begin{itemize}
33 \item \filename{stand}: \begin{itemize}
34 \item \filename{escript.d}
35 \item \filename{packages}
36 \item \filename{package_src}
37 \item \filename{build}
38 \item \filename{doc}
39 \end{itemize}
40 \end{itemize}
41
42 The build directory can be removed when you are finished.
43
44 \begin{shellCode}
45 mkdir stand
46 cd stand
47 export PKG_ROOT=$(pwd)/packages
48 \end{shellCode}
49
50 Copy compressed source bundles into \filename{stand/package_src}.
51 Copy documentation files into \filename{doc}.
52
53 \begin{shellCode}
54 mkdir packages
55 mkdir build
56 cd build
57 tar -jxf ../package_src/Python-2.6.1.tar.bz2
58 tar -jxf ../package_src/boost_1_37_0.tar.bz2
59 tar -jxf ../package_src/MesaLib-7.2.tar.bz2
60 tar -zxf ../package_src/netcdf-4.0.tar.gz
61 tar -zxf ../package_src/vtk-5.2.1.tar.gz
62 tar -zxf ../package_src/vtkdata-5.2.1.tar.gz
63 tar -zxf ../package_src/cmake-2.6.3.tar.gz
64 tar -zxf ../package_src/scons-1.2.0.tar.gz
65 tar -zxf ../package_src/numpy-1.3.0.tar.gz
66 \end{shellCode}
67
68 Build python.
69 \begin{shellCode}
70 cd Python*
71 ./configure --prefix=$PKG_ROOT/python-2.6.1 --enable-shared 2>&1 \
72 | tee tt.configure.out
73 make install 2>&1 | tee tt.make.out
74
75 cd ..
76
77 export PATH=$PKG_ROOT/python/bin:$PATH
78 export PYTHONHOME=$PKG_ROOT/python
79 export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH
80
81 pushd ../packages
82 ln -s python-2.6.1/ python
83 popd
84
85 \end{shellCode}
86
87 Run python to make sure it works.
88 Now build numpy.
89
90 \begin{shellCode}
91 cd numpy-1.3.0
92 python setup.py build
93 python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
94 cd ..
95 pushd ../packages
96 ln -s numpy-1.3.0 numpy
97 popd
98 export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
99 \end{shellCode}
100
101
102 % \begin{shellCode}
103 % cd numarray-1.5.2
104 %
105 % python setup.py install \
106 % --gencode --install-lib=$PKG_ROOT/numarray-1.5.2/lib \
107 % --install-headers=$PKG_ROOT=$PKG_ROOT/numarray-1.5.2/include/numarray \
108 % 2>&1 | tee tt.install.out
109 %
110 %
111 % export PYTHONPATH=$PKG_ROOT/numarray/lib:$PYTHONPATH
112 % cd ..
113 % pushd ../packages
114 % ln -s numarray-1.5.2 numarray
115 % popd
116 % \end{shellCode}
117
118 Now we build scons.
119 \begin{shellCode}
120 cd scons-1.2.0
121 python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
122
123 export PATH=$PKG_ROOT/scons/bin:$PATH
124 cd ..
125 pushd ../packages
126 ln -s scons-1.2.0 scons
127 popd
128 \end{shellCode}
129
130 ...Boost libraries ...
131 \begin{shellCode}
132 cd boost_1_37_0
133
134 ./configure --prefix=$PKG_ROOT/boost_1_37_0 --with-python-root=$PKG_ROOT/python \
135 --with-python-version=2.6 --with-libraries=python
136
137 make
138 make install
139 ln -s $PKG_ROOT/boost_1_37_0 $PKG_ROOT/boost
140 export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
141 cd ..
142 pushd ../packages
143 ln -s boost_1_37_0 boost
144 popd
145 \end{shellCode}
146
147 ... and netcdf.
148 \begin{shellCode}
149 cd netcdf-4.0
150 CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
151 FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
152 ./configure --prefix=$PKG_ROOT/netcdf-4.0
153
154 make -j2
155 make install
156
157 export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
158 cd ..
159 pushd ../packages
160 ln -s netcdf-4.0 netcdf
161 popd
162 \end{shellCode}
163
164 CMake and Mesa are required for VTK.
165 \begin{shellCode}
166 cd cmake-2.6.3
167 ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
168 make -j 4
169 make install
170
171 export PATH=$PKG_ROOT/cmake/bin:$PATH
172 cd ..
173 pushd ../packages
174 ln -s cmake-2.6.3 cmake
175 popd
176 \end{shellCode}
177
178 These instructions do not compile MesaDemos or GLUT.
179 If you need to check if Mesa compiled correctly, then the demos are a good test.
180 \begin{shellCode}
181 cd Mesa-7.2
182 ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa --with-driver=xlib
183
184 make -j 4
185 make install
186
187 export LD_LIBRARY_PATH=$PKG_ROOT/mesa:$LD_LIBRARY_PATH
188 cd ..
189 pushd ../packages
190 ln -s mesa-7.2 mesa
191 popd
192 \end{shellCode}
193
194 \begin{shellCode}
195 cd VTK
196 cmake .
197
198 #Edit the CMakeCache.txt file and make the following changes:
199 #(Please replace .... with an absolute path to the stand directory)
200
201 #-----------------
202
203 BUILD_EXAMPLES should be OFF
204 BUILD_SHARED_LIBS should be ON
205
206 CMAKE_INSTALL_PREFIX ..../stand/packages/vtk-5.2.1
207 CMAKE_VERBOSE_MAKEFILE TRUE
208
209 #check PYTHON_EXECUTABLE is correct.
210 #but it seems to be when I went through these steps
211
212 VTK_OPENGL_HAS_OSMESA TRUE
213 VTK_USE_64BIT_IDS ON
214 # That last one is marked as "May cause some bugs" in the original instructions
215
216 VTK_WRAP_PYTHON ON
217 VTK_USE_MANGLED_MESA OFF
218
219 #--------------------
220
221 cmake .
222 #It won't work but it will put some variables in that you need.
223
224 #Edit CMakeCache again and make the following changes
225
226 #----------------
227
228 VTK_USE_TK OFF
229
230 OSMESA_INCLUDE_DIR ..../stand/packages/mesa/include
231
232 OSMESA_LIBRARY ..../stand/packages/mesa/lib/libOSMesa.so
233
234 PYTHON_INCLUDE_PATH ..../stand/packages/python/include/python2.6
235
236 PYTHON_LIBRARY ..../stand/packages/python/lib/libpython2.6.so
237
238 OPENGL_INCLUDE_DIR ..../stand/packages/mesa/include
239
240 OPENGL_gl_LIBRARY ..../stand/packages/mesa/lib/libGL.so
241
242 #----------------
243
244 cmake .
245
246 chmod +w Utilities/vtktiff/tif_fax3sm.c
247
248 make
249 make install
250
251
252 cd ../../packages
253 ln -s vtk-5.2.1 vtk
254 cd ..
255 \end{shellCode}
256
257 Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.
258
259 \subsection{Compiling escript}\label{sec:compileescriptlinux}
260
261 Change to the directory containing your escript source (\filename{escript.d}), then:
262
263 \begin{shellCode}
264 cd scons
265 cp linux_options_example.py YourMachineName_options.py
266
267 #edit the options file and make the following changes:
268 #-----------------------------------------------------------------
269 declare a PKG_ROOT variable at the top of the file eg:
270 PKG_ROOT="/home/jfenwick/stand/packages"
271
272 python_path = PKG_ROOT+"python/include/python2.6"
273 python_lib_path = PKG_ROOT+"python/lib"
274 python_libs = "python2.6"
275
276 boost_path = PKG_ROOT+"boost/include/boost-1_37"
277 boost_lib_path = PKG_ROOT+"boost/lib"
278 boost_libs = ["boost_python-gcc43-mt"]
279 # You could simlink the boost python library to give a shorter
280 # name but it's not worth it
281
282 usevtk = "yes"
283 #-------------------------------------------------------------------
284
285 cd ..
286
287 #Modify bin/escript
288 #--------------------------------------------------
289 STANDALONE=1
290
291 #Check to make sure the paths in the if [ $STANDALONE == 1 ]
292 #block are correct
293
294 #-----------------------------------------------------------------
295
296 #start a new terminal
297 cd stand
298 export PATH=$(pwd)/packages/scons/bin:$PATH
299 cd escript.d
300 eval $(bin/escript -e)
301 scons
302 \end{shellCode}
303
304 If you wish to test your build, then you can do the following.
305 Note this may take a while if you have a slow processor and/or less than 1Gb of RAM.
306 \begin{shellCode}
307 scons all_tests
308 \end{shellCode}
309
310 \subsection{Cleaning up}
311 Once you are satisfied, the \filename{escript.d/build} and \filename{\$PKG_ROOT/build} directories can be removed.
312
313 If you \emph{really} want to save space and do not wish to be able to edit or recompile escript, you can remove the following:
314 \begin{itemize}
315 \item From the \filename{escript.d} directory:\begin{itemize}
316 \item Everything except: \filename{bin}, \filename{include}, \filename{lib}, \filename{esys},
317 \filename{README_LICENSE}.
318 \item Hidden files, which can be removed using
319 \begin{shellCode}
320 find . -name .?* | xargs rm -rf
321 \end{shellCode}
322 in the \filename{escript.d} directory.
323 \end{itemize}
324 \item from the \filename{packages} directory:
325 \begin{itemize}
326 \item \filename{scons}, \filename{scons-1.2.0}, \filename{cmake-2.6.3} and \filename{cmake}
327 \end{itemize}
328 \item \filename{package\_src}\footnote{Do not remove this if you intend to redistribute.}.
329 \end{itemize}
330
331 Please note that removing all these files may make it more difficult for us to diagnose problems.
332
333
334
335
336 \section{Additional Functionality}\label{sec:linaddfunc}
337 To perform visualisations you will need some additional tools.
338 Since these do not need to be linked with any of the packages above, you can install versions available for your
339 system, or build them from source.
340 \begin{itemize}
341 \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite. - To build from source
342 you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.
343 \item A tool to visualise VTK files. For example Mayavi or Visit.
344 \end{itemize}

  ViewVC Help
Powered by ViewVC 1.1.26