/[escript]/trunk/doc/install/srclinux.tex
ViewVC logotype

Diff of /trunk/doc/install/srclinux.tex

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2535 by jfenwick, Thu Jul 9 06:06:35 2009 UTC revision 2536 by caltinay, Thu Jul 16 23:53:07 2009 UTC
# Line 13  Line 13 
13    
14  \section{Installing from source for \linux}  \section{Installing from source for \linux}
15  \label{sec:srclinux}  \label{sec:srclinux}
16    
17    \subsection{Preliminaries}
18    
19  The following instructions assume you are running the \filename{bash} shell.  The following instructions assume you are running the \filename{bash} shell.
20  Comments are indicated with \# characters.  Comments are indicated with \# characters.
21    
22  Make sure you have the following installed:  Make sure you have the following installed:
23  \begin{itemize}  \begin{itemize}
24   \item \filename{g++} and associated tools.   \item \filename{g++} and associated tools.
25  \item \filename{make}   \item \filename{make}
26  % I suspect that these are only needed by VTK and if we aren't using it anymore they could be removed   % I suspect that these are only needed by VTK and if we aren't using it anymore they could be removed
27  \item \filename{libXext.so}\footnote{In Debian this is in the libXext-dev package.}   \item \filename{libXext.so}\footnote{In Debian this is in the libXext-dev package.}
28  \item \filename{libxt.so}\footnote{In Debian this is in the libxt-dev package.}   \item \filename{libxt.so}\footnote{In Debian this is in the libxt-dev package.}
29  \end{itemize}  \end{itemize}
30    
31  You will also need a copy of the \esfinley source code.  You will also need a copy of the \esfinley source code.
32  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.  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.
33  For additional visualisation functionality see Section~\ref{sec:linaddfunc}.  For additional visualisation functionality see Section~\ref{sec:linaddfunc}.
34    
35  These instructions will produce the following structure:  These instructions will produce the following directory structure:
36  \begin{itemize}  \begin{itemize}
37  \item \filename{stand}: \begin{itemize}   \item[] \filename{stand} \begin{itemize}
38   \item \filename{escript.d}    \item[] \filename{escript.d}
39  \item \filename{pkg}    \item[] \filename{pkg}
40  \item \filename{pkg_src}    \item[] \filename{pkg_src}
41  \item \filename{build}    \item[] \filename{build}
42  \item \filename{doc}    \item[] \filename{doc}
43    \end{itemize}   \end{itemize}
44  \end{itemize}  \end{itemize}
45    
46  The build directory can be removed when you are finished.  Before you start copy the \esfinley source into the \filename{escript.d} directory.
47    The following instructions refer to software versions in the \filename{escript-support-3-src} and \filename{escript-support-visi-3-src} bundles.
48  These instructions refer to versions of software in the \filename{escript-support-3-src} and \filename{escript-support-visi-3-src} bundles.  If you download your own versions of those packages substitute their version numbers and names as appropriate.
 If you download your own versions of those packages substitute their version numbers and names as appropriate  
49  There are a number of uses of the \filename{make} command in the following instructions.  There are a number of uses of the \filename{make} command in the following instructions.
50  If your computer has multiple cores/processors you can speed up the compilation process by adding -j 2 after the make command:  If your computer has multiple cores/processors you can speed up the compilation process by adding -j 2 after the make command.
51  on a computer with 4 cores:  For example to use all processors on a computer with 4 cores:
52  \begin{shellCode}  \begin{shellCode}
53   make   make
54  \end{shellCode}  \end{shellCode}
55  Becomes  becomes
56  \begin{shellCode}  \begin{shellCode}
57   make -j 4   make -j 4
58  \end{shellCode}  \end{shellCode}
# Line 58  Becomes Line 60  Becomes
60  \begin{shellCode}  \begin{shellCode}
61  mkdir stand  mkdir stand
62  cd stand  cd stand
63  mkdir pkg_src  mkdir build doc pkg pkg_src
 mkdir doc  
 mkdir pkg  
 mkdir build  
