/[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 2455 - (show annotations)
Wed Jun 3 03:29:07 2009 UTC (9 years, 10 months ago) by jfenwick
Original Path: trunk/doc/install/srclinux.tex
File MIME type: application/x-tex
File size: 9011 byte(s)
Merging changes from numpy branch.

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/numarray-1.5.2.tar.gz
64 tar -zxf ../package_src/cmake-2.6.3.tar.gz
65 tar -zxf ../package_src/scons-1.2.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 numarray.
89
90 \begin{shellCode}
91 cd numarray-1.5.2
92
93 python setup.py install \
94 --gencode --install-lib=$PKG_ROOT/numarray-1.5.2/lib \
95 --install-headers=$PKG_ROOT=$PKG_ROOT/numarray-1.5.2/include/numarray \
96 2>&1 | tee tt.install.out
97
98
99 export PYTHONPATH=$PKG_ROOT/numarray/lib:$PYTHONPATH
100 cd ..
101 pushd ../packages
102 ln -s numarray-1.5.2 numarray
103 popd
104 \end{shellCode}
105
106 Now we build scons.
107 \begin{shellCode}
108 cd scons-1.2.0
109 python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
110
111 export PATH=$PKG_ROOT/scons/bin:$PATH
112 cd ..
113 pushd ../packages
114 ln -s scons-1.2.0 scons
115 popd
116 \end{shellCode}
117
118 ...Boost libraries ...
119 \begin{shellCode}
120 cd boost_1_37_0
121
122 ./configure --prefix=$PKG_ROOT/boost_1_37_0 --with-python-root=$PKG_ROOT/python \
123 --with-python-version=2.6 --with-libraries=python
124
125 make
126 make install
127 ln -s $PKG_ROOT/boost_1_37_0 $PKG_ROOT/boost
128 export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
129 cd ..
130 pushd ../packages
131 ln -s boost_1_37_0 boost
132 popd
133 \end{shellCode}
134
135 ... and netcdf.
136 \begin{shellCode}
137 cd netcdf-4.0
138 CFLAGS="-O2 fPIC -Df2cFortran" CXXFLAGS="-O2 fPIC -Df2cFortran" \
139 FFLAGS="-O2 fPIC -Df2cFortran" FCFLAGS="-O2 fPIC -Df2cFortran" \
140 ./configure --prefix=$PKG_ROOT/netcdf-4.0
141
142 make -j2
143 make install
144
145 export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
146 cd ..
147 pushd ../packages
148 ln -s netcdf-4.0 netcdf
149 popd
150 \end{shellCode}
151
152 CMake and Mesa are required for VTK.
153 \begin{shellCode}
154 cd cmake-2.6.3
155 ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
156 make -j 4
157 make install
158
159 export PATH=$PKG_ROOT/cmake/bin:$PATH
160 cd ..
161 pushd ../packages
162 ln -s cmake-2.6.3 cmake
163 popd
164 \end{shellCode}
165
166 These instructions do not compile MesaDemos or GLUT.
167 If you need to check if Mesa compiled correctly, then the demos are a good test.
168 \begin{shellCode}
169 cd Mesa-7.2
170 ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa --with-driver=xlib
171
172 make -j 4
173 make install
174
175 export LD_LIBRARY_PATH=$PKG_ROOT/mesa:$LD_LIBRARY_PATH
176 cd ..
177 pushd ../packages
178 ln -s mesa-7.2 mesa
179 popd
180 \end{shellCode}
181
182 \begin{shellCode}
183 cd VTK
184 cmake .
185
186 #Edit the CMakeCache and make the following changes:
187 #(Please replace .... with an absolute path to the stand directory)
188
189 #-----------------
190
191 BUILD_EXAMPLES should be OFF
192 BUILD_SHARED_LIBS should be ON
193
194 CMAKE_INSTALL_PREFIX ..../stand/packages/vtk-5.2.1
195 CMAKE_VERBOSE_MAKEFILE TRUE
196
197 #check PYTHON_EXECUTABLE is correct.
198 #but it seems to be when I went through these steps
199
200 VTK_OPENGL_HAS_OSMESA TRUE
201 VTK_USE_64BIT_IDS ON
202 # That last one is marked as "May cause some bugs" in the original instructions
203
204 VTK_WRAP_PYTHON ON
205 VTK_USE_MANGLED_MESA OFF
206
207 #--------------------
208
209 cmake .
210 #It won't work but it will put some variables in that you need.
211
212 #Edit CMakeCache again and make the following changes
213
214 #----------------
215
216 VTK_USE_TK OFF
217
218 OSMESA_INCLUDE_DIR ..../stand/packages/mesa/include
219
220 OSMESA_LIBRARY ..../stand/packages/mesa/lib/libOSMesa.so
221
222 PYTHON_INCLUDE_PATH ..../stand/packages/python/include/python2.6
223
224 PYTHON_LIBRARY ..../stand/packages/python/lib/libpython2.6.so
225
226 OPENGL_INCLUDE_DIR ..../stand/packages/mesa/include
227
228 OPENGL_gl_LIBRARY ..../stand/packages/mesa/lib/libGL.so
229
230 #----------------
231
232 cmake .
233
234 chmod +w Utilities/vtktiff/tif_fax3sm.c
235
236 make
237 make install
238
239
240 cd ../../packages
241 ln -s vtk-5.2.1 vtk
242 cd ..
243 \end{shellCode}
244
245 Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.
246
247 \subsection{Compiling escript}\label{sec:compileescriptlinux}
248
249 Change to the directory containing your escript source (\filename{escript.d}), then:
250
251 \begin{shellCode}
252 cd scons
253 cp linux_options_example.py YourMachineName_options.py
254
255 #edit the options file and make the following changes:
256 #-----------------------------------------------------------------
257 declare a PKG_ROOT variable at the top of the file eg:
258 PKG_ROOT='/home/jfenwick/stand/packages'
259
260 python_path = PKG_ROOT+'python/include/python2.6'
261 python_lib_path = PKG_ROOT+'python/lib'
262 python_libs = 'python2.6'
263
264 boost_path = PKG_ROOT+'boost/include/boost-1_37'
265 boost_lib_path = PKG_ROOT+'boost/lib'
266 boost_libs = ['boost_python-gcc43-mt']
267 # You could simlink the boost python library to give a shorter
268 # name but it's not worth it
269
270 usevtk = 'yes'
271 #-------------------------------------------------------------------
272
273 ln -s $PKG_ROOT/vtk-5.2.1 $PKG_ROOT/vtk
274
275 Modify bin/escript
276
277 STANDALONE=1
278
279 #Check to make sure the paths in the if [ $STANDALONE == 1 ]
280 #block are correct
281
282 #-----------------------------------------------------------------
283
284 #start a new terminal
285 cd stand
286 export PATH=`pwd`/packages/scons/bin:$PATH
287 cd escript.d
288 eval `bin/escript -e`
289 scons
290 \end{shellCode}
291
292 If you wish to test your build, then you can do the following.
293 Note this may take a while if you have a slow processor and/or less than 1Gb of RAM.
294 \begin{shellCode}
295 scons all_tests
296 \end{shellCode}
297
298 \subsection{Cleaning up}
299 Once you are satisfied, the \filename{escript.d/build} and \filename{\$PKG_ROOT/build} directories can be removed.
300
301 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:
302 \begin{itemize}
303 \item From the \filename{escript.d} directory:\begin{itemize}
304 \item Everything except: \filename{bin}, \filename{include}, \filename{lib}, \filename{esys},
305 \filename{README_LICENSE}.
306 \item Hidden files, which can be removed using
307 \begin{shellCode}
308 find . -name .?* | xargs rm -rf
309 \end{shellCode}
310 in the \filename{escript.d} directory.
311 \end{itemize}
312 \item from the \filename{packages} directory:
313 \begin{itemize}
314 \item \filename{scons}, \filename{scons-1.2.0}, \filename{cmake-2.6.3} and \filename{cmake}
315 \end{itemize}
316 \item \filename{package\_src}\footnote{Do not remove this if you intend to redistribute.}.
317 \end{itemize}
318
319 Please note that removing all these files may make it more difficult for us to diagnose problems.
320
321
322
323
324 \section{Additional Functionality}\label{sec:linaddfunc}
325 To perform visualisations you will need some additional tools.
326 Since these do not need to be linked with any of the packages above, you can install versions available for your
327 system, or build them from source.
328 \begin{itemize}
329 \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite. - To build from source
330 you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.
331 \item A tool to visualise VTK files. For example Mayavi or Visit.
332 \end{itemize}

  ViewVC Help
Powered by ViewVC 1.1.26