我正在尝试在Debian上安装CBLAS,在Python3.4上安装Numpy和Scipy。
我指的是网站: 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
$ 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
但是,会显示此类错误消息。
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
我无法解决错误。我想让你告诉我是否有解决方案。 我将非常感谢大家的建议。抱歉我的英语不好。
- 这是我的环保 -
答案 0 :(得分:0)
我也遇到了同样的错误。
调用-lpthread
后,很快就会在makefile中调用libopenblas.a
。现在,正好相反。