64  export PKG_ROOT=$(pwd)/pkg  export PKG_ROOT=$(pwd)/pkg
65  \end{shellCode}  \end{shellCode}
66    
67    \subsection{Building the dependencies}
68    
69  Copy the compressed sources for the packages into \filename{stand/pkg_src}.  Copy the compressed sources for the packages into \filename{stand/pkg_src}.
70  If you are using the support bundles, decrompress them in the stand directory.  If you are using the support bundles, decompress them in the stand directory:
71  \begin{shellCode}  \begin{shellCode}
72  tar -xjf escript-support-3-src.tar.bz2  tar -xjf escript-support-3-src.tar.bz2
73  \end{shellCode}  \end{shellCode}
74    
75  Copy documentation files into \filename{doc}.  Copy documentation files into \filename{doc} then unpack the archives:
76    
77  \begin{shellCode}  \begin{shellCode}
78  cd build  cd build
# Line 83  tar -zxf ../pkg_src/netcdf-4.0.tar.gz Line 84  tar -zxf ../pkg_src/netcdf-4.0.tar.gz
84  tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz  tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz
85  \end{shellCode}  \end{shellCode}
86    
87  Build python.  \begin{itemize}
88    
89    \item Build Python:
90  \begin{shellCode}  \begin{shellCode}
91  cd Python*  cd Python*
92  ./configure --prefix=$PKG_ROOT/python-2.6.1 --enable-shared 2>&1 \  ./configure --prefix=$PKG_ROOT/python-2.6.1 --enable-shared 2>&1 \
# Line 99  export LD_LIBRARY_PATH=$PKG_ROOT/python/ Line 102  export LD_LIBRARY_PATH=$PKG_ROOT/python/
102  pushd ../pkg  pushd ../pkg
103  ln -s python-2.6.1/ python  ln -s python-2.6.1/ python
104  popd  popd
   
105  \end{shellCode}  \end{shellCode}
106    
107  Run python to make sure it works.  Run the new python executable to make sure it works.
 Now build numpy.  
108    
109    \item Now build NumPy:
110  \begin{shellCode}  \begin{shellCode}
111  cd numpy-1.3.0  cd numpy-1.3.0
112  python setup.py build  python setup.py build
# Line 116  popd Line 118  popd
118  export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH  export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
119  \end{shellCode}  \end{shellCode}
120    
   
121  % \begin{shellCode}  % \begin{shellCode}
122  % cd numarray-1.5.2  % cd numarray-1.5.2
123  %  %
# Line 133  export PYTHONPATH=$PKG_ROOT/numpy/lib/py Line 134  export PYTHONPATH=$PKG_ROOT/numpy/lib/py
134  % popd  % popd
135  % \end{shellCode}  % \end{shellCode}
136    
137  Now we build scons.  \item Next build scons:
138  \begin{shellCode}  \begin{shellCode}
139  cd scons-1.2.0  cd scons-1.2.0
140  python setup.py install --prefix=$PKG_ROOT/scons-1.2.0  python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
# Line 145  ln -s scons-1.2.0 scons Line 146  ln -s scons-1.2.0 scons
146  popd  popd
147  \end{shellCode}  \end{shellCode}
148    
149  ...Boost libraries ...  \item The Boost libraries...:
150  \begin{shellCode}  \begin{shellCode}
151  pushd ../pkg  pushd ../pkg
152  mkdir boost_1_39_0  mkdir boost_1_39_0
# Line 153  ln -s boost_1_39_0 boost Line 154  ln -s boost_1_39_0 boost
154  popd  popd
155  cd boost_1_39_0  cd boost_1_39_0
156  ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost  ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost
157  ./bjam --build-type=complete  ./bjam
158  ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib  ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
159  export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH  export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
160  cd ..  cd ..
# Line 162  ln *.so.* libboost_python.so Line 163  ln *.so.* libboost_python.so
163  popd  popd
164  \end{shellCode}  \end{shellCode}
165    
166  ... and netcdf.  \item ...and NetCDF:
167  \begin{shellCode}  \begin{shellCode}
168  cd netcdf-4.0  cd netcdf-4.0
169  CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \  CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
# Line 179  ln -s netcdf-4.0 netcdf Line 180  ln -s netcdf-4.0 netcdf
180  popd  popd
181  \end{shellCode}  \end{shellCode}
182    
183  Now matplotlib.  \item Finally matplotlib:
   
