hachikoweitong 发表于 2013-04-19 21:29

安装scipy找不到ATLAS,BLAS,Lapack

CenOS 6.4,安装了python2.7.3
PS:我是按照这个贴http://www.zhangchun.org/the-centos6-3-upgrade-python-to-2-7-3-version/ ,升级到python2.7.3


我用yum安装了atlas和lapack,blas
Package atlas-3.8.4-2.el6.x86_64 already installed and latest version
Package lapack-3.2.1-4.el6.x86_64 already installed and latest version
Package blas-3.2.1-4.el6.x86_64 already installed and latest version

但是python setup.py install 那个scipy时老是找不到这些库,为何.
Running from scipy source directory.
blas_opt_info:
blas_mkl_info:
libraries mkl,vml,guide not found in ['/usr/lib64']
NOT AVAILABLE

atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64']
NOT AVAILABLE

atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64']
NOT AVAILABLE

/usr/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1494: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
blas_info:
Replacing _lib_names=='blas' with 'blas.so.3.2'
libraries blas.so.3.2 not found in ['/usr/lib64']
NOT AVAILABLE

/usr/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1503: UserWarning:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS environment variable.
warnings.warn(BlasNotFoundError.__doc__)
blas_src_info:
NOT AVAILABLE

/usr/local/lib/python2.7/site-packages/numpy/distutils/system_info.py:1506: UserWarning:
Blas (http://www.netlib.org/blas/) sources not found.
Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS_SRC environment variable.
warnings.warn(BlasSrcNotFoundError.__doc__)
raise self.notfounderror(self.notfounderror.__doc__)
numpy.distutils.system_info.BlasNotFoundError:
Blas (http://www.netlib.org/blas/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS environment variable.

ts32767 发表于 2013-04-19 21:59

注意看出错的提示信息:

Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS environment variable.

库的安装可能没有问题,但是目录不对,你要在numpy/distutils/site.cfg 文件中指定BLAS的路径。

hachikoweitong 发表于 2013-04-20 08:41

能告诉如何指定吗?
我查找文件在/usr/lib64里面找到了liblapack.so.3以及/usr/lib64/atlas里面一些libatlas.so.3.2,libf77blas.so.3.0等文件。

我就在site.cfg里面将default设了这些路径,可还是不行啊

library_dirs =/usr/lib64
include_dirs =/usr/lib64/atlas

ts32767 发表于 2013-04-20 09:43

根据错误信息的描述,仔细看看,看不懂用翻译软件:

Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS_SRC environment variable.

Directories to search for the sources can be specified in the
numpy/distutils/site.cfg file (section ) or by setting
the BLAS_SRC environment variable.

在site.cfg中,在这一节,要设置两个环境变量,一个是BLAS,一个是BLAS_SRC,分别指向BLAS的库目录可源文件目录。

hachikoweitong 发表于 2013-04-20 10:42

本帖最后由 hachikoweitong 于 2013-04-20 10:53 编辑

那这个作何解?我设的路径里面有这些东西啊. 另外我不知道你看过numpy的site.cfg文件没有,里面没有关于BLAS或BLAS-SRC路径设置的。
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64']
NOT AVAILABLE

atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/usr/lib64/atlas', '/usr/lib64/sse2', '/usr/lib64']
NOT AVAILABLE


附上site.cfg的全文吧。(我知道#是注释。实际需要删除#)
# This file provides configuration information about non-Python dependencies for
# numpy.distutils-using packages. Create a file like this called "site.cfg" next
# to your package's setup.py file and fill in the appropriate sections. Not all
# packages will use all sections so you should leave out sections that your
# package does not use.

# To assist automatic installation like easy_install, the user's home directory
# will also be checked for the file ~/.numpy-site.cfg .

# The format of the file is that of the standard library's ConfigParser module.
#
#   http://www.python.org/doc/current/lib/module-ConfigParser.html
#
# Each section defines settings that apply to one particular dependency. Some of
# the settings are general and apply to nearly any section and are defined here.
# Settings specific to a particular section will be defined near their section.
#
#   libraries
#       Comma-separated list of library names to add to compile the extension
#       with. Note that these should be just the names, not the filenames. For
#       example, the file "libfoo.so" would become simply "foo".
#         libraries = lapack,f77blas,cblas,atlas
#
#   library_dirs
#       List of directories to add to the library search path when compiling
#       extensions with this dependency. Use the character given by os.pathsep
#       to separate the items in the list. Note that this character is known to
#       vary on some unix-like systems; if a colon does not work, try a comma.
#       This also applies to include_dirs and src_dirs (see below).
#       On UN*X-type systems (OS X, most BSD and Linux systems):
#         library_dirs = /usr/lib:/usr/local/lib
#       On Windows:
#         library_dirs = c:\mingw\lib,c:\atlas\lib
#       On some BSD and Linux systems:
#         library_dirs = /usr/lib,/usr/local/lib
#
#   include_dirs
#       List of directories to add to the header file earch path.
#         include_dirs = /usr/include:/usr/local/include
#
#   src_dirs
#       List of directories that contain extracted source code for the
#       dependency. For some dependencies, numpy.distutils will be able to build
#       them from source if binaries cannot be found. The FORTRAN BLAS and
#       LAPACK libraries are one example. However, most dependencies are more
#       complicated and require actual installation that you need to do
#       yourself.
#         src_dirs = /home/rkern/src/BLAS_SRC:/home/rkern/src/LAPACK_SRC
#
#   search_static_first
#       Boolean (one of (0, false, no, off) for False or (1, true, yes, on) for
#       True) to tell numpy.distutils to prefer static libraries (.a) over
#       shared libraries (.so). It is turned off by default.
#         search_static_first = false

# Defaults
# ========
# The settings given here will apply to all other sections if not overridden.
# This is a good place to add general library and include directories like
# /usr/local/{lib,include}
#
#
#library_dirs = /usr/local/lib
#include_dirs = /usr/local/include

# Optimized BLAS and LAPACK
# -------------------------
# Use the blas_opt and lapack_opt sections to give any settings that are
# required to link against your chosen BLAS and LAPACK, including the regular
# FORTRAN reference BLAS and also ATLAS. Some other sections still exist for
# linking against certain optimized libraries (e.g. , ),
# however, they are now deprecated and should not be used.
#
# These are typical configurations for ATLAS (assuming that the library and
# include directories have already been set in ; the include directory
# is important for the BLAS C interface):
#
#
#libraries = f77blas, cblas, atlas
#
#
#libraries = lapack, f77blas, cblas, atlas
#
# If your ATLAS was compiled with pthreads, the names of the libraries might be
# different:
#
#
#libraries = ptf77blas, ptcblas, atlas
#
#
#libraries = lapack, ptf77blas, ptcblas, atlas


# UMFPACK
# -------
# The UMFPACK library is used in scikits.umfpack to factor large sparse matrices.
# It, in turn, depends on the AMD library for reordering the matrices for
# better performance.Note that the AMD library has nothing to do with AMD
# (Advanced Micro Devices), the CPU company.
#
# UMFPACK is not needed for numpy or scipy.
#
#   http://www.cise.ufl.edu/research/sparse/umfpack/
#   http://www.cise.ufl.edu/research/sparse/amd/
#   http://scikits.appspot.com/umfpack
#
#
#amd_libs = amd
#
#
#umfpack_libs = umfpack


# FFT libraries
# -------------
# There are two FFT libraries that we can configure here: FFTW (2 and 3) and djbfft.
# Note that these libraries are not needed for numpy or scipy.
#
#   http://fftw.org/
#   http://cr.yp.to/djbfft.html
#
# Given only this section, numpy.distutils will try to figure out which version
# of FFTW you are using.
#
#libraries = fftw3
#
# For djbfft, numpy.distutils will look for either djbfft.a or libdjbfft.a .
#
#include_dirs = /usr/local/djbfft/include
#library_dirs = /usr/local/djbfft/lib


# MKL
#----
# For recent (9.0.21, for example) mkl, you need to change the names of the
# lapack library. Assuming you installed the mkl in /opt, for a 32 bits cpu:
#
# library_dirs = /opt/intel/mkl/9.1.023/lib/32/
# lapack_libs = mkl_lapack
#
# For 10.*, on 32 bits machines:
#
# library_dirs = /opt/intel/mkl/10.0.1.014/lib/32/
# lapack_libs = mkl_lapack
# mkl_libs = mkl, guide

hachikoweitong 发表于 2013-04-20 11:00

本帖最后由 hachikoweitong 于 2013-04-20 13:02 编辑

回复 4# ts32767

我承认我是linux菜鸟,所以请你多指教。


   

ts32767 发表于 2013-04-20 21:49

本帖最后由 ts32767 于 2013-04-20 22:00 编辑

回复 6# hachikoweitong


我也是个新手,你给出的编译出错信息都是warnning,有一部分warning是跟Fortran77库有关的(带有f77)可以不管。
另外一部分,你可以手动搜索一下那些so是不是真的没有。

我google了一下,有个老外遇到的问题是一样的,numpy的专家们是这么答复的.

The scipy webpage itself helps and provides setup instructions. You need to download, and then compile the fortran files, and finally link them to one lib which must then be on your search path when installing scipy:mkdir -p ~/src/
cd ~/src/
wget http://www.netlib.org/blas/blas.tgz
tar xzf blas.tgz
cd BLAS

## NOTE: The selected fortran compiler must be consistent for BLAS, LAPACK, NumPy, and SciPy.
## For GNU compiler on 32-bit systems:
#g77 -O2 -fno-second-underscore -c *.f                     # with g77
#gfortran -O2 -std=legacy -fno-second-underscore -c *.f    # with gfortran
## OR for GNU compiler on 64-bit systems:
#g77 -O3 -m64 -fno-second-underscore -fPIC -c *.f                     # with g77
gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f    # with gfortran
## OR for Intel compiler:
#ifort -FI -w90 -w95 -cm -O3 -unroll -c *.f

# Continue below irrespective of compiler:
ar r libfblas.a *.o
ranlib libfblas.a
rm -rf *.o
export BLAS=~/src/BLAS/libfblas.aThis is straight from the aforementioned webpage. Execute only one of the five g77/gfortran/ifort commands. I have commented out all but the gfortran which I use. The subsequent lapack installation requires a fortran 90 compiler, and since both installs should use the same fortran compiler, g77 should not be used for blas.

Next, you'll need to install the LAPACK stuff. The webpage's instructions do not fully work for me, but are a good guide. So here's what I did using gfortran in my gcc installation:mkdir -p ~/src
cd ~/src/
wget http://www.netlib.org/lapack/lapack.tgz
tar xzf lapack.tgz
cd lapack-*/
cp INSTALL/make.inc.gfortran make.inc          # on Linux with lapack-3.2.1 or newer
make lapacklib
make clean
export LAPACK=~/src/LAPACK/libflapack.a

hachikoweitong 发表于 2013-04-23 10:47

我后来没有仔细深究一些路径问题了。
今天按照这个帖子,一步步下来,竟然成功了。
http://memo.yomukaku.net/entries/jbRkQkq

回复 7# ts32767


   

Ecore 发表于 2014-05-29 13:01

安装LAPACK
gfortran -O3 -std=legacy -m64 -fno-second-underscore -fPIC -c *.f
ar r libflapack.a *.o
ranlib libflapack.a
rm -rf *.o
cp libflapack.a /usr/lib64/
export LAPACK=/usr/lib64/libflapack.a
页: [1]
查看完整版本: 安装scipy找不到ATLAS,BLAS,Lapack