/[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 2333 by jfenwick, Wed Mar 25 02:15:11 2009 UTC revision 2536 by caltinay, Thu Jul 16 23:53:07 2009 UTC
# Line 14  Line 14 
14  \section{Installing from source for \macosx}  \section{Installing from source for \macosx}
15  \label{sec:srcmac}  \label{sec:srcmac}
16    
17  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.
18    This will ensure that you have the following available:
19  \begin{itemize}  \begin{itemize}
20  \item \filename{g++} and associated tools.  \item \filename{g++} and associated tools.
21  \item \filename{make}  \item \filename{make}
22  \end{itemize}  \end{itemize}
23    
24  Here are the instruction on how to install them.  Here are the instructions on how to install these.
25  \begin{enumerate}  \begin{enumerate}
26  \item Insert the Mac OS X v10.5 (Leopard) DVD.  \item Insert the \macosx 10.5 (Leopard) DVD
27  \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools.  \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools
28  \item Follow the instructions in the Installer.  \item Follow the instructions in the Installer
29  \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)
30  \end{enumerate}  \end{enumerate}
31    
32  You will also need a copy of the \esfinley source code.  You will also need a copy of the \esfinley source code.
33  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.
34  For additional visualisation functionality see Section~\ref{sec:macaddfunc}.  For additional visualisation functionality see Section~\ref{sec:macaddfunc}.
35    
36  These instructions will produce the following structure:  These instructions will produce the following directory structure:
37  \begin{itemize}  \begin{itemize}
38  \item \filename{stand}: \begin{itemize}   \item[] \filename{stand}: \begin{itemize}
39  \item \filename{escript.d}    \item[] \filename{escript.d}
40  \item \filename{packages}    \item[] \filename{packages}
41  \item \filename{package_src}    \item[] \filename{package_src}
42  \item \filename{build}    \item[] \filename{build}
43  \item \filename{doc}    \item[] \filename{doc}
44    \end{itemize}   \end{itemize}
45  \end{itemize}  \end{itemize}
46    
 The build directory can be removed when you are finished.  
   
47  The following instructions assume you are running the \filename{bash} shell.  The following instructions assume you are running the \filename{bash} shell.
48  Comments are indicated with \# characters.  Comments are indicated with \# characters.
49    
# Line 74  tar -zxf ../package_src/cmake-2.6.3.tar. Line 73  tar -zxf ../package_src/cmake-2.6.3.tar.
73  tar -zxf ../package_src/scons-1.2.0.tar.gz  tar -zxf ../package_src/scons-1.2.0.tar.gz
74  \end{shellCode}  \end{shellCode}
75    
76  Build python.  \begin{itemize}
77    
78    \item Build python:
79  \begin{shellCode}  \begin{shellCode}
80  cd Python*  cd Python*
81    
# Line 104  export LD_LIBRARY_PATH=$PKG_ROOT/python/ Line 105  export LD_LIBRARY_PATH=$PKG_ROOT/python/
105  pushd ../packages  pushd ../packages
106  ln -s python-2.6.1/ python  ln -s python-2.6.1/ python
107  popd  popd
   
