我正在尝试通过 pip 将 python 包cvxopt安装到 Centos 6 系统上的虚拟环境中。
由于lapack是先决条件,并且由于我没有超级用户访问系统的权限,因此我使用以下命令在本地安装了 lapack:
$ cmake -DCMAKE_INSTALL_PREFIX=/home/tom .
$ make install
我注意到,在这一步之后,正如预期的那样liblapack.a
,位于我的本地 lib 目录中。/home/tom/lib
但是,当我激活我的虚拟环境并运行时,pip install cvxopt
我收到以下错误:
<snip>
gcc -pthread -shared
build/temp.linux-x86_64-2.7/src/C/base.o
build/temp.linux-x86_64-2.7/src/C/dense.o
build/temp.linux-x86_64-2.7/src/C/sparse.o
-L/usr/lib -L/public/apps/python/2.7.4/lib
-lm -llapack -lblas -lpython2.7 -o build/lib.linux-x86_64-2.7/cvxopt/base.so
/usr/bin/ld: cannot find -llapack
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1
我已经尝试添加/home/tom/lib
到两者LD_LIBRARY_PATH
,LD_RUN_PATH
但这些似乎都不会影响用于构建模块的gcc
命令行选项。pip
谁能告诉我如何给图书馆搜索路径pip
?有没有更好的办法?