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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2568 - (hide 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 jfenwick 2289 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2     %
3 jfenwick 2548 % Copyright (c) 2003-2009 by University of Queensland
4 jfenwick 2289 % 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 jfenwick 2317 \label{sec:srclinux}
15 caltinay 2536
16     \subsection{Preliminaries}
17    
18 jfenwick 2317 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 caltinay 2536 \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 jfenwick 2568 % \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 jfenwick 2317 \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 caltinay 2547 For additional visualization functionality see \Sec{sec:addfunc}.
33 jfenwick 2317
34 caltinay 2536 These instructions will produce the following directory structure:
35 jfenwick 2317 \begin{itemize}
36 caltinay 2536 \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 jfenwick 2317 \end{itemize}
44    
45 caltinay 2536 Before you start copy the \esfinley source into the \filename{escript.d} directory.
46 jfenwick 2568 The following instructions refer to software versions in the \filename{escript-support-3-src} bundle.
47 caltinay 2536 If you download your own versions of those packages substitute their version numbers and names as appropriate.
48 jfenwick 2529 There are a number of uses of the \filename{make} command in the following instructions.
49 caltinay 2536 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 jfenwick 2317 \begin{shellCode}
52 jfenwick 2529 make
53     \end{shellCode}
54 caltinay 2536 becomes
55 jfenwick 2529 \begin{shellCode}
56     make -j 4
57     \end{shellCode}
58    
59     \begin{shellCode}
60 jfenwick 2317 mkdir stand
61     cd stand
62 caltinay 2536 mkdir build doc pkg pkg_src
63 jfenwick 2529 export PKG_ROOT=$(pwd)/pkg
64 jfenwick 2317 \end{shellCode}
65    
66 caltinay 2536 \subsection{Building the dependencies}
67    
68 jfenwick 2529 Copy the compressed sources for the packages into \filename{stand/pkg_src}.
69 caltinay 2536 If you are using the support bundles, decompress them in the stand directory:
70 jfenwick 2529 \begin{shellCode}
71     tar -xjf escript-support-3-src.tar.bz2
72     \end{shellCode}
73    
74 caltinay 2536 Copy documentation files into \filename{doc} then unpack the archives:
75 jfenwick 2317
76     \begin{shellCode}
77     cd build
78 jfenwick 2568 tar -jxf ../pkg_src/Python-2.6.2.tar.bz2
79 jfenwick 2529 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 jfenwick 2317 \end{shellCode}
85    
86 caltinay 2536 \begin{itemize}
87    
88     \item Build Python:
89 jfenwick 2317 \begin{shellCode}
90     cd Python*
91 jfenwick 2568 ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \
92 jfenwick 2317 | tee tt.configure.out
93 jfenwick 2568 make
94 jfenwick 2317 make install 2>&1 | tee tt.make.out
95    
96     cd ..
97    
98 artak 2328 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 jfenwick 2317
102 jfenwick 2529 pushd ../pkg
103 jfenwick 2568 ln -s python-2.6.2/ python
104 jfenwick 2317 popd
105     \end{shellCode}
106    
107 caltinay 2536 Run the new python executable to make sure it works.
108 jfenwick 2317
109 caltinay 2536 \item Now build NumPy:
110 jfenwick 2317 \begin{shellCode}
111 jfenwick 2462 cd numpy-1.3.0
112     python setup.py build
113     python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
114 jfenwick 2317 cd ..
115 jfenwick 2529 pushd ../pkg
116 jfenwick 2462 ln -s numpy-1.3.0 numpy
117 jfenwick 2317 popd
118 jfenwick 2462 export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
119 jfenwick 2317 \end{shellCode}
120    
121 jfenwick 2462 % \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 jfenwick 2529 % pushd ../pkg
133 jfenwick 2462 % ln -s numarray-1.5.2 numarray
134     % popd
135     % \end{shellCode}
136    
137 caltinay 2536 \item Next build scons:
138 jfenwick 2317 \begin{shellCode}
139     cd scons-1.2.0
140 artak 2328 python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
141 jfenwick 2317
142 artak 2328 export PATH=$PKG_ROOT/scons/bin:$PATH
143 jfenwick 2317 cd ..
144 jfenwick 2529 pushd ../pkg
145 jfenwick 2317 ln -s scons-1.2.0 scons
146     popd
147     \end{shellCode}
148    
149 caltinay 2536 \item The Boost libraries...:
150 jfenwick 2317 \begin{shellCode}
151 jfenwick 2529 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 caltinay 2536 ./bjam
158 jfenwick 2529 ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
159 artak 2328 export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
160 jfenwick 2317 cd ..
161 jfenwick 2529 pushd ../pkg/boost/lib/
162     ln *.so.* libboost_python.so
163 jfenwick 2317 popd
164     \end{shellCode}
165    
166 caltinay 2536 \item ...and NetCDF:
167 jfenwick 2317 \begin{shellCode}
168     cd netcdf-4.0
169 jfenwick 2462 CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
170     FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
171 artak 2328 ./configure --prefix=$PKG_ROOT/netcdf-4.0
172 jfenwick 2317
173 jfenwick 2529 make
174 jfenwick 2317 make install
175    
176 artak 2328 export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
177 jfenwick 2317 cd ..
178 jfenwick 2529 pushd ../pkg
179 jfenwick 2317 ln -s netcdf-4.0 netcdf
180     popd
181     \end{shellCode}
182    
183 caltinay 2536 \item Finally matplotlib:
184 jfenwick 2529 \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 caltinay 2536 \end{itemize}
196    
197 jfenwick 2568 % \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 jfenwick 2529
304 jfenwick 2324 \subsection{Compiling escript}\label{sec:compileescriptlinux}
305    
306 jfenwick 2568 Change to the directory containing your escript source (\filename{stand/escript.d}), then:
307 jfenwick 2324
308 jfenwick 2317 \begin{shellCode}
309 jfenwick 2529 cd escript.d/scons
310 jfenwick 2568 cp linux_standalone_options_example.py YourMachineName_options.py
311 jfenwick 2317
312 jfenwick 2529 echo $PKG_ROOT
313     \end{shellCode}
314 jfenwick 2317
315 caltinay 2536 Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
316 jfenwick 2529 For example:
317     \begin{shellCode}
318     PKG_ROOT="/home/bob/stand/pkg"
319     \end{shellCode}
320 jfenwick 2317
321 jfenwick 2529 \begin{shellCode}
322     cd ../bin
323     \end{shellCode}
324 jfenwick 2317
325 caltinay 2536 Modify the STANDALONE line of \filename{escript} to read:
326 jfenwick 2529
327 jfenwick 2317 STANDALONE=1
328    
329 jfenwick 2529 Start a new terminal and go to the \filename{stand} directory.
330 jfenwick 2317
331 jfenwick 2529 \begin{shellCode}
332     export PATH=$(pwd)/pkg/scons/bin:$PATH
333 jfenwick 2317 cd escript.d
334 jfenwick 2462 eval $(bin/escript -e)
335 jfenwick 2317 scons
336     \end{shellCode}
337    
338     If you wish to test your build, then you can do the following.
339 caltinay 2536 Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
340 jfenwick 2317 \begin{shellCode}
341     scons all_tests
342     \end{shellCode}
343    
344 jfenwick 2324 \subsection{Cleaning up}
345     Once you are satisfied, the \filename{escript.d/build} and \filename{\$PKG_ROOT/build} directories can be removed.
346 jfenwick 2317
347 caltinay 2536 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 jfenwick 2317 \begin{itemize}
349 jfenwick 2324 \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 jfenwick 2317 \begin{shellCode}
354     find . -name .?* | xargs rm -rf
355     \end{shellCode}
356 jfenwick 2324 in the \filename{escript.d} directory.
357     \end{itemize}
358 jfenwick 2529 \item from the \filename{pkg} directory:
359 jfenwick 2324 \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 jfenwick 2317
365 jfenwick 2324 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