108  \end{shellCode}  \end{shellCode}
109    
110  Run python to make sure~(check the version number) it works.  Run python to make sure it works (check the version number).
111  Now build numarray.  
112    \item Now build numarray:
113    
114  \begin{shellCode}  \begin{shellCode}
115  cd numarray-1.5.2  cd numarray-1.5.2
# Line 138  ln -s scons-1.2.0 scons Line 139  ln -s scons-1.2.0 scons
139  popd  popd
140  \end{shellCode}  \end{shellCode}
141    
142  ...Boost libraries ...  \item The Boost libraries...:
143  \begin{shellCode}  \begin{shellCode}
144  cd boost_1_38_0  cd boost_1_38_0
145    
# Line 155  ln -s boost_1_38_0 boost Line 156  ln -s boost_1_38_0 boost
156  popd  popd
157  \end{shellCode}  \end{shellCode}
158    
159  ... and netcdf.  \item ...and NetCDF:
160  \begin{shellCode}  \begin{shellCode}
161  cd netcdf-4.0  cd netcdf-4.0
162  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 173  ln -s netcdf-4.0 netcdf
173  popd  popd
174  \end{shellCode}  \end{shellCode}
175    
176  CMake and Mesa are required for VTK.  \item CMake is required to build VTK:
177  \begin{shellCode}  \begin{shellCode}
178  cd cmake-2.6.3  cd cmake-2.6.3
179  ./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 187  ln -s cmake-2.6.3 cmake
187  popd  popd
188  \end{shellCode}  \end{shellCode}
189    
190  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.  
191  \begin{shellCode}  \begin{shellCode}
192  cd Mesa-7.2  cd Mesa-7.2
193  ./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 202  ln -s mesa-7.2 mesa
202  popd  popd
203  \end{shellCode}  \end{shellCode}
204    
205    These instructions do not compile MesaDemos or GLUT.
206    If you need to check if Mesa compiled correctly, then the demos are a good test.
207    
208    \item Now build VTK:
209  \begin{shellCode}  \begin{shellCode}
210  cd VTK  cd VTK
211  cmake .  cmake .
# Line 262  ln -s vtk-5.2.1 vtk Line 266  ln -s vtk-5.2.1 vtk
266  cd ..  cd ..
267  \end{shellCode}  \end{shellCode}
268    
269  Now copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.  \item Finally, build escript:\\
270    Copy the \esfinley source into an \filename{escript.d} directory in \filename{stand}.
271    
272  \begin{shellCode}  \begin{shellCode}
273  cd scons  cd scons
# Line 307  eval `bin/escript -e` Line 312  eval `bin/escript -e`
312  scons  scons
313  \end{shellCode}  \end{shellCode}
314    
315    \end{itemize}
316    
317  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.
318  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.
319  \begin{shellCode}  \begin{shellCode}
320  scons all_tests  scons all_tests
321  \end{shellCode}  \end{shellCode}
# Line 321  If you do not plan to edit or recompile Line 328  If you do not plan to edit or recompile
328  The only entries which are required in \filename{escript.d} are:  The only entries which are required in \filename{escript.d} are:
329  \begin{itemize}  \begin{itemize}
330   \item \filename{bin}   \item \filename{bin}
331  \item \filename{esys}   \item \filename{esys}
332  \item \filename{include}   \item \filename{include}
333  \item \filename{lib}   \item \filename{lib}
334  \item \filename{README_LICENSE}   \item \filename{README_LICENSE}
335  \end{itemize}  \end{itemize}
336    
337  Hidden files can be removed with  Hidden files can be removed with
# Line 337  To perform visualisations you will need Line 344  To perform visualisations you will need
344  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
345  system, or build them from source.  system, or build them from source.
346  \begin{itemize}  \begin{itemize}
347  \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
348  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
349  \item A tool to visualise VTK files. For example Mayavi or Visit.  \item A tool to visualise VTK files - for example Mayavi or Visit
350  \end{itemize}  \end{itemize}
351    
352    
353  \section{Installing from source for \macosx using Macports}  \section{Installing from source for \macosx using Macports}
354  \label{sec:srcmacports}  \label{sec:srcmacports}
355    
356  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 Section~\ref{sec:srcmac}, before you start installing from source you will need \macosx development tools installed on your Mac.
   
357  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).
358    
359  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
360  \begin{shellCode}  \begin{shellCode}
361  sudo port install boost@1.35.0_2+complete  sudo port install boost@1.35.0_2+complete
362  \end{shellCode}  \end{shellCode}
# Line 368  cd scons-0.98.5 Line 374  cd scons-0.98.5
374  python setup.py install  python setup.py install
375  \end{shellCode}  \end{shellCode}
376    
377  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.  
378    
379  Download numarray-1.5.2.tar.gz from \\  Download numarray-1.5.2.tar.gz from \\
380  \url{http://www.stsci.edu/resources/software_hardware/numarray/numarray.html}.  \url{http://www.stsci.edu/resources/software_hardware/numarray/numarray.html}.
# Line 378  cd numarray-1.5.2 Line 384  cd numarray-1.5.2
384  python setup.py install --gencode  2>&1 | tee tt.install.out  python setup.py install --gencode  2>&1 | tee tt.install.out
385  \end{shellCode}  \end{shellCode}
386    
387  You can ran a test to check numarray installation by  You can run a test to check the numarray installation by
388  \begin{shellCode}  \begin{shellCode}
389  python  python
390  import numarray.testall as testall  import numarray.testall as testall
# Line 414  sudo make -j 2 Line 420  sudo make -j 2
420  make install  make install
421  \end{shellCode}  \end{shellCode}
422    
423  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.
424    Once you untar it you will have (assume user is john) /Users/john/Downloads/VTK folder, then run the following:
425    
426  \begin{shellCode}  \begin{shellCode}
427  sudo mkdir /usr/local/VTKBuild/  sudo mkdir /usr/local/VTKBuild/
# Line 435  sudo make -j2 Line 442  sudo make -j2
442  sudo make install  sudo make install
443  \end{shellCode}  \end{shellCode}
444    
445  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:
446  \begin{shellCode}  \begin{shellCode}
447  export LD_LIBRARY_PATH = /usr/local/VTKBuild/bin: \  export LD_LIBRARY_PATH = /usr/local/VTKBuild/bin: \
448               /usr/local/VTKBuild/bin:${LD_LIBRARY_PATH}               /usr/local/VTKBuild/bin:${LD_LIBRARY_PATH}
# Line 447  python Line 454  python
454  import vtk  import vtk
455  \end{shellCode}  \end{shellCode}
456    
457  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:
458  \begin{shellCode}  \begin{shellCode}
459  sudo port install triangle  sudo port install triangle
460  sudo port install netpbm  sudo port install netpbm
461  \end{shellCode}  \end{shellCode}
   
   
462    

Legend:
Removed from v.2333  
changed lines
  Added in v.2536

  ViewVC Help
Powered by ViewVC 1.1.26