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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2328 by artak, Fri Mar 20 03:40:56 2009 UTC revision 2538 by caltinay, Fri Jul 17 06:24:15 2009 UTC
# Line 1  Line 1 
   
1  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2  %  %
3  % Copyright (c) 2003-2008 by University of Queensland  % Copyright (c) 2003-2008 by University of Queensland
# Line 14  Line 13 
13  \section{Installing from source for \macosx}  \section{Installing from source for \macosx}
14  \label{sec:srcmac}  \label{sec:srcmac}
15    
16  First of all before you start installing from source you will need Mac OS X development tools installed on your Mac. This will ensure that you have  the following installed:  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}  \begin{itemize}
19  \item \filename{g++} and associated tools.  \item \filename{g++} and associated tools.
20  \item \filename{make}  \item \filename{make}
21  \end{itemize}  \end{itemize}
22    
23  Here are the instruction on how to install them.  Here are the instructions on how to install these.
24  \begin{enumerate}  \begin{enumerate}
25  \item Insert the Mac OS X v10.5 (Leopard) DVD.  \item Insert the \macosx 10.5 (Leopard) DVD
26  \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools.  \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools
27  \item Follow the instructions in the Installer.  \item Follow the instructions in the Installer
28  \item Authenticate as the administrative user. The first user you create when setting up Mac OS X has administrator privileges by default.  \item Authenticate as the administrative user (the first user you create when setting up \macosx has administrator privileges by default)
29  \end{enumerate}  \end{enumerate}
30    
31  You will also need a copy of the \esfinley source code.  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.  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 visualisation functionality see Section~\ref{sec:macaddfunc}.  For additional visualisation functionality see \Sec{sec:macaddfunc}.
34    
35  These instructions will produce the following structure:  These instructions will produce the following directory structure:
36  \begin{itemize}  \begin{itemize}
37  \item \filename{stand}: \begin{itemize}   \item[] \filename{stand}: \begin{itemize}
38  \item \filename{escript.d}    \item[] \filename{escript.d}
39  \item \filename{packages}    \item[] \filename{packages}
40  \item \filename{package_src}    \item[] \filename{package_src}
41  \item \filename{build}    \item[] \filename{build}
42  \item \filename{doc}    \item[] \filename{doc}
43    \end{itemize}   \end{itemize}
44  \end{itemize}  \end{itemize}
45    
 The build directory can be removed when you are finished.  
   
46  The following instructions assume you are running the \filename{bash} shell.  The following instructions assume you are running the \filename{bash} shell.
47  Comments are indicated with \# characters.  Comments are indicated with \# characters.
48    
# Line 74  tar -zxf ../package_src/cmake-2.6.3.tar. Line 72  tar -zxf ../package_src/cmake-2.6.3.tar.
72  tar -zxf ../package_src/scons-1.2.0.tar.gz  tar -zxf ../package_src/scons-1.2.0.tar.gz
73  \end{shellCode}  \end{shellCode}
74    
75  Build python.  \begin{itemize}
76    
77    \item Build python:
78  \begin{shellCode}  \begin{shellCode}
79  cd Python*  cd Python*
80    
# Line 104  export LD_LIBRARY_PATH=$PKG_ROOT/python/ Line 104  export LD_LIBRARY_PATH=$PKG_ROOT/python/
104  pushd ../packages  pushd ../packages
105  ln -s python-2.6.1/ python  ln -s python-2.6.1/ python
106  popd  popd
   
107  \end{shellCode}  \end{shellCode}
108    
109  Run python to make sure~(check the version number) it works.  Run python to make sure it works (check the version number).
110  Now build numarray.  
111    \item Now build numarray:
112    
113  \begin{shellCode}  \begin{shellCode}
114  cd numarray-1.5.2  cd numarray-1.5.2
# Line 138  ln -s scons-1.2.0 scons Line 138  ln -s scons-1.2.0 scons
138  popd  popd
139  \end{shellCode}  \end{shellCode}
140    
141  ...Boost libraries ...  \item The Boost libraries...:
142  \begin{shellCode}  \begin{shellCode}
143  cd boost_1_38_0  cd boost_1_38_0
144    
# Line 155  ln -s boost_1_38_0 boost Line 155  ln -s boost_1_38_0 boost
155  popd  popd
156  \end{shellCode}  \end{shellCode}
157    
158  ... and netcdf.  \item ...and NetCDF:
159  \begin{shellCode}  \begin{shellCode}
160  cd netcdf-4.0  cd netcdf-4.0
161  CFLAGS="-O2 fPIC -Df2cFortran" CXXFLAGS="-O2 fPIC -Df2cFortran" \  CFLAGS="-O2 fPIC -Df2cFortran" CXXFLAGS="-O2 fPIC -Df2cFortran" \
# Line 172  ln -s netcdf-4.0 netcdf Line 172  ln -s netcdf-4.0 netcdf
172  popd  popd
173  \end{shellCode}  \end{shellCode}
174    
175  CMake and Mesa are required for VTK.  \item CMake is required to build VTK:
176  \begin{shellCode}  \begin{shellCode}
177  cd cmake-2.6.3  cd cmake-2.6.3
178  ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure  ./configure --prefix=$PKG_ROOT/cmake-2.6.3 2>&1 | tee tt.configure
# Line 186  ln -s cmake-2.6.3 cmake Line 186  ln -s cmake-2.6.3 cmake
186  popd  popd
187  \end{shellCode}  \end{shellCode}
188    
189  These instructions do not compile MesaDemos or GLUT.  \item VTK also requires Mesa:
 If you need to check if Mesa compiled correctly, then the demos are a good test.  
