User Tools

Site Tools


howto:python:start

Python

.profile

source .bashrc

.bashrc :

export PATH=$HOME/bin:$PATH

#gcc 4.7.2
module add gcc/4.7.2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

# Python 2.6.5 on /opt/gridware
export PATH=/opt/gridware/python2.6.5/bin:$PATH
export LD_LIBRARY_PATH=/opt/gridware/python2.6.5/lib/:$LD_LIBRARY_PATH

Thats it. The /opt/gridware python comes with nose, ipython, and numpy. However numpy is a little broken :

$ ipython
$ import numpy
$ numpy.test()

Installing packages

Assuming your codes are to be run on the dell cluster, add the following lines to your .bashrc file

#if feature=dell check still needs to be added
export PYTHONPATH=~/local_dell/lib/python:~/local_dell/lib/python2.6/site-packages/
export PATH=$HOME/local_dell/bin:$PATH

create the required directories

$ mkdir -p $HOME/local_dell/lib/python2.6/site-packages/
$ mkdir -p $HOME/local_dell/bin

setuptools

Use for tool for managing and install Python packages. Setuptool provides the easy_install command

$ cd tmp
$ wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
$ tar -xf setuptools-0.6c11.tar.gz
$ cd setuptools-0.6c11
$ python setup.py install --prefix=$HOME/local_dell

argparse

From the login node (which has http access) simply

$ easy_install --prefix=$HOME/local_dell argparse

numpy (minimal)

$ msub -I -l feature=dell
$ cd ~/tmp
$ ssh login01 wget http://tenet.dl.sourceforge.net/project/numpy/NumPy/1.6.2/numpy-1.6.2.tar.gz
$ mv ../numpy-1.6.2.tar.gz ./
$ tar -xf numpy-1.6.2.tar.gz
$ cd numpy-1.6.2
$ export ATLAS=None
$ export BLAS=None
$ export LAPACK=None
$ python setup.py build --fcompiler=gnu95
$ python setup.py install --prefix=$HOME/local_dell

when testing you should get

$ ipython
  import numpy
  numpy.test()
Ran 3568 tests in 11.266s

OK (KNOWNFAIL=5, SKIP=1)
Out[3]: <nose.result.TextTestResult run=3568 errors=0 failures=0>

scipy (minimal)

$ msub -I -l feature=dell
$ cd ~/tmp
$ ssh login01 wget http://tenet.dl.sourceforge.net/project/scipy/scipy/0.10.1/scipy-0.10.1.tar.gz
$ mv ../scipy-0.10.1.tar.gz ./
$ tar -xf scipy-0.10.1.tar.gz
$ cd scipy-0.10.1/
$ python setup.py build --fcompiler=gnu95 #takes about 10 minutes to build
$ python setup.py install --prefix=$HOME/local_dell

testing,

$ cd ~/
$ ipython
  import scipy
  scipy.__path__
  scipy.test()

which did not work 100 % :(

FAILED (KNOWNFAIL=13, SKIP=41, failures=2) Out[2]: <nose.result.TextTestResult run=5101 errors=0 failures=1>

matplotlib / pylab

$ msub -I -l feature=dell
$ cd ~/tmp
$ ssh login01 wget http://ufpr.dl.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.2.0/matplotlib-1.2.0.tar.gz
$ mv ../matplotlib-1.2.0.tar.gz ./
$ tar -xf matplotlib-1.2.0.tar.gz
$ cd matplotlib-1.2.0
$ python setup.py install --prefix=$HOME/local_dell

mpi4py

Is already installed, all that is needed is to load the openmpi module; add the following line to .bashrc

module add openmpi-1.6.1-intel
/var/www/wiki/data/pages/howto/python/start.txt · Last modified: 2013/01/17 15:26 by adymond