0
我想在Debian上安裝CBLAS,在Python3.4上安裝Numpy和Scipy。想要安裝CBLAS,但得到錯誤「未定義的引用`pthread_atfork'」
我指的是網站: http://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204.html http://www.kde.cs.tut.ac.jp/~atsushi/?p=493
首先,我已經安裝了OpenBLAS。
$git clone git://github.com/xianyi/OpenBLAS
$sudo vim /etc/ld.so.conf.d/libc.conf
$sudo ldconfig
$cd ~/Downloads/openBLAS
我只更改了「Makefile.rule」中的以下兩行。其他仍然是違約。
NO_CBLAS = 1
NO_LAPACK = 1
返回到shell並make。
$ make
$ sudo make PREFIX=/usr/local install
$ sudo ldconfig
它成功了。
接下來,我試圖安裝CBLAS。
$wget http://www.netlib.org/blas/blast-forum/cblas.tgz
$tar xzf cblas.tgz
$cd ~/Downloads/CBLAS
而且我編輯了Makefile.in,如下所示。
#
# Makefile.LINUX
#
#
# If you compile, change the name to Makefile.in.
#
#
#-----------------------------------------------------------------------------
# Shell
#-----------------------------------------------------------------------------
SHELL = /bin/sh
#-----------------------------------------------------------------------------
# Platform
#-----------------------------------------------------------------------------
PLAT = LINUX
#-----------------------------------------------------------------------------
# Libraries and includes
#-----------------------------------------------------------------------------
BLLIB = /usr/local/lib/libopenblas.a
CBLIB = ../lib/libcblas.a
#-----------------------------------------------------------------------------
# Compilers
#-----------------------------------------------------------------------------
CC = gcc
FC = gfortran
LOADER = $(FC) -lpthread
#-----------------------------------------------------------------------------
# Flags for Compilers
#-----------------------------------------------------------------------------
CFLAGS = -O3 -march=native -m64 -fomit-frame-pointer -fPIC -DADD_
FFLAGS = -O3 -march=native -m64 -fomit-frame-pointer -fPIC
#-----------------------------------------------------------------------------
# Archive programs and flags
#-----------------------------------------------------------------------------
ARCH = ar
ARCHFLAGS = cr
RANLIB = ranlib
返回到shell並make。
$make
但是,會顯示此類錯誤消息。
ranlib ../lib/libcblas.a
make[1]: exit `/home/hiroakisuzuki/Downloads/CBLAS/src'
(cd testing && make all)
make[1]: in `/home/hiroakisuzuki/Downloads/CBLAS/testing'
gcc -I../include -O3 -march=native -m64 -fomit-frame-pointer -fPIC -DADD_ -c c_sblas1.c
gfortran -O3 -march=native -m64 -fomit-frame-pointer -fPIC -c c_sblat1.f
c_sblat1.f:214.48:
CALL STEST1(SNRM2TEST(N,SX,INCX),STEMP,STEMP,SFAC)
1
Warning: Rank mismatch in argument 'strue1' at (1) (scalar and rank-1)
c_sblat1.f:218.48:
CALL STEST1(SASUMTEST(N,SX,INCX),STEMP,STEMP,SFAC)
1
Warning: Rank mismatch in argument 'strue1' at (1) (scalar and rank-1)
gfortran -lpthread -o xscblat1 c_sblat1.o c_sblas1.o ../lib/libcblas.a /usr/local/lib/libopenblas.a
/usr/local/lib/libopenblas.a(memory.o): In function `openblas_fork_handler':
memory.c:(.text+0x2a0): undefined reference to `pthread_atfork'
collect2: error: ld returned 1 exit status
make[1]: *** [xscblat1] error 1
make[1]: exit `/home/hiroakisuzuki/Downloads/CBLAS/testing'
make: *** [alltst] error2
我無法解決錯誤。我想讓你告訴我是否有解決方案。 我會非常感謝大家的建議。對不起,我英文很差。
- 這是我的環境 -
- OS:Debian的7.6喘鳴
- CPU:英特爾(R)核心(TM)2四核CPU Q9650 @ 3.00GHz
- GCC:gcc版本4.7.2(Debian的4.7.2-5)
- GFORTRAN:GNU的Fortran(Debian4.7.2-5)4.7.2