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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2868 - (show annotations)
Mon Jan 25 04:44:45 2010 UTC (9 years, 7 months ago) by artak
File MIME type: application/x-tex
File size: 6237 byte(s)
Some fixes for 3.1 release. Notes about Snow Leopard is added and installing from ports removed.
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

  ViewVC Help
Powered by ViewVC 1.1.26