184  \begin{shellCode}  \begin{shellCode}
185  cd matplotlib-0.98.5.3  cd matplotlib-0.98.5.3
186  python setup.py build  python setup.py build
# Line 192  popd Line 192  popd
192  cd ..  cd ..
193  \end{shellCode}  \end{shellCode}
194    
195    \end{itemize}
196    
197  \subsection{VTK support}  \subsection{VTK support}
198  These packages are currently required for pyvisi.  VTK is only required for pyvisi. To build it you need CMake and Mesa.
199  They can be downloaded independently or in the \filename{escript-support-visi-3-src}.  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 Section~\ref{sec:srclinux-escript}  If you will not be using pyvisi, then skip to Section~\ref{sec:compileescriptlinux}
201    
202  Copy the compressed sources for the packages into \filename{stand/pkg_src}.  Copy the compressed sources for the packages into \filename{stand/pkg_src}.
203  If you are using the support bundles, decrompress them in the stand directory.  If you are using the support bundles, decompress them in the stand directory.
204  \begin{shellCode}  \begin{shellCode}
205  tar -xjf escript-support-visi-3-src.tar.bz2  tar -xjf escript-support-visi-3-src.tar.bz2
206  \end{shellCode}  \end{shellCode}
# Line 211  tar -zxf ../pkg_src/vtkdata-5.2.1.tar.gz Line 213  tar -zxf ../pkg_src/vtkdata-5.2.1.tar.gz
213  tar -zxf ../pkg_src/cmake-2.6.3.tar.gz  tar -zxf ../pkg_src/cmake-2.6.3.tar.gz
214  \end{shellCode}  \end{shellCode}
215    
216  CMake and Mesa are required for VTK.  \begin{itemize}
217    
218    \item Build CMake:
219  \begin{shellCode}  \begin{shellCode}
220  cd cmake-2.6.3  cd cmake-2.6.3
221  ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure  ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
# Line 225  ln -s cmake-2.6.3 cmake Line 229  ln -s cmake-2.6.3 cmake
229  popd  popd
230  \end{shellCode}  \end{shellCode}
231    
232  These instructions do not compile MesaDemos or GLUT.  \item Build Mesa:
 If you need to check if Mesa compiled correctly, then the demos are a good test.  
233  \begin{shellCode}  \begin{shellCode}
234  cd Mesa-7.2  cd Mesa-7.2
235  ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa --with-driver=xlib  ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa --with-driver=xlib
# Line 240  pushd ../pkg Line 243  pushd ../pkg
243  ln -s mesa-7.2 mesa  ln -s mesa-7.2 mesa
244  popd  popd
245  \end{shellCode}  \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  Build VTK  \item Finally, build VTK:
250  \begin{shellCode}  \begin{shellCode}
251  cd VTK  cd VTK
252  cmake .  cmake .
253  \end{shellCode}  \end{shellCode}
254    
255  Now edit the \filename{CMakeCache.txt} file and make the following changes.  Now edit the \filename{CMakeCache.txt} file and make the following changes.
256  Where .... appears please replace it with the absolute path to pkg directory.  Where .... appears please replace it with the absolute path to the pkg directory.
257  For example,  For example, replace \filename{CMAKE_INSTALL_PREFIX:PATH=..../vtk-5.2.1} with
258  replace \filename{CMAKE_INSTALL_PREFX=..../vtk-5.2.1} with  \filename{CMAKE_INSTALL_PREFIX:PATH=/home/bob/stand/pkg/vtk-5.2.1}
259  \filename{CMAKE_INSTALL_PREFIX:PATH=/home/bob/stand/pkg/vtk-5.2.1}.  (Search for the text before the =).
 (Search for the text before the =)  
260  \begin{shellCode}  \begin{shellCode}
261  BUILD_EXAMPLES:BOOL=OFF  BUILD_EXAMPLES:BOOL=OFF
262  BUILD_SHARED_LIBS:BOOL=ON  BUILD_SHARED_LIBS:BOOL=ON
# Line 270  Now rerun cmake (it won't work but it ad Line 274  Now rerun cmake (it won't work but it ad
274  cmake .  cmake .
275  \end{shellCode}  \end{shellCode}
276    
277  Edit \filename{CMakeCache.txt} and change the following variables.  Edit \filename{CMakeCache.txt} and change the following variables:
278    
279  \begin{shellCode}  \begin{shellCode}
280  VTK_USE_OFFSCREEN:BOOL=ON  VTK_USE_OFFSCREEN:BOOL=ON
# Line 283  OPENGL_INCLUDE_DIR:PATH=..../mesa/includ Line 287  OPENGL_INCLUDE_DIR:PATH=..../mesa/includ
287  OPENGL_gl_LIBRARY:FILEPATH=..../mesa/lib/libGL.so  OPENGL_gl_LIBRARY:FILEPATH=..../mesa/lib/libGL.so
288  \end{shellCode}  \end{shellCode}
289    
290  The following steps will take a while.  The following steps will take a while so grab a coffee while it compiles.
291  \begin{shellCode}  \begin{shellCode}
292  cmake .  cmake .
293  make  make
294  chmod +w Utilities/vtktiff/tif_fax3sm.c  chmod +w Utilities/vtktiff/tif_fax3sm.c
295  make install  make install
 \end{shellCode}  
