Does Python SciPy need 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.

Which tar do I need to download off this site?

I've tried the fortrans, but I keep getting this error (after setting the environment variable obviously).

Answers

 

The SciPy webpage used to provide build and installation instructions, but the instructions there now rely on OS binary distributions. To build SciPy (and NumPy) on operating systems without precompiled packages of the required libraries, you must build and then statically link to the Fortran libraries BLAS and 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

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 SciPy webpage's instructions helped me here as well, but I had to modify them to suit my environment:

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

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

Update on 3-Sep-2015: Verified some comments today (thanks to all): Before running make lapacklib edit the make.inc file and add -fPIC option to OPTS and NOOPT settings. If you are on a 64bit architecture or want to compile for one, also add -m64. It is important that BLAS and LAPACK are compiled with these options set to the same values. If you forget the -fPIC SciPy will actually give you an error about missing symbols and will recommend this switch. The specific section of make.inc looks like this in my setup:

FORTRAN  = gfortran 
OPTS     = -O2 -frecursive -fPIC -m64
DRVOPTS  = $(OPTS)
NOOPT    = -O0 -frecursive -fPIC -m64
LOADER   = gfortran

On old machines (e.g. RedHat 5), gfortran might be installed in an older version (e.g. 4.1.2) and does not understand option -frecursive. Simply remove it from the make.inc file in such cases.

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.

 

To actually install scipy from PIP, you need packages libatlas-base-dev (libraries etc. for ATLAS/BLAS) and gfortran (GNU Fortran compiler).

Once these packages are installed, the scipy installer should finish as expected.

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
62 PS4 프로 자동 구입 매크로 만들기 -2- file 졸리운_곰 2020.11.21 512
61 PS4 프로 자동 구입 매크로 만들기 -1- file 졸리운_곰 2020.11.21 517
60 Zappa를 이용해 AWS Lambda에 Flask 올리기 file 졸리운_곰 2020.10.25 455
59 Python WAS 구축하기 ( Django, Nginx, Gunicorn ) file 졸리운_곰 2020.10.25 430
58 Python SimpleHTTPServer file 졸리운_곰 2020.10.25 421
57 [Django] 설문조사 애플리케이션 예제 (3) - 구현하기 file 졸리운_곰 2020.09.07 591
56 [Django] 설문조사 애플리케이션 예제 (2) - Model 다루기 file 졸리운_곰 2020.09.07 503
55 ????[Django] 설문조사 애플리케이션 예제 (1) - Django 프로젝트 구조 알아보기???? file 졸리운_곰 2020.09.07 409
54 [Python 데이터 수집] 웹 페이지 컨텐츠 수집 file 졸리운_곰 2020.08.08 468
53 파이썬 네이버 실시간 검색어 스크래핑(크롤링) file 졸리운_곰 2020.05.09 469
52 파이썬 크롤링 스크래핑 간단 설명(예제) file 졸리운_곰 2020.05.09 577
51 Web Screen Scraping with Python to Populate SQL Server Tables file 졸리운_곰 2020.02.27 469
50 [네이버 뉴스 스크래핑/크롤링] NNST - 한국어 네이버 뉴스 데이터셋 file 졸리운_곰 2020.01.21 434
49 네이버 뉴스 크롤러 github naver_news_crawling_perfect.py 졸리운_곰 2020.01.19 633
48 Getting Started with Web Automation Testing using Selenium and Python 졸리운_곰 2019.12.25 365
47 Apache와 Python을 CGI로 연동하기 file 졸리운_곰 2019.10.24 384
46 파이썬 구현의 blog API : MetaWeblog API (MWA) implemented in Python file 졸리운_곰 2019.02.08 438
45 아파치서버와 파이썬 연동 - 웹에서 파이썬실행 졸리운_곰 2019.01.03 1259
44 Python Django 프로젝트를 위한 Jenkins 설정 : Assembling a Continuous Integration Service for a Django project on Jenkins file 졸리운_곰 2018.11.03 1348
43 Django + djangorestframework + django_rest_swagger 시작 file 졸리운_곰 2018.05.27 430
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED