This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
howto:compiling_python_2_7_3 [2012/09/17 15:16] adymond [Scipy, minimal install] |
howto:compiling_python_2_7_3 [2021/12/09 16:42] (current) |
||
|---|---|---|---|
| Line 273: | Line 273: | ||
| | | ||
| SUMMARY | SUMMARY | ||
| - | REAL | + | REAL |
| DOUBLE PRECISION 1078039 0 (0.000%) 0 | DOUBLE PRECISION 1078039 0 (0.000%) 0 | ||
| - | COMPLEX 522814 0 (0.000%) 0 | + | COMPLEX |
| COMPLEX16 552410 0 (0.000%) 0 | COMPLEX16 552410 0 (0.000%) 0 | ||
| --> ALL PRECISIONS 3230490 0 (0.000%) 0 | --> ALL PRECISIONS 3230490 0 (0.000%) 0 | ||
| Line 281: | Line 281: | ||
| if all went well | if all went well | ||
| $ cp -iv lib* $HOME/ | $ cp -iv lib* $HOME/ | ||
| + | | ||
| + | To convert the built static libraries to dynamic libraries, the following bash | ||
| + | loop is used | ||
| + | $ for LIB in *.a ; do | ||
| + | DIR=${LIB}_contents | ||
| + | SOLIB=${LIB%.*}.so | ||
| + | echo $SOLIB | ||
| + | mkdir $DIR | ||
| + | cd $DIR | ||
| + | ar -x ../$LIB | ||
| + | cd - | ||
| + | gfortran -shared -Wl, | ||
| + | done; | ||
| + | $ ln -snf librefblas.so libblas.so | ||
| + | |||
| + | Copy the shared object or dynamic libraries to your library folder | ||
| + | $ cp -iv lib*.so $HOME/ | ||
| + | [warning dynamic libaries not fully tested] | ||
| | | ||
| === Numpy building, testing and installation === | === Numpy building, testing and installation === | ||
| Line 289: | Line 307: | ||
| $ tar -xf numpy-1.6.2.tar.gz | $ tar -xf numpy-1.6.2.tar.gz | ||
| $ cd numpy-1.6.2 | $ cd numpy-1.6.2 | ||
| - | | + | |
| + | == build using shared object libraries == | ||
| + | $ echo " | ||
| + | $ echo " | ||
| + | $ echo " | ||
| + | $ python setup.py build --fcompiler=gnu95 | ||
| + | $ python setup.py install | ||
| + | |||
| + | |||
| + | == build using static lapack and blas libraries (for interests sake only) == | ||
| Set blas and lapack paths | Set blas and lapack paths | ||
| $ export ATLAS=None | $ export ATLAS=None | ||
| $ export BLAS=$HOME/ | $ export BLAS=$HOME/ | ||
| $ export LAPACK=$HOME/ | $ export LAPACK=$HOME/ | ||
| - | |||
| Build and install | Build and install | ||
| $ python setup.py build --fcompiler=gnu95 | $ python setup.py build --fcompiler=gnu95 | ||
| - | $ python setup.py install | ||
| - | Then test it (note this requires nose) | + | NB to build without lapack and blas libraries, do the following |
| - | $ cd ~ | + | $ export ATLAS=None |
| + | $ export BLAS=None | ||
| + | $ export LAPACK=None | ||
| + | then build | ||
| + | |||
| + | speed difference: using LAPACK and BLAS libraries numpy testing takes between | ||
| + | 10 and 12s, without the libraries numpy.test() | ||
| + | of time? | ||
| + | |||
| + | == testing == | ||
| + | $ mkdir -p / | ||
| + | $ python setup.py install --prefix=/ | ||
| $ ipython | $ ipython | ||
| - | | + | |
| - | $ numpy.test() | + | $ sys.path.insert(0,'/ |
| - | + | $ import numpy | |
| - | + | | |
| + | If all the test were passed, rm the testing directory and install numpy | ||
| + | | ||
| + | $ python setup.py install | ||
| + | |||
| === Scipy, minimal install === | === Scipy, minimal install === | ||
| $ cd ~/scratch | $ cd ~/scratch | ||
| $ wget http:// | $ wget http:// | ||
| - | $ tar -xf scipy-0.10.1.tar.gz | + | $ tar -xf scipy-0.10.1.tar.gz |
| $ cd scipy-0.10.1/ | $ cd scipy-0.10.1/ | ||
| - | Set blas and lapack paths | + | |
| - | $ export ATLAS=None | + | |
| - | $ export BLAS=$HOME/ | + | |
| - | $ export LAPACK=$HOME/ | + | |
| - | Build it, which takes a while | + | |
| - | | + | |
| - | Install it | + | |
| - | $ python setup.py install | + | |
| - | + | testing, | |
| - | Once the build has been successfully completed, its time to install and test | + | $ mkdir -p /tmp/$USER/scipy-0.10.1 |
| - | scipy | + | $ python setup.py install |
| - | $ python setup.py install | + | |
| - | | + | |
| $ ipython | $ ipython | ||
| - | | + | |
| - | $ scipy.test() | + | $ sys.path.insert(0,'/ |
| + | $ import scipy | ||
| + | | ||
| which did not work 100 % :( | which did not work 100 % :( | ||
| FAILED (KNOWNFAIL=13, | FAILED (KNOWNFAIL=13, | ||
| Out[2]: < | Out[2]: < | ||
| + | If testing satisfactory, | ||
| + | $ rm -r / | ||
| + | $ python setup.py install | ||
| ==== matplotlib / pylab ==== | ==== matplotlib / pylab ==== | ||