Changes between Version 2 and Version 3 of CowsFramework/CowsInstallation/CowsPython2.6


Ignore:
Timestamp:
22/09/10 14:37:30 (9 years ago)
Author:
astephen
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CowsFramework/CowsInstallation/CowsPython2.6

    v2 v3  
    77These notes were initially developed as part of the process of porting the COWS stack (== cows + cowsserver + cowsclient) to Python 2.6 and Pylons 1.0 (see the [wiki:CowsFramework/CowsInstallation/MigrationToPython2.6 migration to python 2.6 page]. They also serve as a useful set of guidelines on how to build the COWS stack including a number of dependencies that require some manual intervention in the build process. 
    88 
     9== COWS server and COWS client == 
     10 
     11Since the COWS server dependencies are a superset of the COWS client dependencies you the installation procedure for the COWS server is presented in full and you can infer the subset of requirements for the COWS client. 
     12 
     13== Installing COWS server dependencies == 
     14 
     15The COWS Server compatible with Pylons 1.0 and Python 2.6 has the following dependencies: 
     16 
     17***PUT DEPENDENCIES HERE*** 
     18 
     19== COWS Server installation == 
     20 
     21These instructions suggest installing the COWS server into a [wiki:http://pypi.python.org/pypi/virtualenv virtualenv] self-contained python environment. They also suggest the use of [wiki:http://pypi.python.org/pypi/pip pip] as the installation tool. Alternatively, buildout can be used. 
     22 
     23Note that not everything builds automatically and there are various stages when environment variables need to be set to pick up appropriate versions of packages. 
     24 
     25I have tried to order the dependency list correctly to avoid having to re-build any packages (hopefully!). 
     26 
     27=== 1. Non-python packages === 
     28 
     29netcdf==3.6.3 
     30 
     31# Manually install NetCDF 
     32$ cd $HOME 
     33$ mkdir -p external/netcdf/src 
     34$ cd external/netcdf/src 
     35$ wget http://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-3.6.3.tar.gz 
     36$ tar xvzf netcdf-3.6.3.tar.gz 
     37$ cd netcdf-3.6.3/ 
     38$ ./configure --enable-shared --disable-f90 --disable-f77 --prefix=$HOME/external/netcdf 
     39$ make 
     40$ make install 
     41$ make check 
     42 
     43numpy==1.3.0 numpy-1.3.0-py2.6-linux-x86_64.egg 
     44 
     45easy_install gave errors but pip said fine, trust pip! 
     46 
     47cdat_lite cdat_lite-5.2_1-py2.6-linux-x86_64.egg 
     48 
     49should work as long as it can find NetCDF: 
     50export NETCDF_HOME=$HOME/external/netcdf 
     51 
     52csml-2.7.13-py2.6.egg 
     53 
     54FINE 
     55 
     56cairo==1.2.4 
     57Probably exists on any server, but can be built by Yast 
     58 
     59pycairo==1.2.2 
     60$ Needed to build pycairo compatible with release on westerly of cairo (1.2.4) so used 1.2.2 of pycairo 
     61$ wget http://cairographics.org/releases/pycairo-1.2.2.tar.gz 
     62$ tar xvzf pycairo-1.2.2.tar.gz 
     63$ cd pycairo-1.2.2/ 
     64$ # Need to make this dir for it to install OK 
     65$ mkdir $HOME/python26/lib/pkgconfig 
     66$ python setup.py build 
     67$ python setup.py install 
     68THen tested with a line stolen from geoplot (see: http://proj.badc.rl.ac.uk/ndg/browser/qesdi/geoplot/trunk/lib/geoplot/custom_cairo_renderer.py#L9): 
     69 
     70geos # needed for libgeos_c.so file for python 
     71$ cd 
     72$ cd external 
     73$ wget http://download.osgeo.org/geos/geos-3.2.2.tar.bz2 
     74$ bunzip2 geos-3.2.2.tar.bz2 
     75$ tar xvf geos-3.2.2.tar 
     76$ cd geos-3.2.2 
     77$ mkdir $HOME/external/geos 
     78$ ./configure --prefix=$HOME/external/geos 
     79$ make 
     80$ make install 
     81 
     82Environment needs some of these... 
     83$ export GEOS_DIR=$HOME/external/geos 
     84$ export LD_LIBRARY_PATH=$HOME/external/geos/lib:$HOME/external/geos/lib/libgeos_c.so 
     85 
     86matplotlib matplotlib-1.0.0-py2.6-linux-x86_64.egg 
     87# Followed instructions on basemap and matplotlib at: 
     88http://proj.badc.rl.ac.uk/dcip/wiki/UkcipDdp/Deployment/MatplotlibInstall 
     89 
     90$ diff setup.cfg.template setup.cfg 
     915c5 
     92< tag_svn_revision = 1 
     93--- 
     94> #tag_svn_revision = 1 
     9510c10 
     96< #basedirlist = /usr 
     97--- 
     98> #basedirlist = /disks/westerly1/cow/svn/cowsserver/cowsserver/buildout/matplotlib 
     9975c75 
     100< #backend = Agg 
     101--- 
     102> backend = Cairo 
     10383a84,85 
     104> 
     105> datapath=/disks/westerly1/svn/cowsserver/cowsserver/buildout/matplotlib/mpl-data 
     106export MATPLOTLIBDATA=$HOME/svn/cowsserver/buildout/matplotlib/mpl-data 
     107$ cd buildout 
     108$ cp -r matplotlib/lib/matplotlib/mpl-data matplotlib/ 
     109 
     110basemap basemap-1.0-py2.6-linux-x86_64.egg 
     111# NOW basemap 
     112$ export GEOS_DIR=$HOME/external/geos 
     113$ easy_install -eb . basemap  # this creates a local download to build basemap in 
     114$ cd basemap/ 
     115$ python setupegg.py bdist_egg 
     116$ cp dist/*.egg ../eggs/ 
     117$ cd ../ 
     118$ cp -r basemap/build/lib.linux-x86_64-2.6/mpl_toolkits/basemap/data basemap-data 
     119$ export BASEMAPDATA=$HOME/svn/cowsserver/buildout/basemap-data 
     120Environment seemed to then need: 
     121$ export DBFLIBSO=$HOME/svn/cowsserver/buildout/basemap/build/lib.linux-x86_64-2.6 
     122# SOME TESTS TO RUN - just want to see they don't raise Exceptions 
     123Test 1: 
     124{{{ 
     125from matplotlib.backends.backend_cairo import RendererCairo, FigureCanvasCairo, cairo, Affine2D 
     126}}} 
     127Test 2: 
     128{{{ 
     129import pylab 
     130from mpl_toolkits.basemap import Basemap 
     131b = Basemap() 
     132b.drawcoastlines() 
     133pylab.savefig('map.png') 
     134}}} 
     135Test 3: NEEDS TO BE VERIFIED IN TERMS OF rsphere 
     136{{{ 
     137from mpl_toolkits import basemap 
     138x = basemap.Basemap(llcrnrlon=-10.5,llcrnrlat=49.5,urcrnrlon=3.5,urcrnrlat=59.5, 
     139            resolution='i',projection='tmerc',lon_0=-4.36,lat_0=54.7, 
     140            rsphere=[6370997, 1]) 
     141}}} 
     142 
     143****???**** 
     144 
     145geoplot (latest trunk - under qesdi) - investigate fix in rsphere usage!!!! 
     146{{{ 
     147# From googling (see: http://mapserver.org/errors.html#msprocessprojection-projection-library-error-major-axis-or-radius-0-not-given) it looks like you need to specify the ellipsoid. I tried this using the "rsphere" argument which can be: 
     148 1. A float/int of the earth's radius (DEFAULT = 6370997m) 
     149 2. A sequence of (major_axis, minor_axis) - I got segmentation faults when I tried making these similar, so I used option 3... 
     150 3. The documentation says """Note: sometimes an ellipsoid is specified by the major axis and an inverse flattening parameter (if). The minor axis (b) can be computed from the major axis (a) and the inverse flattening parameter using the formula if = a/(a-b).""" - I set it to (6370997, 1) for now. 
     151**** 
     152}}} 
     153 
     154pil PIL-1.1.7-py2.6-linux-x86_64.egg 
     155image_utils image_utils-1.0-py2.6.egg 
     156 
     157Pylons==1.0 
     158installed: {{{ 
     159Beaker-1.5.4-py2.6.egg 
     160decorator-3.2.0-py2.6.egg 
     161FormEncode-1.2.3dev-py2.6.egg 
     162Mako-0.3.4-py2.6.egg 
     163MarkupSafe-0.11-py2.6-linux-x86_64.egg 
     164Paste-1.7.4-py2.6.egg 
     165PasteDeploy-1.3.4-py2.6.egg 
     166PasteScript-1.7.3-py2.6.egg 
     167Routes-1.12.3-py2.6.egg 
     168simplejson simplejson-2.1.1-py2.6-linux-x86_64.egg 
     169Tempita-0.5dev-py2.6.egg 
     170WebError-0.10.2-py2.6.egg 
     171WebHelpers-1.2-py2.6.egg 
     172WebOb-1.0-py2.6.egg 
     173WebTest-1.2.2-py2.6.egg 
     174}}} 
     175 
     176 
     177mock mock-0.7.0b2-py2.6.egg 
     178nose nose-0.11.4-py2.6.egg 
     179 
     180 
     181Shapely Shapely-1.2.5-py2.6.egg 
     182 
     183Genshi Genshi-0.6-py2.6.egg 
     184   
     185owslib  OWSLib-0.3.1-py2.6.egg 
     186 
     187cows 
     188cowsserver 
     189 
     190# used for testing 
     191###### NOT NEEDED: lxml-2.3beta1-py2.6-linux-x86_64.egg  
     192 
     193libxml2 libxml2-python-2.6.21 
     194Web page says libxml2dom needs libxml2 so found build and installed: 
     195$ cd  
     196$ cd external 
     197$ wget ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.21.tar.gz 
     198$ tar xzvf libxml2-python-2.6.21.tar.gz 
     199$ cd libxml2-python-2.6.21/ 
     200$ python setup.py build 
     201$ python setup.py install 
     202 
     203 
     204libxml2dom libxml2dom-0.4.7-py2.6.egg 
     205 
     206# Test 
     207$ python -c 'import libxml2; import libxml2dom'