User Tools

Site Tools


guide:compiling_python_2_7_3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
guide:compiling_python_2_7_3 [2012/04/13 13:31]
hamish [Install]
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 Python from source]].
- +
-Before following this guide read through the README file located in the Python Source Install Folder. Also it recommended to make use of temporary or scratch directory to do all the compilation in (i.e. ~/scratch or /tmp/$USER), as to save disk space in your home directory. This guide assumes GCC 4.6.2 has been installed in your home directory as  in [[guide:compiling_gcc|Compiling GCC from Source]]. Ensure that the following lines at the end of your ./bashrc file +
-  export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH +
-  export LD_LIBRARY_PATH=$HOME/lib64:$LD_LIBRARY_PATH +
-  export PATH=$HOME/bin:$PATH +
-  export LDFLAGS="-L$HOME/lib64 -L$HOME/lib" +
-  export CPPFLAGS="-I$HOME/include -L$HOME/lib64 -L$HOME/lib" +
-  export CXXFLAGS=$CPPFLAGS +
-  export F77=gfortran +
- +
-log out and in again,  +
-  $  gcc --version +
-  gcc (GCC) 4.6.2 +
- +
-===== Prerequisites  ===== +
- +
-Before compiling Python, the zlib library needs to installed. +
- +
-  $ cd ~/scratch +
-  $ wget http://zlib.net/zlib-1.2.6.tar.gz +
-  $ 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://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz +
-  $ tar -xf Python-2.7.3.tgz +
-   +
-===== Configuration ===== +
- +
-   $ cd ~/scratch/Python-2.7.3.tgz +
-   $ mkdir BUILD +
-   $ cd BUILD +
-   $ ../configure --prefix=$HOME  +
-   +
-===== 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:compiling_gcc#compiling_gcc|Compiling GCC from Source]]. +
- +
-===== 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 +
-   +
-If your PATH environmental variable is configure to include $HOME/bin, then  +
-  $ python +
-  Python 2.7.3 (default, Apr 12 2012, 12:03:56)  +
-  [GCC 4.6.2] on linux2 +
-  Type "help", "copyright", "credits" or "license" for more information. +
-  >>>  +
-   +
-===== Installing Packages ===== +
- +
-Before beginning make sure bash environmental variables do not cause a conflict +
-  unset CPPFLAGS +
-  unset LDFLAGS +
- +
-=== iPython === +
- +
-  $ cd ~/scratch +
-  $ wget http://archive.ipython.org/release/0.12/ipython-0.12.tar.gz +
-  $ tar -xf ipython-0.12.tar.gz +
-  $ cd ipython-0.12 +
-  $ python setup.py install +
-   +
-provided your $HOME/bin in your PATH variable, ipython should now be available +
-   +
-=== Nose === +
- +
-  $ cd ~/scratch +
-  $ wget http://pypi.python.org/packages/source/n/nose/nose-1.1.2.tar.gz#md5=144f237b615e23f21f6a50b2183aa817 +
-  $ tar -xf nose-1.1.2.tar.gz +
-  $ cd nose-1.1.2 +
-  $ python setup.py install +
- +
-=== Numpy === +
- +
-Before beginning compile the LAPACK and BLAS librariess as in [[guide:compiling_octave|Compiling Octave 3.4.3 from Source]], and copy libraries to $HOME.lib: +
-  $lapack-3.4.0> cp lib* $HOME/lib +
- +
-Download the last version of numpy source, in your scratch folder. Extract it, run python setup.py install. 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  +
-   +
-=== Scipy === +
- +
-Based on the guide found on a [[http://www.scipy.org/Installing_SciPy/Linux#head-bfec1665faa2c3686b5b56162bb2ddc36c47a9ba|Scipy installation website]], the following needs to be done +
-  $ cd ~/scratch +
-  $ wget http://netlib.org/atlas/atlas3.6.0.tgz +
-  $ tar -xf http://netlib.org/atlas/atlas3.6.0.tgz +
-  $ cd ATLAS +
-  $ make +
-Follow the instructions, remember that compiled atlas is required to run on multiple x64 artichetures depending upon the partition the MOAB job manager submits the job: So dont tune the codes to use artitecture specfic features on the login node. You should also recieve performance warnings, i ignored these as an 80% efficient ATLAS is acceptable for my needs. +
- +
-The make file produced (Make.Linux_HAMMER64SSE2) after running make, requires one or two tweaks, i did the following  +
-  - changed the F77 compiler to gfortran +
-  - added -fPIC to the F77FLAGS +
-then beginning with make (this will take a couple of hours) +
-  $ make install arch=Linux_HAMMER64SSE2 +
- +
-There is a version of ATLAS already compiled under /opt/gridware/utils/, which can be located using the find command as follows +
-  $ find /opt/gridware/utils/ -name libatlas.a +
-I suspect these ATLAS libraries are compiled using the GCC 4.1.2 20070115 (SUSE Linux) compilers, and as such wont be compatible with GCC 4.6 compilers. +
- +
-Before beginning the scipy installation, make sure numpy is installed, and clear some possibly conflicting bash environmental variables +
-  unset CPPFLAGS LDFLAGS +
-   +
-Then +
-  $ cd ~/scratch +
-  $ wget http://tenet.dl.sourceforge.net/project/scipy/scipy/0.10.1/scipy-0.10.1.tar.gz +
-  $ tar -xf scipy-0.10.1.tar.gz  +
-  $ cd scipy-0.10.1/ +
-  $ export ATLAS=~/scratch/ATLAS/lib/Linux_HAMMER64SSE2/ +
-  $ python setup.py build +
- +
-Once the build has been successfully completed, its time to install and test scipy +
-  $ python setup.py install +
-  $ python +
-  $ import scipy +
-  $ scipy.test() +
- +
-  +
/app/dokuwiki/data/attic/guide/compiling_python_2_7_3.1334316677.txt.gz · Last modified: 2021/12/09 16:42 (external edit)