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

Annotation of /trunk/doc/install/srcmac.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2327 - (hide annotations)
Thu Mar 19 06:01:26 2009 UTC (10 years, 6 months ago) by artak
File MIME type: application/x-tex
File size: 9700 byte(s)
Mac OS X development tools instructions are added.
1 jfenwick 2289
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 \macosx}
15 artak 2326 \label{sec:srcmac}
16    
17 artak 2327 First of all before you start installing from source you will need Mac OS X development tools installed on your Mac. This will ensure that you have the following installed:
18 artak 2326 \begin{itemize}
19     \item \filename{g++} and associated tools.
20     \item \filename{make}
21     \end{itemize}
22    
23 artak 2327 Here are the instruction on how to install them.
24     \begin{enumerate}
25     \item Insert the Mac OS X v10.5 (Leopard) DVD.
26     \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools.
27     \item Follow the instructions in the Installer.
28     \item Authenticate as the administrative user. The √ěrst user you create when setting up Mac OS X has administrator privileges by default.
29     \end{enumerate}
30    
31 artak 2326 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.
33 artak 2327 For additional visualisation functionality see Section~\ref{sec:macaddfunc}.
34 artak 2326
35     These instructions will produce the following structure:
36     \begin{itemize}
37     \item \filename{stand}: \begin{itemize}
38     \item \filename{escript.d}
39     \item \filename{packages}
40     \item \filename{package_src}
41     \item \filename{build}
42     \item \filename{doc}
43     \end{itemize}
44     \end{itemize}
45    
46     The build directory can be removed when you are finished.
47    
48 artak 2327 The following instructions assume you are running the \filename{bash} shell.
49     Comments are indicated with \# characters.
50    
51     Open a terminal~\footnote{If you do not know how to open a terminal on Mac, then just type terminal in the spotlight (search tool on the top of the right corner) and once found just click on it.} and type
52    
53 artak 2326 \begin{shellCode}
54     mkdir stand
55     cd stand
56     export PKG_ROOT=`pwd`/packages
57     \end{shellCode}
58    
59     Copy compressed source bundles into \filename{stand/package_src}.
60     Copy documentation files into \filename{doc}.
61    
62     \begin{shellCode}
63     mkdir packages
64     mkdir build
65     cd build
66     tar -jxf ../package_src/Python-2.6.1.tar.bz2
67     tar -jxf ../package_src/boost_1_38_0.tar.bz2
68     tar -jxf ../package_src/MesaLib-7.2.tar.bz2
69     tar -zxf ../package_src/netcdf-4.0.tar.gz
70     tar -zxf ../package_src/vtk-5.2.1.tar.gz
71     tar -zxf ../package_src/vtkdata-5.2.1.tar.gz
72     tar -zxf ../package_src/numarray-1.5.2.tar.gz
73     tar -zxf ../package_src/cmake-2.6.3.tar.gz
74     tar -zxf ../package_src/scons-1.2.0.tar.gz
75     \end{shellCode}
76    
77     Build python.
78     \begin{shellCode}
79     cd Python*
80    
81     ./configure --prefix=\$PKG_ROOT/python-2.6.1 \
82     --exec-prefix=\$PKG_ROOT/python-2.6.1 --enable-shared \
83     --enable-framework=\$PKG_ROOT/python-2.6.1 2>&1 | tee tt.configure.out
84    
85     make -j2
86    
87     make install 2>&1 | tee tt.make.out
88    
89     cp ../../packages/python-2.6.1/Python.framework/Versions/2.6/Python \
90     ../../packages/python-2.6.1/lib/libpython2.6.dylib
91    
92     cp ../../packages/python-2.6.1/Python.framework/Versions/2.6/Python \
93     ../../packages/python-2.6.1/lib/libpython.dylib
94    
95     cp ../../packages/python-2.6.1/include/python2.6/pyconfig.h \
96     ../../packages/python-2.6.1/Python.framework/Headers/
97    
98     cd ..
99    
100     export PATH=\$PKG_ROOT/python/bin:\$PATH
101     export PYTHONHOME=\$PKG_ROOT/python
102     export LD_LIBRARY_PATH=\$PKG_ROOT/python/lib:\$LD_LIBRARY_PATH
103    
104     pushd ../packages
105     ln -s python-2.6.1/ python
106     popd
107    
108     \end{shellCode}
109    
110     Run python to make sure~(check the version number) it works.
111     Now build numarray.
112    
113     \begin{shellCode}
114     cd numarray-1.5.2
115    
116     python setup.py install \
117     --gencode --install-lib=\$PKG_ROOT/numarray-1.5.2/lib \
118     --install-headers=\$PKG_ROOT=\$PKG_ROOT/numarray-1.5.2/include/numarray \
119     2>&1 | tee tt.install.out
120    
121    
122     export PYTHONPATH=\$PKG_ROOT/numarray/lib:\$PYTHONPATH
123     cd ..
124     pushd ../packages
125     ln -s numarray-1.5.2 numarray
126     popd
127     \end{shellCode}
128    
129     Now we build scons.
130     \begin{shellCode}
131     cd scons-1.2.0
132     python setup.py install --prefix=\$PKG_ROOT/scons-1.2.0
133    
134     export PATH=\$PKG_ROOT/scons/bin:\$PATH
135     cd ..
136     pushd ../packages
137     ln -s scons-1.2.0 scons
138     popd
139     \end{shellCode}
140    
141     ...Boost libraries ...
142     \begin{shellCode}
143     cd boost_1_38_0
144    
145     ./configure --prefix=\$PKG_ROOT/boost_1_38_0 --with-python-root=\$PKG_ROOT/python \
146     --with-python-version=2.6 --with-libraries=python
147    
148     make -j2
149     make install
150     ln -s \$PKG_ROOT/boost_1_38_0 \$PKG_ROOT/boost
151     export LD_LIBRARY_PATH=\$PKG_ROOT/boost/lib:\$LD_LIBRARY_PATH
152     cd ..
153     pushd ../packages
154     ln -s boost_1_38_0 boost
155     popd
156     \end{shellCode}
157    
158     ... and netcdf.
159     \begin{shellCode}
160     cd netcdf-4.0
161     CFLAGS="-O2 fPIC -Df2cFortran" CXXFLAGS="-O2 fPIC -Df2cFortran" \
162     FFLAGS="-O2 fPIC -Df2cFortran" FCFLAGS="-O2 fPIC -Df2cFortran" \
163     ./configure --prefix=\$PKG_ROOT/netcdf-4.0
164    
165     make -j2
166     make install
167    
168     export LD_LIBRARY_PATH=\$PKG_ROOT/netcdf/lib:\$LD_LIBRARY_PATH
169     cd ..
170     pushd ../packages
171     ln -s netcdf-4.0 netcdf
172     popd
173     \end{shellCode}
174    
175     CMake and Mesa are required for VTK.
176     \begin{shellCode}
177     cd cmake-2.6.3
178     ./configure --prefix=\$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
179     make -j 4
180     make install
181    
182     export PATH=\$PKG_ROOT/cmake/bin:\$PATH
183     cd ..
184     pushd ../packages
185     ln -s cmake-2.6.3 cmake
186     popd
187     \end{shellCode}
188    
189     These instructions do not compile MesaDemos or GLUT.
190     If you need to check if Mesa compiled correctly, then the demos are a good test.
191     \begin{shellCode}
192     cd Mesa-7.2
193     ./configure --prefix=\$PKG_ROOT/mesa-7.2 --enable-gl-osmesa
194    
195     make -j 4
196     make install
197    
198     export LD_LIBRARY_PATH=\$PKG_ROOT/mesa:\$LD_LIBRARY_PATH
199     cd ..
200     pushd ../packages
201     ln -s mesa-7.2 mesa
202     popd
203     \end{shellCode}
204    
205     \begin{shellCode}
206     cd VTK
207     cmake .
208    
209     #Edit the CMakeCache and make the following changes:
210     #(Please replace .... with an absolute path to the stand directory)
211    
212     #-----------------
213    
214     BUILD_EXAMPLES should be OFF
215     BUILD_SHARED_LIBS should be ON
216    
217     CMAKE_INSTALL_PREFIX ..../stand/packages/vtk-5.2.1
218     CMAKE_VERBOSE_MAKEFILE TRUE
219    
220     #check PYTHON_EXECUTABLE is correct.
221     #but it seems to be when I went through these steps
222    
223     VTK_OPENGL_HAS_OSMESA TRUE
224     VTK_USE_64BIT_IDS ON
225     # That last one is marked as "May cause some bugs" in the original instructions
226    
227     VTK_WRAP_PYTHON ON
228     VTK_USE_MANGLED_MESA OFF
229    
230     #--------------------
231    
232     cmake .
233     #It won't work but it will put some variables in that you need.
234    
235     #Edit CMakeCache again and make the following changes
236    
237     #----------------
238    
239     VTK_USE_TK OFF
240    
241     OSMESA_INCLUDE_DIR ..../stand/packages/mesa/include
242    
243     OSMESA_LIBRARY ..../stand/packages/mesa/lib/libOSMesa.dylib
244    
245     PYTHON_INCLUDE_PATH ..../stand/packages/python/include/python2.6
246    
247     PYTHON_LIBRARY ..../stand/packages/python/lib/libpython2.6.dylib
248    
249     OPENGL_INCLUDE_DIR ..../stand/packages/mesa/include
250    
251     OPENGL_gl_LIBRARY ..../stand/packages/mesa/lib/libGL.dylib
252    
253     #----------------
254    
255     cmake .
256     make
257     make install
258    
259    
260     cd ../../packages
261     ln -s vtk-5.2.1 vtk
262     cd ..
263     \end{shellCode}
264    
265     Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.
266    
267     \begin{shellCode}
268     cd scons
269     cp mac_options_example.py YourMachineName_options.py
270    
271     #edit the options file and make the following changes:
272     #-----------------------------------------------------------------
273     declare a PKG_ROOT variable at the top of the file eg:
274     PKG_ROOT='/Users/artak/stand/packages'
275    
276     python_path = PKG_ROOT+'python/include/python2.6'
277     python_lib_path = PKG_ROOT+'python/lib'
278     python_libs = 'python2.6'
279    
280     boost_path = PKG_ROOT+'boost/include/boost-1_38'
281     boost_lib_path = PKG_ROOT+'boost/lib'
282     boost_libs = ['boost_python-gcc43-mt']
283     # You could simlink the boost python library to give a shorter
284     # name but it's not worth it
285    
286     usevtk = 'yes'
287     #-------------------------------------------------------------------
288    
289     ln -s \$PKG_ROOT/vtk-5.2.1 \$PKG_ROOT/vtk
290    
291     Modify /scripts/finley_wrapper_template
292    
293     STANDALONE=1
294    
295     #Check to make sure the paths in the if [ \$STANDALONE == 1 ]
296     # Section are correct
297    
298     #-----------------------------------------------------------------
299    
300     scons bin/escript
301    
302     #start a new terminal
303     cd stand
304     export PATH=`pwd`/packages/scons/bin:\$PATH
305     cd escript.d
306     eval `bin/escript -e`
307     scons
308     \end{shellCode}
309    
310     If you wish to test your build, then you can do the following.
311     Note this may take a while if you have a slow processor and/or less than 1Gb of RAM.
312     \begin{shellCode}
313     scons all_tests
314     \end{shellCode}
315    
316     Once you are satisfied, the \filename{build} and \filename{\$PKG_ROOT/build} directories can be removed.
317     Within the \filename{packages} directory, the \filename{scons}, \filename{scons-1.2.0}, \filename{cmake-2.6.3} and \filename{cmake} entries can also be removed.
318     If you are not redistributing this bundle you can remove \filename{\$PKG_ROOT/package_src}.
319    
320     If you do not plan to edit or recompile the source you can remove it.
321     The only entries which are required in \filename{escript.d} are:
322     \begin{itemize}
323     \item \filename{bin}
324     \item \filename{esys}
325     \item \filename{include}
326     \item \filename{lib}
327     \item \filename{README_LICENSE}
328     \end{itemize}
329    
330     Hidden files can be removed with
331     \begin{shellCode}
332     find . -name .?* | xargs rm -rf
333     \end{shellCode}
334    
335 artak 2327 \section{Additional Functionality}\label{sec:macaddfunc}
336 artak 2326 To perform visualisations you will need some additional tools.
337     Since these do not need to be linked with any of the packages above, you can install versions available for your
338     system, or build them from source.
339     \begin{itemize}
340     \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite. - To build from source
341     you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.
342     \item A tool to visualise VTK files. For example Mayavi or Visit.
343     \end{itemize}

  ViewVC Help
Powered by ViewVC 1.1.26