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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2568 - (show annotations)
Fri Jul 31 05:37:41 2009 UTC (10 years, 1 month ago) by jfenwick
File MIME type: application/x-tex
File size: 10313 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 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Copyright (c) 2003-2009 by University of Queensland
4 % 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 \macosx}
14 \label{sec:srcmac}
15
16 Before you start installing from source you will need \macosx development tools installed on your Mac.
17 This will ensure that you have the following available:
18 \begin{itemize}
19 \item \filename{g++} and associated tools.
20 \item \filename{make}
21 \end{itemize}
22
23 Here are the instructions on how to install these.
24 \begin{enumerate}
25 \item Insert the \macosx 10.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 first user you create when setting up \macosx has administrator privileges by default)
29 \end{enumerate}
30
31 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 For additional visualization functionality see \Sec{sec:addfunc}.
34
35 These instructions will produce the following directory structure:
36 \begin{itemize}
37 \item[] \filename{stand}: \begin{itemize}
38 \item[] \filename{escript.d}
39 \item[] \filename{pkg}
40 \item[] \filename{pkg_src}
41 \item[] \filename{build}
42 \item[] \filename{doc}
43 \end{itemize}
44 \end{itemize}
45
46 The following instructions assume you are running the \filename{bash} shell.
47 Comments are indicated with \# characters.
48
49 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
50
51 \begin{shellCode}
52 mkdir stand
53 cd stand
54 export PKG_ROOT=`pwd`/pkg
55 \end{shellCode}
56
57 Copy compressed source bundles into \filename{stand/package_src}.
58 Copy documentation files into \filename{doc}.
59
60 \begin{shellCode}
61 mkdir packages
62 mkdir build
63 cd build
64 tar -jxf ../pkg_src/Python-2.6.2.tar.bz2
65 tar -jxf ../pkg_src/boost_1_39_0.tar.bz2
66 tar -zxf ../pkg_src/scons-1.2.0.tar.gz
67 tar -zxf ../pkg_src/numpy-1.3.0.tar.gz
68 tar -zxf ../pkg_src/netcdf-4.0.tar.gz
69 tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz
70 \end{shellCode}
71
72 \begin{itemize}
73
74 \item Build python:
75 \begin{shellCode}
76 cd Python*
77 ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \
78 | tee tt.configure.out
79 make
80 make install 2>&1 | tee tt.make.out
81
82 cd ..
83
84 export PATH=$PKG_ROOT/python/bin:$PATH
85 export PYTHONHOME=$PKG_ROOT/python
86 export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH
87
88 pushd ../pkg
89 ln -s python-2.6.2/ python
90 popd
91 \end{shellCode}
92
93 Run the new python executable to make sure it works.
94
95 \item Now build NumPy:
96 \begin{shellCode}
97 cd numpy-1.3.0
98 python setup.py build
99 python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
100 cd ..
101 pushd ../pkg
102 ln -s numpy-1.3.0 numpy
103 popd
104 export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
105 \end{shellCode}
106
107 \item Next build scons:
108 \begin{shellCode}
109 cd scons-1.2.0
110 python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
111
112 export PATH=$PKG_ROOT/scons/bin:$PATH
113 cd ..
114 pushd ../pkg
115 ln -s scons-1.2.0 scons
116 popd
117 \end{shellCode}
118
119 \item The Boost libraries...:
120 \begin{shellCode}
121 pushd ../pkg
122 mkdir boost_1_39_0
123 ln -s boost_1_39_0 boost
124 popd
125 cd boost_1_39_0
126 ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost
127 ./bjam
128 ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
129 export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
130 cd ..
131 pushd ../pkg/boost/lib/
132 ln -s libboost_python*-1_39.dylib libboost_python.dylib
133 popd
134 \end{shellCode}
135
136 \item ...and NetCDF:
137 \begin{shellCode}
138 cd netcdf-4.0
139 CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
140 FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
141 ./configure --prefix=$PKG_ROOT/netcdf-4.0
142
143 make
144 make install
145
146 export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
147 cd ..
148 pushd ../pkg
149 ln -s netcdf-4.0 netcdf
150 popd
151 \end{shellCode}
152
153 \item Finally matplotlib:
154 \begin{shellCode}
155 cd matplotlib-0.98.5.3
156 python setup.py build
157 python setup.py install --prefix=$PKG_ROOT/matplotlib-0.98.5.3
158 cd ..
159 pushd ../pkg
160 ln -s matplotlib-0.98.5.3 matplotlib
161 popd
162 cd ..
163 \end{shellCode}
164 \end{itemize}
165
166 \subsection{Compiling escript}\label{sec:compileescriptmac}
167
168 Change to the directory containing your escript source (\filename{stand/escript.d}), then:
169
170 \begin{shellCode}
171 cd escript.d/scons
172 cp mac_standalone_options_example.py YourMachineName_options.py
173
174 echo $PKG_ROOT
175 \end{shellCode}
176
177 Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
178 For example:
179 \begin{shellCode}
180 PKG_ROOT="/home/bob/stand/pkg"
181 \end{shellCode}
182
183 \begin{shellCode}
184 cd ../bin
185 \end{shellCode}
186
187 Modify the STANDALONE line of \filename{escript} to read:
188
189 STANDALONE=1
190
191 Start a new terminal and go to the \filename{stand} directory.
192
193 \begin{shellCode}
194 export PATH=$(pwd)/pkg/scons/bin:$PATH
195 cd escript.d
196 eval $(bin/escript -e)
197 scons
198 \end{shellCode}
199
200 If you wish to test your build, then you can do the following.
201 Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
202 \begin{shellCode}
203 scons all_tests
204 \end{shellCode}
205
206 Once you are satisfied, the \filename{build} and \filename{\$PKG_ROOT/build} directories can be removed.
207 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.
208 If you are not redistributing this bundle you can remove \filename{\$PKG_ROOT/package_src}.
209
210 If you do not plan to edit or recompile the source you can remove it.
211 The only entries which are required in \filename{escript.d} are:
212 \begin{itemize}
213 \item \filename{bin}
214 \item \filename{esys}
215 \item \filename{include}
216 \item \filename{lib}
217 \item \filename{README_LICENSE}
218 \end{itemize}
219
220 Hidden files can be removed with
221 \begin{shellCode}
222 find . -name .?* | xargs rm -rf
223 \end{shellCode}
224
225 %Mac ports removed until Artak has a chance to update it
226
227 % \section{Installing from source for \macosx using Macports}
228 % \label{sec:srcmacports}
229 %
230 % As we mentioned in \Sec{sec:srcmac}, before you start installing from source you will need \macosx development tools installed on your Mac.
231 % If you do not have Macports already, please install Macports from \url{www.macports.org}. You can also install porticus (GUI for Macports).
232 %
233 % Once you have Macports working install boost using porticus or from the terminal
234 % \begin{shellCode}
235 % sudo port install boost@1.35.0_2+complete
236 % \end{shellCode}
237 % Sometimes this fails due to unknown reasons, but to overcome this problem you need to run
238 % \begin{shellCode}
239 % sudo port clean boost@1.35.0_2+complete
240 %
241 % sudo port install boost@1.35.0_2+complete
242 % \end{shellCode}
243 %
244 % Download scons source scons-0.98.5.tar.gz from \url{www.scons.org}.
245 % \begin{shellCode}
246 % tar xfz scons-0.98.5.tar.gz
247 % cd scons-0.98.5
248 % python setup.py install
249 % \end{shellCode}
250 %
251 % Note: Do not try to install scons using porticus or \texttt{sudo port install scons}, because it automatically installs another python version and you are likely run into problems with different python versions.
252 %
253 % Download numarray-1.5.2.tar.gz from \\
254 % \url{http://www.stsci.edu/resources/software_hardware/numarray/numarray.html}.
255 % \begin{shellCode}
256 % tar xfz numarray-1.5.2.tar.gz
257 % cd numarray-1.5.2
258 % python setup.py install --gencode 2>&1 | tee tt.install.out
259 % \end{shellCode}
260 %
261 % You can run a test to check the numarray installation by
262 % \begin{shellCode}
263 % python
264 % import numarray.testall as testall
265 % testall.test()
266 % \end{shellCode}
267 %
268 % Install netcdf, gsl and fltk using Macports
269 % \begin{shellCode}
270 % sudo port install netcdf
271 % sudo port install gsl
272 % sudo port intall fltk
273 % \end{shellCode}
274 % Note: If this fails, download and install from sources.
275 %
276 % Downlaod gmsh-2.2.3-source.tar and install from sources.
277 % \begin{shellCode}
278 % ./configure --with-gsl-prefix=/opt/local/ --with-fltk --prefix=/usr/local/
279 % \end{shellCode}
280 % Note: if you install using porticus or sudo port it automaticall installs in \filename{/opt/local/}, but if you install from sources it installs in /usr/local. So, make sure these paths are right.
281 % \begin{shellCode}
282 % sudo make -j2
283 % sudo make install
284 % \end{shellCode}
285 %
286 % Download and install Mesa-7.0.3 (required for VTK) from sources
287 % \begin{shellCode}
288 % tar xjf MesaDemos-7.0.3.tar.bz2
289 % tar xjf MesaGLUT-7.0.3.tar.bz2
290 % tar xjf MesaLib-7.0.3.tar.bz2
291 % cd Mesa-7.0.3
292 %
293 % sudo make -j 2
294 % make install
295 % \end{shellCode}
296 %
297 % % Install vtk-5.0.4 from source. If you install from ports it won't configure to use shared libraries.
298 % % Once you untar it you will have (assume user is john) /Users/john/Downloads/VTK folder, then run the following:
299 % %
300 % % \begin{shellCode}
301 % % sudo mkdir /usr/local/VTKBuild/
302 % % cd /usr/local/VTKBuild/
303 % % sudo ccmake /Users/john/Downloads/VTK/
304 % % # It will create CMakeCache.txt. Make sure you use the following configurations.
305 % %
306 % % # Advanced options ON
307 % % # BUILD_EXAMPLES ON
308 % % # BUILD_SHARED_LIBS ON
309 % % # VTK_WRAP_PYTHON ON
310 % % # CMAKE_VERBOSE_MAKEFILE TRUE
311 % % # VTK_OPENGL_HAS_OSMESA ON
312 % % # VTK_USE_MANGLED_MESA OFF
313 % % # VTK_USE_OFFSCREEN OFF
314 % %
315 % % sudo make -j2
316 % % sudo make install
317 % % \end{shellCode}
318 % %
319 % % Note: you need to set the following ENV variables in your \filename{/Users/john/.profile} for VTK to work:
320 % % \begin{shellCode}
321 % % export LD_LIBRARY_PATH = /usr/local/VTKBuild/bin: \
322 % % /usr/local/VTKBuild/bin:${LD_LIBRARY_PATH}
323 % % export PYTHONPATH = /usr/local/VTKBuild/Wrapping/Python:\
324 % % /usr/local/VTKBuild/bin:${PYTHONPATH}
325 % %
326 % % # For testing you can run:
327 % % python
328 % % import vtk
329 % % \end{shellCode}
330 %
331 % All that's left to install is triangle and netpbm (required for ppmtompeg) using Macports:
332 % \begin{shellCode}
333 % sudo port install triangle
334 % sudo port install netpbm
335 % \end{shellCode}
336

  ViewVC Help
Powered by ViewVC 1.1.26