/[escript]/branches/dirac/doc/install/srcommon.tex
ViewVC logotype

Contents of /branches/dirac/doc/install/srcommon.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2512 - (show annotations)
Thu Jul 2 05:34:14 2009 UTC (10 years, 2 months ago) by jfenwick
Original Path: trunk/doc/install/srcommon.tex
File MIME type: application/x-tex
File size: 9894 byte(s)
Made the warnings against linking gomp a bit more detailed.
Commented out gomp from the linux sample.
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 % This file contains material common to all src distributions.
15
16 % The original version of this content came from the esscc twiki page maintained by ksteube
17
18 \esfinley is known to compile and run on the following systems:
19 \begin{itemize}
20 \item \linux under gcc\footnote{There are some problems with OpenMP under gcc prior to version 4.3.2. Also do not link the gomp library with gcc 4.3.3 it causes problems.} - \Sec{sec:srclinux}
21 \item \linux under icc on SGI ICE 8200.
22 \item \macosx under gcc - \Sec{sec:srcmac}
23 \end{itemize}
24
25 \section{External dependencies}
26 The following external packages are required in order to compile and run \esfinley.
27 Where version numbers are specified, more recent versions can probably be subsituted.
28 You can either try the standard/precompiled packages available for your operating system or you can download and build them from source.
29 The advantage of using existing packages is that they will probably all work togther properly.
30 You must take greater care if downloading sources separately.
31
32 \begin{itemize}
33 \item python-2.5.1 (\url{http://python.org}) \\
34 - Python interpreter (You must compile with shared libraries.)
35 \item numpy 1.1.0 (\url{http://numpy.scipy.org})
36 - Arrays for python.
37 \item boost-1.35 (\url{http://www.boost.org}) \\
38 - Provides an interface between C++ and python.
39 \item scons-0.989.5 (\url{http://www.scons.org/}) \\
40 - a python-based alternative to ``make''.
41 \end{itemize}
42
43 The version numbers given here are not strict requirements, more recent (and in some cases older) versions will
44 still work.
45 The following packages should be sufficient (but not necessarily minimal) for Debian 5.0 (``Lenny''):
46 python-dev, libboost1.35-dev, scons, python-numpy, g++.
47
48
49 These packages may be required for some of the optional capabilities of the system.
50
51 \begin{itemize}
52 \item netcdf-3.6.2 (\url{http://www.unidata.ucar.edu/software/netcdf}) \\-
53 Used to save data sets in binary form for checkpoint/restart (must be compiled with -fPIC).
54 \item vtk-5.0.4 (\url{http://www.vtk.org}) \\-
55 This is used to save VTK files for visualization.
56 \begin{itemize}
57 \item cmake-2.4.6 (\url{http://www.cmake.org}) \\-
58 This is used to build VTK.
59 \item mesa-7.0.3 (\url{http://www.mesa3d.org})\\-
60 Free OpenGL replacement used by VTK.
61 \end{itemize}
62
63 \item mpich2-1.0.7 (\url{http://www.mcs.anl.gov/research/projects/mpich2}) \\-
64 Parallelization with MPI.
65 \item parmetis-3.1 (\url{http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview}) \\-
66 Optimization of the stiffness matrix.
67 \item MKL \\(\url{http://www.intel.com/cd/software/products/asmo-na/eng/307757.htm}) \\-
68 Intel's Math Kernel Library for use with their c compiler.
69 \end{itemize}
70
71 The following packages might be useful for mesh generation:
72 \begin{itemize}
73 \item gmsh-2.2.0 (\url{http://www.geuz.org/gmsh}) \\-
74 Mesh generation and viewing.
75 \begin{itemize}
76 \item fltk-1.1.9 (\url{http://www.fltk.org}) \\-
77 This is used to build gmsh
78 \item gsl-1.10 (\url{http://www.gnu.org/software/gsl}) \\-
79 This is used to build gmsh
80 \end{itemize}
81
82 \item triangle-1.6 (\url{http://www.cs.cmu.edu/~quake/triangle.html})
83 \end{itemize}
84
85 Packages for visualization:
86 \begin{itemize}
87 \item mayavi-1.5 (\url{http://mayavi.sourceforge.net}) \\-
88 MayaVi is referenced in our User Guide for viewing VTK files.
89 \item visit-1.9 (\url{https://wci.llnl.gov/codes/visit/})
90 \end{itemize}
91
92 \section{Compilation}\label{sec:compilesrc}
93 Throughout this section we will assume that the source code is uncompressed in a directory called trunk.
94 You can call the directory anything you like, provided that you make the change before you compile.
95
96 You need to indicate where to find the external dependencies.
97 Unless specified otherwise, all paths will be relative to the top level of the source.
98 To do this, create a file in the \filename{scons} directory called \filename{x_options.py} where ``x'' is the name of your computer.
99 As a starting point use one of the following:
100 \begin{itemize}
101 \item \filename{scons/linux_options_example.py} (\linux desktop)
102 \item \filename{scons/mac_options_example.py} (\macosx desktop)
103 \item \filename{ice_options_example.py} (SGI ICE 8200)
104 \item \filename{winxp_options_example.py} (\winxp)
105 \end{itemize}
106
107 To actually compile (if you have $n$ processors, then you can use \texttt{scons -j$n$} instead):
108
109 \begin{shellCode}
110 cd trunk
111 scons
112 \end{shellCode}
113
114 As part of its output, scons will tell you the name of the options file it used as well as a list of features
115 and whether they are enabled for your build.
116
117 If you require debug versions of the libraries, use:
118 \begin{shellCode}
119 scons usedebug=yes
120 \end{shellCode}
121 A note about scons: if you recompile later with different options (eg leaving off usedebug), scons will revert
122 to its default values. If you wish to make a change more permanent, then modify your options file.
123
124
125 You can install the binaries/libraries in a different location with:
126 \begin{shellCode}
127 scons prefix=some_dir
128 \end{shellCode}
129
130 You can test your build using
131 \begin{shellCode}
132 scons all_tests
133 \end{shellCode}
134 An alternative method is available for performing tests on \openmp and MPI builds.
135
136 \subsection{Compilation with \openmp}
137 You will need to consult your compiler documentation for the precise switches to use to enable OpenMP features.
138 Once you know the options, modify the omp_optim, omp_debug and omp_libs variables in your options.py file.
139
140 For example, for gcc compilers which support \openmp use.
141 \begin{shellCode}
142 omp_optim = '-fopenmp'
143 omp_debug = '-fopenmp'
144 omp_libs = ['gomp']
145 \end{shellCode}
146 Depending on your version, last change may not be required.
147
148 Then recompile.
149 \begin{shellCode}
150 scons useopenmp=yes
151 \end{shellCode}
152
153 You can test your build on for instance 4 threads using
154 \begin{shellCode}
155 export ESCRIPT_NUM_THREADS=4
156 scons all_tests
157 \end{shellCode}
158
159 \subsection{Compilation with MPI}
160 You will need to have MPI installed on your system.
161 There are a number of implementations so we do not provide any specific advice here.
162 You will need to modify the following variables in your options file.
163 \begin{itemize}
164 \item \texttt{mpi_flavour} \\
165 which MPI implementation is used. Valid values are \begin{itemize}
166 \item[\texttt{MPT}] SGI MPI implementation \\ \url{http://techpubs.sgi.com/library/manuals/3000/007-3687-010/pdf/007-3687-010.pdf}
167 \item[\texttt{MPICH2}] Argonne's MPICH vesrion 2 implementation \\ \url{http://www.mcs.anl.gov/research/projects/mpi/mpich2/}
168 \item[\texttt{MPICH}] Argonne's MPICH implementation \\ \url{http://www.mcs.anl.gov/research/projects/mpi/mpich1/}
169 \item[\texttt{OPENMPI}] Open MPI \url{http://www.open-mpi.org/}
170 \item[\texttt{INTELMPI}] Intel's MPI \url{http://software.intel.com/en-us/intel-mpi-library/}
171 \end{itemize}
172 \item \texttt{mpi_path} \\
173 where to find \filename{mpi.h}
174 \item \texttt{mpi_lib_path} \\
175 where to find libraries for mpi
176 \item \texttt{mpi_libs} \\
177 which libraries to link to.
178 \end{itemize}
179
180 Then compile with:
181 \begin{shellCode}
182 scons usempi=yes
183 \end{shellCode}
184
185 As with debug and openmp, you can make this a more permanent setting by modifying your options file.
186
187 You can test your build on for instance 6 processors using
188 \begin{shellCode}
189 export ESCRIPT_NUM_NODES=6
190 scons usempi=yes all_tests
191 \end{shellCode}
192 and on 6 processors with 4 threads each using
193 \begin{shellCode}
194 export ESCRIPT_NUM_THREADS=4
195 export ESCRIPT_NUM_NODES=6
196 scons usempi=yes all_tests
197 \end{shellCode}
198 Alternatively, you can give a hostfile
199 \begin{shellCode}
200 export ESCRIPT_NUM_THREADS=4
201 export ESCRIPT_HOSTFILE=myhostfile
202 scons usempi=yes all_tests
203 \end{shellCode}
204 Notice that depending on your MPI flavour it may be required to start a daemon before running the tests under MPI.
205
206
207 \subsection{Difficulties}
208
209 %This is copied from Ken's notes on teh old Twiki page
210 \subsubsection{``Bad magic number''}
211 Some reasons for this error message include:
212 \begin{itemize}
213 \item Using different versions of python when installing and running escript (Use \texttt{which python} and \texttt{python --version} to check)
214 \item Using different versions of libraries (Make sure \texttt{LD_LIBRARY_PATH} has \filename{/trunk/lib} listed first)
215 \item Using different versions of python modules (Make sure \texttt{PYTHONPATH} has \filename{/trunk/escript} directory listed first)
216 \end{itemize}
217
218 Another error we sometimes see is unsatisfied externals when trying to run a python script. This is usually due to not having \texttt{LD_LIBRARY_PATH} and \texttt{PYTHONPATH} set correctly so that you run with different libraries from the ones the code was compiled against. Check which libraries you are running against with \texttt{ldd lib/libfinley.so} and \texttt{ldd esys/finley/finleycpp.so}.
219
220 It is also possible that the person who compiled \esfinley used incompatible libraries. For example, if you run with Python2.4 but the software was compiled against Python2.5 then you will get unsatisfied externals or a large error message with a long traceback. Another case is when Boost or Numarray was compiled against the wrong Python library. To avoid these problems everyone (builder and user) must make certain they are using the same python libraries.
221
222 \subsubsection{OpenMP builds segfault running examples}
223
224 One known cause for this is linking the \filename{gomp} library with escript built using gcc 4.3.3.
225 While you need the -fomp switch you should not need to link \filename{gomp}.

  ViewVC Help
Powered by ViewVC 1.1.26