|
Most Python installation kit is very simple, just need to execute "python setup.py install" command. However, since these two numpy SciPy and scientific computing package dependencies is more, the installation process is more complicated. Online tutorials more confusing, but just do not use basic. After careful study of each bag README and INSTALL, finally installed successfully. Now recorded as follows.
System environment:
OS: RedHat5
Python version: Python2.7.3
gcc Version: 4.1.2
Each package version:
scipy-0.11.0
numpy-1.6.2
nose-1.2.1
lapack-3.4.2
atlas-3.10.0
Dependencies: scipy installation relies on numpy, lapack, atlas (the latter two are linear algebra toolkit clear themselves of google ...) while running sci numpy and testing procedures are also dependent on the nose, Thus, the entire installation must be performed according to the order, otherwise it is impossible to perform forever.
installation steps:
1, the installation nose
The installation is relatively simple, unzip the installation file nose, nose into the directory, you can run directly setup.py:
tar -zxvf nose-1.2.1.tar.gz
cd nose-1.2.1
python setup.py install
2, the installation lapack
Since the latest version of the ATLAS can be integrated directly lapack compressed installation files are compiled, so if you only use in python, you can not install lapack. Just download the zip file: lapack-3.4.2.tgz can.
3, installation ATLAS
The installation of the main configuration options, including 64-bit library files configured, location-independent and shared libraries. Detailed configuration instructions in the installation package atlas pdf file doc / under the. Available.
The following are my installation process:
tar -jxvf atlas3.10.0.tar.bz2
cd ATLAS
mkdir obj64
../configure -b 64 -Fa alg -fPIC installation path -shared --prefix = / configuration atlas of / atlas --with-netlib-lapack-tarfile = / lapack installation compressed file directory /lapack-3.4.2 .tgz
(Note: This configuration is very long, the Core i7 processing, about one hour or so)
make
(Here are some of the inspection process to ensure that there is no problem after re-installation)
make check
make time
make install
So far, atlas installation is complete. But we want to record the compilation process used fortran compiler type, when the information in the following installation numpy and scipy of use. Or in the catalog obj64 / under execution
fgrep 'F77 =' Make.inc
We can see the F77 = gfortran
Write down this compiler type gfortran.
4. Install numpy
numpy and the installation process scipy be used to explicitly specify the type of fortran compiler, but also coincides atlas (herein, namely: gfortran) previously compiled, it is very important, otherwise it will be wrong a lot of features.
First, the configuration file location site.cfg numpy directory, specify atlas libraries:
tar -zxvf numpy-1.6.2.tar.gz
cd numpy-1.6.2
cp site.cfg.example site.cfg
vim site.cfg
Arranged in the following format:
[DEFAULT]
library_dirs = / usr / local / lib: / install directory atlas of / atlas / lib
include_dirs = / usr / local / include: / atlas installation directory / include
[Blas_opt]
libraries = f77blas, cblas, atlas
[Lapack_opt]
libraries = lapack, f77blas, cblas, atlas
[Amd]
amd_libs = amd
[Umfpack]
umfpack_libs = umfpack
Next, configure the required installation numpy Fortran compiler type:
If previously obtained Fortran compiler is gfortran, then execute:
pythonsetup.py build --fcompiler = gnu95
If previously obtained g77 Fortran compiler is then performed:
python setup.py build --fcompiler = gnu
And then do
python setup.py install
The installation is complete
5, the installation scipy
And install numpy similar:
tar -zxvf scipy-0.11.0.tar.gz
cd scipy-0.11.0
vim site.cfg
Arranged in the following format:
[DEFAULT]
library_dirs = / usr / local / lib: / install directory atlas of / atlas / lib
include_dirs = / usr / local / include: / atlas installation directory / include
[Blas_opt]
libraries = f77blas, cblas, atlas
[Lapack_opt]
libraries = lapack, f77blas, cblas, atlas
[Amd]
amd_libs = amd
[Umfpack]
umfpack_libs = umfpack
Next, configure the required installation numpy Fortran compiler type:
If previously obtained Fortran compiler is gfortran, then execute:
python setup.py build --fcompiler = gnu95
If previously obtained g77 Fortran compiler is then performed:
python setup.py build --fcompiler = gnu
And then do
python setup.py install
The installation is complete
You can then perform the appropriate test program in python:
python
>>> Import nose
>>> Import numpy
>>> Import scipy
>>> Numpy.test ( 'full')
wait. . . .
>>> Scipy.test ( 'full')
Here, the entire installation process is complete. |
|
|
|