# Annotation of /trunk/doc/install/srcmac.tex

Revision 6651 - (hide annotations)
Wed Feb 7 02:12:08 2018 UTC (2 years, 9 months ago) by jfenwick
File MIME type: application/x-tex
File size: 6918 byte(s)
Make everyone sad by touching all the files


 1 jfenwick 3989 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 jfenwick 6651 % Copyright (c) 2003-2018 by The University of Queensland 3 jfenwick 3989 4 jfenwick 2289 % 5 % Primary Business: Queensland, Australia 6 jfenwick 6112 % Licensed under the Apache License, version 2.0 7 8 jfenwick 2289 % 9 jfenwick 3989 % Development until 2012 by Earth Systems Science Computational Center (ESSCC) 10 jfenwick 4657 % Development 2012-2013 by School of Earth Sciences 11 % Development from 2014 by Centre for Geoscience Computing (GeoComp) 12 jfenwick 3989 % 13 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 jfenwick 2289 15 \section{Installing from source for \macosx} 16 artak 2326 \label{sec:srcmac} 17 18 caltinay 2536 Before you start installing from source you will need \macosx development tools installed on your Mac. 19 This will ensure that you have the following available: 20 artak 2326 \begin{itemize} 21 jfenwick 3322 \item \file{g++} and associated tools. 22 \item \file{make} 23 artak 2326 \end{itemize} 24 25 caltinay 2536 Here are the instructions on how to install these. 26 artak 2327 \begin{enumerate} 27 caltinay 2536 \item Insert the \macosx 10.5 (Leopard) DVD 28 \item Double-click on XcodeTools.mpkg, located inside Optional Installs/Xcode Tools 29 \item Follow the instructions in the Installer 30 \item Authenticate as the administrative user (the first user you create when setting up \macosx has administrator privileges by default) 31 artak 2327 \end{enumerate} 32 33 artak 2326 34 jfenwick 3335 Once these tools have been installed, follow the linux instructions in Section~\ref{sec:prelim}. 35 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. 36 artak 2326 37 jfenwick 3335 % You will also need a copy of the \esfinley source code. 38 % 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. 39 % For additional visualization functionality see Section~\ref{sec:addfunc}. 40 % 41 % These instructions will produce the following directory structure: 42 % \begin{itemize} 43 % \item[] \file{stand}: \begin{itemize} 44 % \item[] \file{escript.d} 45 % \item[] \file{pkg} 46 % \item[] \file{pkg_src} 47 % \item[] \file{build} 48 % \item[] \file{doc} 49 % \end{itemize} 50 % \end{itemize} 51 % 52 % The following instructions assume you are running the \file{bash} shell. 53 % Comments are indicated with \# characters. 54 % 55 % 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 56 % 57 % \begin{shellCode} 58 % mkdir stand 59 % cd stand 60 % export PKG_ROOT=pwd/pkg 61 % \end{shellCode} 62 % 63 % Copy compressed source bundles into \file{stand/package_src}. 64 % Copy documentation files into \file{doc}. 65 % 66 % \begin{shellCode} 67 % mkdir packages 68 % mkdir build 69 % cd build 70 % tar -jxf ../pkg_src/Python-2.6.2.tar.bz2 71 % tar -jxf ../pkg_src/boost_1_39_0.tar.bz2 72 % tar -zxf ../pkg_src/scons-1.2.0.tar.gz 73 % tar -zxf ../pkg_src/numpy-1.3.0.tar.gz 74 % tar -zxf ../pkg_src/netcdf-4.0.tar.gz 75 % tar -zxf ../pkg_src/matplotlib-0.98.5.3.tar.gz 76 % \end{shellCode} 77 % 78 % \begin{itemize} 79 % 80 % \item Build python: 81 % \begin{shellCode} 82 % cd Python* 83 % ./configure --prefix=$PKG_ROOT/python-2.6.2 --enable-shared 2>&1 \ 84 % | tee tt.configure.out 85 % make 86 % make install 2>&1 | tee tt.make.out 87 % 88 % cd .. 89 % 90 % export PATH=$PKG_ROOT/python/bin:$PATH 91 % export PYTHONHOME=$PKG_ROOT/python 92 % export LD_LIBRARY_PATH=$PKG_ROOT/python/lib:$LD_LIBRARY_PATH 93 % 94 % pushd ../pkg 95 % ln -s python-2.6.2/ python 96 % popd 97 % \end{shellCode} 98 % 99 % Run the new python executable to make sure it works. 100 % 101 % \item Now build NumPy: 102 % \begin{shellCode} 103 % cd numpy-1.3.0 104 % python setup.py build 105 % python setup.py install --prefix $PKG_ROOT/numpy-1.3.0 106 % cd .. 107 % pushd ../pkg 108 % ln -s numpy-1.3.0 numpy 109 % popd 110 % export PYTHONPATH=$PKG_ROOT/numpy/lib/python2.6/site-packages:$PYTHONPATH 111 % \end{shellCode} 112 % 113 % \item Next build scons: 114 % \begin{shellCode} 115 % cd scons-1.2.0 116 % python setup.py install --prefix=$PKG_ROOT/scons-1.2.0 117 % 118 % export PATH=$PKG_ROOT/scons/bin:$PATH 119 % cd .. 120 % pushd ../pkg 121 % ln -s scons-1.2.0 scons 122 % popd 123 % \end{shellCode} 124 % 125 % \item The Boost libraries...: 126 % \begin{shellCode} 127 % pushd ../pkg 128 % mkdir boost_1_39_0 129 % ln -s boost_1_39_0 boost 130 % popd 131 % cd boost_1_39_0 132 % ./bootstrap.sh --with-libraries=python --prefix=$PKG_ROOT/boost 133 % ./bjam 134 % ./bjam install --prefix=$PKG_ROOT/boost --libdir=$PKG_ROOT/boost/lib 135 % export LD_LIBRARY_PATH=$PKG_ROOT/boost/lib:$LD_LIBRARY_PATH 136 % cd .. 137 % pushd ../pkg/boost/lib/ 138 % ln -s libboost_python*-1_39.dylib libboost_python.dylib 139 % popd 140 % \end{shellCode} 141 % 142 % \item ...and NetCDF: 143 % \begin{shellCode} 144 % cd netcdf-4.0 145 % CFLAGS="-O2 -fPIC -Df2cFortran" CXXFLAGS="-O2 -fPIC -Df2cFortran" \ 146 % FFLAGS="-O2 -fPIC -Df2cFortran" FCFLAGS="-O2 -fPIC -Df2cFortran" \ 147 % ./configure --prefix=$PKG_ROOT/netcdf-4.0 148 % 149 % make 150 % make install 151 % 152 % export LD_LIBRARY_PATH=$PKG_ROOT/netcdf/lib:$LD_LIBRARY_PATH 153 % cd .. 154 % pushd ../pkg 155 % ln -s netcdf-4.0 netcdf 156 % popd 157 % \end{shellCode} 158 % 159 % \item Finally matplotlib: 160 % \begin{shellCode} 161 % cd matplotlib-0.98.5.3 162 % python setup.py build 163 % python setup.py install --prefix=$PKG_ROOT/matplotlib-0.98.5.3 164 % cd .. 165 % pushd ../pkg 166 % ln -s matplotlib-0.98.5.3 matplotlib 167 % popd 168 % cd .. 169 % \end{shellCode} 170 % \end{itemize} 171 % 172 % \subsection{Compiling escript}\label{sec:compileescriptmac} 173 % 174 % Change to the directory containing your escript source (\file{stand/escript.d}), then: 175 % 176 % \begin{shellCode} 177 % cd escript.d/scons 178 % cp TEMPLATE_linux.py YourMachineName_options.py 179 % 180 % echo$PKG_ROOT 181 % \end{shellCode} 182 % 183 % Edit the options file and put the value of PKG_ROOT between the quotes in the PKG_ROOT= line. 184 % For example: 185 % \begin{shellCode} 186 % PKG_ROOT="/Users/bob/stand/pkg" 187 % \end{shellCode} 188 % 189 % \begin{shellCode} 190 % cd ../bin 191 % \end{shellCode} 192 % 193 % Modify the STANDALONE line of \file{escript} to read: 194 % 195 % STANDALONE=1 196 % 197 % Start a new terminal and go to the \file{stand} directory. 198 % 199 % \begin{shellCode} 200 % export PATH=$(pwd)/pkg/scons/bin:$PATH 201 % cd escript.d 202 % eval $(bin/run-escript -e) 203 % scons 204 % \end{shellCode} 205 % 206 % If you wish to test your build, then you can do the following. 207 % Note this may take a while if you have a slow processor and/or less than 1GB of RAM. 208 % \begin{shellCode} 209 % scons all_tests 210 % \end{shellCode} 211 % 212 % Once you are satisfied, the \file{build} and \file{\$PKG_ROOT/build} directories can be removed. 213 % Within the \file{packages} directory, the \file{scons}, \file{scons-1.2.0} entries can also be removed. 214 % If you are not redistributing this bundle you can remove \file{\\$PKG_ROOT/package_src}. 215 % 216 % If you do not plan to edit or recompile the source you can remove it. 217 % The only entries which are required in \file{escript.d} are: 218 % \begin{itemize} 219 % \item \file{bin} 220 % \item \file{esys} 221 % \item \file{include} 222 % \item \file{lib} 223 % \item \file{README_LICENSE} 224 % \end{itemize} 225 % 226 % Hidden files can be removed with 227 % \begin{shellCode} 228 % find . -name '.?*' | xargs rm -rf 229 % \end{shellCode} 230 artak 2327 231