Python SciPy에 BLAS가 필요합니까?
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 [blas]) or by setting
the BLAS environment variable.
이 사이트에서 어떤 타르를 다운로드해야합니까?
fortrans를 시도했지만 환경 변수를 분명히 설정 한 후이 오류가 계속 발생합니다.
SciPy는 웹 페이지 구축 및 설치 지침을 제공하는 데 사용하지만,이 지침은 이제 OS 바이너리 배포판에 의존하고 있습니다. 필수 라이브러리의 사전 컴파일 된 패키지없이 운영 체제에서 SciPy (및 NumPy)를 빌드하려면 Fortran 라이브러리 BLAS 및 LAPACK 을 빌드 한 후 정적으로 링크해야합니다 .
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.a
5 개의 g77 / gfortran / ifort 명령 중 하나만 실행하십시오. 나는 모든 것을 언급했지만 내가 사용하는 gfortran. 후속 LAPACK 설치에는 Fortran 90 컴파일러 가 필요하며 두 설치 모두 동일한 Fortran 컴파일러를 사용해야하므로 g77을 BLAS에 사용해서는 안됩니다.
다음으로 LAPACK을 설치해야합니다. SciPy 웹 페이지의 지침이 여기에도 도움이되었지만 환경에 맞게 수정해야했습니다.
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-*/liblapack.a
검증 어떤 코멘트 오늘 (모두에게 감사) : 업데이트 3 - 9 월 2015 실행하기 전에 make lapacklib
편집에게 make.inc
파일을 추가 -fPIC
로 옵션 OPTS
및 NOOPT
설정. 64 비트 아키텍처를 사용 중이거나 컴파일하려는 경우을 추가하십시오 -m64
. BLAS 및 LAPACK은 이러한 옵션을 동일한 값으로 설정하여 컴파일해야합니다. -fPIC
SciPy 를 잊어 버린 경우 실제로 누락 된 심볼에 대한 오류를 표시하고이 스위치를 권장합니다. make.inc
내 설정에서 특정 섹션은 다음과 같습니다.
FORTRAN = gfortran
OPTS = -O2 -frecursive -fPIC -m64
DRVOPTS = $(OPTS)
NOOPT = -O0 -frecursive -fPIC -m64
LOADER = gfortran
구형 컴퓨터 (예 : RedHat 5)에서 gfortran은 이전 버전 (예 : 4.1.2)으로 설치되었을 수 있으며 옵션을 이해하지 못합니다 -frecursive
. make.inc
이러한 경우 파일에서 간단히 제거하십시오 .
The lapack test target of the Makefile fails in my setup because it cannot find the blas libraries. If you are thorough you can temporarily move the blas library to the specified location to test the lapack. I'm a lazy person, so I trust the devs to have it working and verify only in SciPy.
If you need to use the latest versions of SciPy rather than the packaged version, without going through the hassle of building BLAS and LAPACK, you can follow the below procedure.
Install linear algebra libraries from repository (for Ubuntu),
sudo apt-get install gfortran libopenblas-dev liblapack-dev
Then install SciPy, (after downloading the SciPy source): python setup.py install
or
pip install scipy
As the case may be.
On Fedora, this works:
yum install lapack lapack-devel blas blas-devel
pip install numpy
pip install scipy
Remember to install 'lapack-devel' and 'blas-devel' in addition to 'blas' and 'lapack' otherwise you'll get the error you mentioned or the "numpy.distutils.system_info.LapackNotFoundError" error.
I guess you are talking about installation in Ubuntu. Just use:
apt-get install python-numpy python-scipy
That should take care of the BLAS libraries compiling as well. Else, compiling the BLAS libraries is very difficult.
For Windows users there is a nice binary package by Chris (warning: it's a pretty large download, 191 MB):
Following the instructions given by 'cfi' works for me, although there are a few pieces they left out that you might need:
1) Your lapack directory, after unzipping, may be called lapack-X-Y (some version number), so you can just rename that to LAPACK.
cd ~/src
mv lapack-[tab] LAPACK
2) In that directory, you may need to do:
cd ~/src/LAPACK
cp lapack_LINUX.a libflapack.a
Try using
sudo apt-get install python3-scipy
참고URL : https://stackoverflow.com/questions/7496547/does-python-scipy-need-blas
'IT story' 카테고리의 다른 글
문자열에 C #의 문자 만 포함되어 있는지 확인 (0) | 2020.05.23 |
---|---|
PHP에서 동적 변수 이름에 중괄호 사용 (0) | 2020.05.23 |
Mac OS X에 Apache Ant를 어떻게 설치합니까? (0) | 2020.05.23 |
파이썬 파일 모드“w +”와 혼동 (0) | 2020.05.23 |
JqGrid로 select2 드롭 다운의 선택된 값을 어떻게 변경합니까? (0) | 2020.05.23 |