296    
 \begin{shellCode}  
297  cd ../../pkg  cd ../../pkg
298  ln -s vtk-5.2.1 vtk  ln -s vtk-5.2.1 vtk
299  cd ..  cd ..
300  \end{shellCode}  \end{shellCode}
301    
302  \subsection{escript}  \end{itemize}
 \label{sec:srclinux-escript}  
   
 Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.  
303    
304  \subsection{Compiling escript}\label{sec:compileescriptlinux}  \subsection{Compiling escript}\label{sec:compileescriptlinux}
305    
# Line 313  cp linux_options_example.py YourMachineN Line 312  cp linux_options_example.py YourMachineN
312  echo $PKG_ROOT  echo $PKG_ROOT
313  \end{shellCode}  \end{shellCode}
314    
315  edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.  Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
316  For example:  For example:
317  \begin{shellCode}  \begin{shellCode}
318  PKG_ROOT="/home/bob/stand/pkg"  PKG_ROOT="/home/bob/stand/pkg"
# Line 323  PKG_ROOT="/home/bob/stand/pkg" Line 322  PKG_ROOT="/home/bob/stand/pkg"
322  cd ../bin  cd ../bin
323  \end{shellCode}  \end{shellCode}
324    
325  Modify the STANDALONE line of \figurename{escript} to read:  Modify the STANDALONE line of \filename{escript} to read:
326    
327  STANDALONE=1  STANDALONE=1
328    
# Line 337  scons Line 336  scons
336  \end{shellCode}  \end{shellCode}
337    
338  If you wish to test your build, then you can do the following.  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.  Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
340  \begin{shellCode}  \begin{shellCode}
341  scons all_tests  scons all_tests
342  \end{shellCode}  \end{shellCode}
# Line 345  scons all_tests Line 344  scons all_tests
344  \subsection{Cleaning up}  \subsection{Cleaning up}
345  Once you are satisfied, the \filename{escript.d/build} and \filename{\$PKG_ROOT/build} directories can be removed.  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 escript, you can remove the following:  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}  \begin{itemize}
349   \item From the \filename{escript.d} directory:\begin{itemize}   \item From the \filename{escript.d} directory:\begin{itemize}
350  \item Everything except: \filename{bin}, \filename{include}, \filename{lib}, \filename{esys},  \item Everything except: \filename{bin}, \filename{include}, \filename{lib}, \filename{esys},
# Line 366  in the \filename{escript.d} directory. Line 365  in the \filename{escript.d} directory.
365  Please note that removing all these files may make it more difficult for us to diagnose problems.  Please note that removing all these files may make it more difficult for us to diagnose problems.
366    
367    
   
   
368  \section{Additional Functionality}\label{sec:linaddfunc}  \section{Additional Functionality}\label{sec:linaddfunc}
369  To perform visualisations you will need some additional tools.  To perform visualisations you will need some additional tools.
370  Since these do not need to be linked with any of the packages above, you can install versions available for your  Since these do not need to be linked with any of the packages above, you can install versions available for your system, or build them from source.
 system, or build them from source.  
371  \begin{itemize}  \begin{itemize}
372  \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite. - To build from source  \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite - to build from source
373  you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.  you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.
374  \item A tool to visualise VTK files. For example Mayavi or Visit.  \item A tool to visualise VTK files. For example Mayavi or Visit.
375  \end{itemize}  \end{itemize}
376    

Legend:
Removed from v.2535  
changed lines
  Added in v.2536

  ViewVC Help
Powered by ViewVC 1.1.26