190  \begin{shellCode}  \begin{shellCode}
191  cd Mesa-7.2  cd Mesa-7.2
192  ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa  ./configure --prefix=$PKG_ROOT/mesa-7.2 --enable-gl-osmesa
# Line 202  ln -s mesa-7.2 mesa Line 201  ln -s mesa-7.2 mesa
201  popd  popd
202  \end{shellCode}  \end{shellCode}
203    
204    These instructions do not compile MesaDemos or GLUT.
205    If you need to check if Mesa compiled correctly, then the demos are a good test.
206    
207    \item Now build VTK:
208  \begin{shellCode}  \begin{shellCode}
209  cd VTK  cd VTK
210  cmake .  cmake .
# Line 262  ln -s vtk-5.2.1 vtk Line 265  ln -s vtk-5.2.1 vtk
265  cd ..  cd ..
266  \end{shellCode}  \end{shellCode}
267    
268  Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.  \item Finally, build escript:\\
269    Copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.
270    
271  \begin{shellCode}  \begin{shellCode}
272  cd scons  cd scons
# Line 307  eval `bin/escript -e` Line 311  eval `bin/escript -e`
311  scons  scons
312  \end{shellCode}  \end{shellCode}
313    
314    \end{itemize}
315    
316  If you wish to test your build, then you can do the following.  If you wish to test your build, then you can do the following.
317  Note this may take a while if you have a slow processor and/or less than 1Gb of RAM.  Note this may take a while if you have a slow processor and/or less than 1GB of RAM.
318  \begin{shellCode}  \begin{shellCode}
319  scons all_tests  scons all_tests
320  \end{shellCode}  \end{shellCode}
# Line 321  If you do not plan to edit or recompile Line 327  If you do not plan to edit or recompile
327  The only entries which are required in \filename{escript.d} are:  The only entries which are required in \filename{escript.d} are:
328  \begin{itemize}  \begin{itemize}
329   \item \filename{bin}   \item \filename{bin}
330  \item \filename{esys}   \item \filename{esys}
331  \item \filename{include}   \item \filename{include}
332  \item \filename{lib}   \item \filename{lib}
333  \item \filename{README_LICENSE}   \item \filename{README_LICENSE}
334  \end{itemize}  \end{itemize}
335    
336  Hidden files can be removed with  Hidden files can be removed with
# Line 337  To perform visualisations you will need Line 343  To perform visualisations you will need
343  Since these do not need to be linked with any of the packages above, you can install versions available for your  Since these do not need to be linked with any of the packages above, you can install versions available for your
344  system, or build them from source.  system, or build them from source.
345  \begin{itemize}  \begin{itemize}
346  \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite. - To build from source  \item \filename{ppmtompeg} and \filename{jpegtopnm} from the \filename{netpbm} suite - to build from source
347  you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers.  you would also need \filename{libjpeg} and its headers as well as \filename{libpng}\footnote{libpng requires zlib to build} and its headers
348  \item A tool to visualise VTK files. For example Mayavi or Visit.  \item A tool to visualise VTK files - for example Mayavi or Visit
349  \end{itemize}  \end{itemize}
350    
351    
352  \section{Installing from source for \macosx with the help of Macports}  \section{Installing from source for \macosx using Macports}
353  \label{sec:srcmacports}  \label{sec:srcmacports}
354    
355  As we mentioned in the Section~\ref{sec:srcmac}, before you start installing from source you will need Mac OS X development tools installed on your Mac.  As we mentioned in \Sec{sec:srcmac}, before you start installing from source you will need \macosx development tools installed on your Mac.
356    If you do not have Macports already, please install Macports from \url{www.macports.org}. You can also install porticus (GUI for Macports).
 If you do not have Macports already, please install Macports from \url{www.macports.org} . You can also install porticus (GUI for Macports).  
