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

Legend:
Removed from v.3334  
changed lines
  Added in v.3335

  ViewVC Help
Powered by ViewVC 1.1.26