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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3335 - (show annotations)
Wed Nov 3 05:02:57 2010 UTC (8 years, 4 months ago) by jfenwick
File MIME type: application/x-tex
File size: 6739 byte(s)
Fix the launcher so that it can give an environment even if buildvars is not present.
Environment now includes scons for standalone builds.
Fixes and cleanup for the install documentation.
scons TEMPLATES updated to define the optionfile version by default.

...mumble
   finley no longer imports escript into the default namespace
...
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Copyright (c) 2003-2010 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 \file{g++} and associated tools.
20 \item \file{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
32 Once these tools have been installed, follow the linux instructions in Section~\ref{sec:prelim}.
33 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.
34
35 % You will also need a copy of the \esfinley source code.
36 % 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.
37 % For additional visualization functionality see Section~\ref{sec:addfunc}.
38 %
39 % These instructions will produce the following directory structure:
40 % \begin{itemize}
41 % \item[] \file{stand}: \begin{itemize}
42 % \item[] \file{escript.d}
43 % \item[] \file{pkg}
44 % \item[] \file{pkg_src}
45 % \item[] \file{build}
46 % \item[] \file{doc}
47 % \end{itemize}
48 % \end{itemize}
49 %
50 % The following instructions assume you are running the \file{bash} shell.
51 % Comments are indicated with \# characters.
52 %
53 % 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
54 %
55 % \begin{shellCode}
56 % mkdir stand
57 % cd stand
58 % export PKG_ROOT=`pwd`/pkg
59 % \end{shellCode}
60 %
61 % Copy compressed source bundles into \file{stand/package_src}.
62 % Copy documentation files into \file{doc}.
63 %
64 % \begin{shellCode}
65 % mkdir packages
66 % mkdir build
67 % cd build
68 % tar -jxf ../pkg_src/Python-2.6.2.tar.bz2
69 % tar -jxf ../pkg_src/boost_1_39_0.tar.bz2
70 % tar -zxf ../pkg_src/scons-1.2.0.tar.gz
71 % tar -zxf ../pkg_src/numpy-1.3.0.tar.gz
72 % tar -zxf ../pkg_src/netcdf-4.0.tar.gz
73 % tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz
74 % \end{shellCode}
75 %
76 % \begin{itemize}
77 %
78 % \item Build python:
79 % \begin{shellCode}
80 % cd Python*
81 % ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \
82 % | tee tt.configure.out
83 % make
84 % make install 2>&1 | tee tt.make.out
85 %
86 % cd ..
87 %
88 % export PATH=$PKG_ROOT/python/bin:$PATH
89 % export PYTHONHOME=$PKG_ROOT/python
90 % export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH
91 %
92 % pushd ../pkg
93 % ln -s python-2.6.2/ python
94 % popd
95 % \end{shellCode}
96 %
97 % Run the new python executable to make sure it works.
98 %
99 % \item Now build NumPy:
100 % \begin{shellCode}
101 % cd numpy-1.3.0
102 % python setup.py build
103 % python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
104 % cd ..
105 % pushd ../pkg
106 % ln -s numpy-1.3.0 numpy
107 % popd
108 % export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
109 % \end{shellCode}
110 %
111 % \item Next build scons:
112 % \begin{shellCode}
113 % cd scons-1.2.0
114 % python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
115 %
116 % export PATH=$PKG_ROOT/scons/bin:$PATH
117 % cd ..
118 % pushd ../pkg
119 % ln -s scons-1.2.0 scons
120 % popd
121 % \end{shellCode}
122 %
123 % \item The Boost libraries...:
124 % \begin{shellCode}
125 % pushd ../pkg
126 % mkdir boost_1_39_0
127 % ln -s boost_1_39_0 boost
128 % popd
129 % cd boost_1_39_0
130 % ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost
131 % ./bjam
132 % ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
133 % export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
134 % cd ..
135 % pushd ../pkg/boost/lib/
136 % ln -s libboost_python*-1_39.dylib libboost_python.dylib
137 % popd
138 % \end{shellCode}
139 %
140 % \item ...and NetCDF:
141 % \begin{shellCode}
142 % cd netcdf-4.0
143 % CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
144 % FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
145 % ./configure --prefix=$PKG_ROOT/netcdf-4.0
146 %
147 % make
148 % make install
149 %
150 % export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
151 % cd ..
152 % pushd ../pkg
153 % ln -s netcdf-4.0 netcdf
154 % popd
155 % \end{shellCode}
156 %
157 % \item Finally matplotlib:
158 % \begin{shellCode}
159 % cd matplotlib-0.98.5.3
160 % python setup.py build
161 % python setup.py install --prefix=$PKG_ROOT/matplotlib-0.98.5.3
162 % cd ..
163 % pushd ../pkg
164 % ln -s matplotlib-0.98.5.3 matplotlib
165 % popd
166 % cd ..
167 % \end{shellCode}
168 % \end{itemize}
169 %
170 % \subsection{Compiling escript}\label{sec:compileescriptmac}
171 %
172 % Change to the directory containing your escript source (\file{stand/escript.d}), then:
173 %
174 % \begin{shellCode}
175 % cd escript.d/scons
176 % cp TEMPLATE_linux.py YourMachineName_options.py
177 %
178 % echo $PKG_ROOT
179 % \end{shellCode}
180 %
181 % Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
182 % For example:
183 % \begin{shellCode}
184 % PKG_ROOT="/Users/bob/stand/pkg"
185 % \end{shellCode}
186 %
187 % \begin{shellCode}
188 % cd ../bin
189 % \end{shellCode}
190 %
191 % Modify the STANDALONE line of \file{escript} to read:
192 %
193 % STANDALONE=1
194 %
195 % Start a new terminal and go to the \file{stand} directory.
196 %
197 % \begin{shellCode}
198 % export PATH=$(pwd)/pkg/scons/bin:$PATH
199 % cd escript.d
200 % eval $(bin/run-escript -e)
201 % scons
202 % \end{shellCode}
203 %
204 % If you wish to test your build, then you can do the following.
205 % Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
206 % \begin{shellCode}
207 % scons all_tests
208 % \end{shellCode}
209 %
210 % Once you are satisfied, the \file{build} and \file{\$PKG_ROOT/build} directories can be removed.
211 % Within the \file{packages} directory, the \file{scons}, \file{scons-1.2.0} entries can also be removed.
212 % If you are not redistributing this bundle you can remove \file{\$PKG_ROOT/package_src}.
213 %
214 % If you do not plan to edit or recompile the source you can remove it.
215 % The only entries which are required in \file{escript.d} are:
216 % \begin{itemize}
217 % \item \file{bin}
218 % \item \file{esys}
219 % \item \file{include}
220 % \item \file{lib}
221 % \item \file{README_LICENSE}
222 % \end{itemize}
223 %
224 % Hidden files can be removed with
225 % \begin{shellCode}
226 % find . -name '.?*' | xargs rm -rf
227 % \end{shellCode}
228
229

  ViewVC Help
Powered by ViewVC 1.1.26