357    
358  Once you have Macports working Install boost using porticus or from terminal  Once you have Macports working install boost using porticus or from the terminal
359  \begin{shellCode}  \begin{shellCode}
360  sudo port install boost@1.35.0_2+complete  sudo port install boost@1.35.0_2+complete
361  \end{shellCode}  \end{shellCode}
# Line 368  cd scons-0.98.5 Line 373  cd scons-0.98.5
373  python setup.py install  python setup.py install
374  \end{shellCode}  \end{shellCode}
375    
376  Note: Do not try to install scons using porticus or sudo port install scons, because if automatically installs another python version and you are likely run into problems with different python versions.    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.  
377    
378  Download numarray-1.5.2.tar.gz from \url{http://www.stsci.edu/resources/software_hardware/numarray/numarray.html}.  Download numarray-1.5.2.tar.gz from \\
379    \url{http://www.stsci.edu/resources/software_hardware/numarray/numarray.html}.
380  \begin{shellCode}  \begin{shellCode}
381  tar xfz numarray-1.5.2.tar.gz  tar xfz numarray-1.5.2.tar.gz
382  cd numarray-1.5.2  cd numarray-1.5.2
383  python setup.py install --gencode  2>&1 | tee tt.install.out  python setup.py install --gencode  2>&1 | tee tt.install.out
384  \end{shellCode}  \end{shellCode}
385    
386  You can ran a test to check numarray installation by  You can run a test to check the numarray installation by
387  \begin{shellCode}  \begin{shellCode}
388  python  python
389  import numarray.testall as testall  import numarray.testall as testall
# Line 398  Downlaod gmsh-2.2.3-source.tar and insta Line 404  Downlaod gmsh-2.2.3-source.tar and insta
404  \end{shellCode}  \end{shellCode}
405  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.  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.
406  \begin{shellCode}  \begin{shellCode}
407  sudo make j2  sudo make -j2
408  sudo make install  sudo make install
409  \end{shellCode}  \end{shellCode}
410    
# Line 413  sudo make -j 2 Line 419  sudo make -j 2
419  make install  make install
420  \end{shellCode}  \end{shellCode}
421    
422  Install vtk-5.0.4 from source. If you install from ports it won't configure to use shared libraries. Once you untar it you will have (assume user is john) /Users/john/Downloads/VTK folder, then run following:  Install vtk-5.0.4 from source. If you install from ports it won't configure to use shared libraries.
423    Once you untar it you will have (assume user is john) /Users/john/Downloads/VTK folder, then run the following:
424    
425  \begin{shellCode}  \begin{shellCode}
426  sudo mkdir /usr/local/VTKBuild/  sudo mkdir /usr/local/VTKBuild/
# Line 430  sudo ccmake /Users/john/Downloads/VTK/ Line 437  sudo ccmake /Users/john/Downloads/VTK/
437  #       VTK_USE_MANGLED_MESA            OFF  #       VTK_USE_MANGLED_MESA            OFF
438  #       VTK_USE_OFFSCREEN           OFF  #       VTK_USE_OFFSCREEN           OFF
439    
440  sudo make j2  sudo make -j2
441  sudo make install  sudo make install
442  \end{shellCode}  \end{shellCode}
443    
444  Note: you need to set following ENV variables into your \filename{/Users/john/.profile} for VTK to work:  Note: you need to set the following ENV variables in your \filename{/Users/john/.profile} for VTK to work:
445  \begin{shellCode}  \begin{shellCode}
446  export LD_LIBRARY_PATH = /usr/local/VTKBuild/bin: \  export LD_LIBRARY_PATH = /usr/local/VTKBuild/bin: \
447               /usr/local/VTKBuild/bin:${LD_LIBRARY_PATH}               /usr/local/VTKBuild/bin:${LD_LIBRARY_PATH}
# Line 446  python Line 453  python
453  import vtk  import vtk
454  \end{shellCode}  \end{shellCode}
455    
456  Left only to install triangle and netpbm (required for ppmtompeg) using Macports  All that's left to install is triangle and netpbm (required for ppmtompeg) using Macports:
457  \begin{shellCode}  \begin{shellCode}
458  sudo port install triangle  sudo port install triangle
459  sudo port install netpbm  sudo port install netpbm
460  \end{shellCode}  \end{shellCode}
   
   
461    

Legend:
Removed from v.2328  
changed lines
  Added in v.2538

  ViewVC Help
Powered by ViewVC 1.1.26