File: srcmac.tex

package info (click to toggle)
python-escript 5.6-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144,304 kB
  • sloc: python: 592,074; cpp: 136,909; ansic: 18,675; javascript: 9,411; xml: 3,384; sh: 738; makefile: 207
file content (231 lines) | stat: -rw-r--r-- 6,918 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Copyright (c) 2003-2018 by The University of Queensland
% http://www.uq.edu.au
%
% Primary Business: Queensland, Australia
% Licensed under the Apache License, version 2.0
% http://www.apache.org/licenses/LICENSE-2.0
%
% Development until 2012 by Earth Systems Science Computational Center (ESSCC)
% Development 2012-2013 by School of Earth Sciences
% Development from 2014 by Centre for Geoscience Computing (GeoComp)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Installing from source for \macosx}
\label{sec:srcmac}

Before you start installing from source you will need \macosx development tools installed on your Mac.
This will ensure that you have the following available:
\begin{itemize}
\item \file{g++} and associated tools.
\item \file{make}
\end{itemize}

Here are the instructions on how to install these.
\begin{enumerate}
\item Insert the \macosx 10.5 (Leopard) DVD
\item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools
\item Follow the instructions in the Installer
\item Authenticate as the administrative user (the first user you create when setting up \macosx has administrator privileges by default)
\end{enumerate}


Once these tools have been installed, follow the linux instructions in Section~\ref{sec:prelim}.
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.

% You will also need a copy of the \esfinley source code.
% 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.
% For additional visualization functionality see Section~\ref{sec:addfunc}.
% 
% These instructions will produce the following directory structure:
% \begin{itemize}
%  \item[] \file{stand}: \begin{itemize}
%   \item[] \file{escript.d}
%   \item[] \file{pkg}
%   \item[] \file{pkg_src}
%   \item[] \file{build}
%   \item[] \file{doc}
%  \end{itemize}
% \end{itemize}
% 
% The following instructions assume you are running the \file{bash} shell.
% Comments are indicated with \# characters. 
% 
% 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
% 
% \begin{shellCode}
% mkdir stand
% cd stand
% export PKG_ROOT=`pwd`/pkg
% \end{shellCode}
% 
% Copy compressed source bundles into \file{stand/package_src}.
% Copy documentation files into \file{doc}.
% 
% \begin{shellCode}
% mkdir packages
% mkdir build
% cd build
% tar -jxf ../pkg_src/Python-2.6.2.tar.bz2
% tar -jxf ../pkg_src/boost_1_39_0.tar.bz2
% tar -zxf ../pkg_src/scons-1.2.0.tar.gz
% tar -zxf ../pkg_src/numpy-1.3.0.tar.gz
% tar -zxf ../pkg_src/netcdf-4.0.tar.gz
% tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz
% \end{shellCode}
% 
% \begin{itemize}
% 
% \item Build python:
% \begin{shellCode}
% cd Python*
% ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \
%   | tee tt.configure.out
% make 
% make install 2>&1 | tee tt.make.out
% 
% cd ..
% 
% export PATH=$PKG_ROOT/python/bin:$PATH
% export PYTHONHOME=$PKG_ROOT/python
% export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH
% 
% pushd ../pkg
% ln -s python-2.6.2/ python
% popd
% \end{shellCode}
% 
% Run the new python executable to make sure it works.
% 
% \item Now build NumPy:
% \begin{shellCode}
% cd numpy-1.3.0
% python setup.py build
% python setup.py install --prefix $PKG_ROOT/numpy-1.3.0
% cd ..
% pushd ../pkg
% ln -s numpy-1.3.0 numpy
% popd
% export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH
% \end{shellCode}
% 
% \item Next build scons:
% \begin{shellCode}
% cd scons-1.2.0
% python setup.py install --prefix=$PKG_ROOT/scons-1.2.0
% 
% export PATH=$PKG_ROOT/scons/bin:$PATH
% cd ..
% pushd ../pkg
% ln -s scons-1.2.0 scons
% popd
% \end{shellCode}
% 
% \item The Boost libraries...:
% \begin{shellCode}
% pushd ../pkg
% mkdir boost_1_39_0
% ln -s boost_1_39_0 boost
% popd
% cd boost_1_39_0
% ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost
% ./bjam
% ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib
% export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH
% cd ..
% pushd ../pkg/boost/lib/
% ln -s libboost_python*-1_39.dylib libboost_python.dylib
% popd
% \end{shellCode}
% 
% \item ...and NetCDF:
% \begin{shellCode}
% cd netcdf-4.0
% CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \
% FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \
% ./configure --prefix=$PKG_ROOT/netcdf-4.0
% 
% make 
% make install
% 
% export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH
% cd ..
% pushd ../pkg
% ln -s netcdf-4.0 netcdf
% popd
% \end{shellCode}
% 
% \item Finally matplotlib:
% \begin{shellCode}
% cd matplotlib-0.98.5.3
% python setup.py build
% python setup.py install --prefix=$PKG_ROOT/matplotlib-0.98.5.3
% cd ..
% pushd ../pkg
% ln -s matplotlib-0.98.5.3 matplotlib
% popd
% cd ..
% \end{shellCode}
% \end{itemize}
% 
% \subsection{Compiling escript}\label{sec:compileescriptmac}
% 
% Change to the directory containing your escript source (\file{stand/escript.d}), then:
% 
% \begin{shellCode}
% cd escript.d/scons
% cp TEMPLATE_linux.py YourMachineName_options.py
% 
% echo $PKG_ROOT
% \end{shellCode}
% 
% Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line.
% For example:
% \begin{shellCode}
% PKG_ROOT="/Users/bob/stand/pkg"
% \end{shellCode}
% 
% \begin{shellCode}
% cd ../bin
% \end{shellCode}
% 
% Modify the STANDALONE line of \file{escript} to read:
%  
% STANDALONE=1
% 
% Start a new terminal and go to the \file{stand} directory.
% 
% \begin{shellCode}
% export PATH=$(pwd)/pkg/scons/bin:$PATH
% cd escript.d
% eval $(bin/run-escript -e)
% scons
% \end{shellCode}
% 
% If you wish to test your build, then you can do the following. 
% Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
% \begin{shellCode}
% scons all_tests
% \end{shellCode}
% 
% Once you are satisfied, the \file{build} and \file{\$PKG_ROOT/build} directories can be removed.
% Within the \file{packages} directory, the \file{scons}, \file{scons-1.2.0} entries can also be removed.
% If you are not redistributing this bundle you can remove \file{\$PKG_ROOT/package_src}.
% 
% If you do not plan to edit or recompile the source you can remove it.
% The only entries which are required in \file{escript.d} are:
% \begin{itemize}
%  \item \file{bin}
%  \item \file{esys}
%  \item \file{include}
%  \item \file{lib}
%  \item \file{README_LICENSE}
% \end{itemize}
% 
% Hidden files can be removed with
% \begin{shellCode}
% find . -name '.?*' | xargs rm -rf
% \end{shellCode}