This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
guide:compiling_python_2_7_3 [2012/04/12 17:27] hamish [Installing Packages] |
guide:compiling_python_2_7_3 [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Installing Python 2.7.3 from source on the Sun Tsessbe Cluster ====== | + | Page moved to [[howto:compiling_python_2_7_3|Installing |
| - | + | ||
| - | Before following this guide read through the README file located in the Python Source Install Folder. Also it recommended | + | |
| - | export LD_LIBRARY_PATH=$HOME/ | + | |
| - | export LD_LIBRARY_PATH=$HOME/ | + | |
| - | export PATH=$HOME/ | + | |
| - | export LDFLAGS=" | + | |
| - | export CPPFLAGS=" | + | |
| - | export CXXFLAGS=$CPPFLAGS | + | |
| - | export F77=gfortran | + | |
| - | + | ||
| - | log out and in again, | + | |
| - | $ gcc --version | + | |
| - | gcc (GCC) 4.6.2 | + | |
| - | + | ||
| - | ===== Prerequisites | + | |
| - | + | ||
| - | Before compiling | + | |
| - | + | ||
| - | $ cd ~/scratch | + | |
| - | $ wget http:// | + | |
| - | $ tar -xf zlib-1.2.6.tar.gz | + | |
| - | $ cd zlib-1.2.6 | + | |
| - | $ make | + | |
| - | Test it! | + | |
| - | $ make check | + | |
| - | Install if all tests passes | + | |
| - | $ make install | + | |
| - | + | ||
| - | ===== Download Source ===== | + | |
| - | + | ||
| - | $ cd ~/scratch | + | |
| - | $ wget http:// | + | |
| - | $ tar -xf Python-2.7.3.tgz | + | |
| - | + | ||
| - | ===== Configuration ===== | + | |
| - | + | ||
| - | $ cd ~/ | + | |
| - | $ mkdir BUILD | + | |
| - | $ cd BUILD | + | |
| - | $ ../ | + | |
| - | + | ||
| - | ===== Build ===== | + | |
| - | + | ||
| - | $ make | + | |
| - | + | ||
| - | If errors occur such as | + | |
| - | * g++: Internal error: Killed (program cc1plus) | + | |
| - | wait a while and then make again, as the process was killed by the usage limiter which runs on the login node. If nessary try the approach shown in [[guide: | + | |
| - | + | ||
| - | ===== Check ===== | + | |
| - | + | ||
| - | $ make test | + | |
| - | + | ||
| - | No news is good news: If this test command completes with out an error you know that Python has been compiled successfully. | + | |
| - | + | ||
| - | ===== Install ===== | + | |
| - | + | ||
| - | $ make install | + | |
| - | + | ||
| - | Add the following to the end of your .bashrc file | + | |
| - | # Python 2.7.3 installed in home directory | + | |
| - | PYTHONPATH=~/ | + | |
| - | + | ||
| - | Log in and out, then | + | |
| - | $ python | + | |
| - | Python 2.7.3 (default, Apr 12 2012, 12:03:56) | + | |
| - | [GCC 4.6.2] on linux2 | + | |
| - | Type " | + | |
| - | >>> | + | |
| - | + | ||
| - | ===== Installing Packages ===== | + | |
| - | + | ||
| - | Before beginning make sure bash environmental variables do not cause a conflict | + | |
| - | unset CPPFLAGS | + | |
| - | unset LDFLAGS | + | |
| - | + | ||
| - | === iPython === | + | |
| - | + | ||
| - | $ cd ~/scratch | + | |
| - | $ wget http:// | + | |
| - | $ tar -xf ipython-0.12.tar.gz | + | |
| - | $ cd ipython-0.12 | + | |
| - | $ python setup.py install --prefix=$HOME | + | |
| - | + | ||
| - | provided your $HOME/bin in your PATH variable, ipython should now be available | + | |
| - | + | ||
| - | === Nose === | + | |
| - | + | ||
| - | $ cd ~/scratch | + | |
| - | $ wget http:// | + | |
| - | $ tar -xf nose-1.1.2.tar.gz | + | |
| - | $ cd nose-1.1.2 | + | |
| - | $ python setup.py install --prefix=$HOME | + | |
| - | + | ||
| - | === Numpy === | + | |
| - | + | ||
| - | Before beginning compile the LAPACK and BLAS librariess as in [[guide: | + | |
| - | $lapack-3.4.0> | + | |
| - | + | ||
| - | Download the last version of numpy source, in your scratch folder. Extract it, run python setup.py install --prefix=$HOME. Then test it (note this requires nose) | + | |
| - | $ cd ~ | + | |
| - | $ ipython | + | |
| - | $ import numpy | + | |
| - | $ numy.test() | + | |
| - | + | ||
| - | === matplotlib / pylab === | + | |
| - | + | ||
| - | Download latest version from source forge (version 1.1 in this case) | + | |
| - | $ cd $MATPLOTLIB_FOLDER | + | |
| - | $ python setup.py install # --prefix=$HOME is not required as this option used to install python itself | + | |
| - | | + | |