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