BLAS/LAPACK未安装:如何安装

BLAS/LAPACK not installed: How to install it?

本文关键字:安装 何安装 LAPACK BLAS      更新时间:2023-10-16

我试图运行pip install tsne python2.7,我不断得到相同的错误。我按照http://bickson.blogspot.com/2011/02/installing-blaslapackitpp-on-amaon-ec2.html上的说明安装了我认为应该可以解决问题的LAPACK/BLAS。没有什么帮助。我做错了什么?我不太熟悉bash。

<>以前build_ext运行cythoning tsne/bh_sne。到tsne/bh_sne.cpp构建'bh_sne'扩展创建构建/temp.linux - x86_64 2.7创建构建/temp.linux - x86_64 - 2.7/tsne创建构建/temp.linux - x86_64 - 2.7/tsne/bh_sne_src-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/env/work/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/-I/usr/include/python2.7 -c tsne/bh_sne_src/quadtree.cpp -o build/temp.linux-x86_64-2.7/tsne/bh_sne_src/quadtree. cpp0 -msse2 -O3 -fPIC -wcc1plus: warning:命令行选项' - strict-prototypes '对C/ObjC有效,但对c++无效[默认启用]-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/env/work/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/-I/usr/include/python2.7 -c tsne/bh_sne_src/tsne.cpp -o build/temp.linux-x86_64-2.7/tsne/bh_sne_src/tsne. cpp0 -msse2 -O3 -fPIC -wcc1plus: warning:命令行选项' - strict-prototypes '对C/ObjC有效,但对c++无效[默认启用]-fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/home/ubuntu/env/work/local/lib/python2.7/site-packages/numpy/core/include -I/usr/local/include -Itsne/bh_sne_src/-I/usr/include/python2.7 -c tsne/bh_sne_cpp -o build/temp.linux-x86_64-2.7/tsne/bh_sne. cpp0 -msse2 -O3 -fPIC -wcc1plus: warning:命令行选项' - strict-prototypes '对C/ObjC有效,但对c++无效[默认启用]-DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector——param=ssp-buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-2.7/tsne/bh_sne_src/quadtreeo构建/temp.linux - x86_64 2.7/tsne/bh_sne_src/tsne。o构建/temp.linux - x86_64 2.7/tsne/bh_sne。0 -L/usr/local/lib -o build/lib.linux-x86_64-2.7/bh_sne。所以-lcblas/usr/bin/ld:找不到- lblasCollect2: error: ld returned 1 exit status命令"c++"失败,退出状态为1----------------------------------------清理…命令/home/ubuntu/env/work/bin/python -c "import setuptools, tokenize;__file__='/home/ubuntu/env/work/build/tsne/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read()。replace('rn', 'n'), __file__, 'exec')))" install——record/tmp/pip-3X17dU-record/install-record.txt——single-version- externalmanaged——compile——install-headers/home/ubuntu/env/work/include/site/python2.7 failed with error code 1 in/home/ubuntu/env/work/build/tsne .回溯(最近一次调用):文件"/home/ubuntu/env/work/bin/pip",第11行sys.exit (main ())文件"/home/ubuntu/env/work/local/lib/python2.7/site-packages/pip/__init__.py",第185行,在main中返回command.main (cmd_args)文件"/home/ubuntu/env/work/local/lib/python2.7/site-packages/pip/basecommand.py",第161行,在mainText = 'n'.join(complete_log)UnicodeDecodeError: 'ascii'编解码器无法解码位置42中的字节0xe2:序数不在范围(128)

Ubuntu没有cblas或openblas的二进制发行版,根据它们的github,它们是必需的。然而,在Ubuntu上可用的ATLAS附带了预编译的cblas。

在Ubuntu, debian中,应该使用:

apt-get install libatlas-base-dev 

https://launchpad.net/ubuntu/+源/阿特拉斯

如果你需要不同的编译器选项,你必须自己构建openblas。

检查你是否得到了libblas。/usr/lib

使用

sudo apt-get install libblas-dev liblapack-dev

下载一个OpenBLAS副本并自己编译。通过make install安装到/usr/local中。官方存储库中有OpenBLAS和ATLAS包以及其他任何包,但它们的性能令人怀疑。