Python Library Search Paths

I am trying to install the python cvxopt package through pip in a virtual environment on a Centos 6 system.

Since lapack is a prerequisite, and since I do not have superuser access to the system, I installed lapack locally using the following:

$ cmake -DCMAKE_INSTALL_PREFIX=/home/tom .
$ make install

I noticed that after this step it liblapack.ais in my local lib directory /home/tom/lib, as expected.

However, when I activate my virtual environment and start pip install cvxopt, I get the following error:

<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

I tried to add /home/tom/libboth to LD_LIBRARY_PATHand to LD_RUN_PATH, but none of them affects the command line options gccthat are pipused to build the module.

- , pip? ?

+4
1

. , , LAPACK:

~/src/lapack-3.5.0 $ cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/home/tom .
~/src/lapack-3.5.0 $ make install

LD_FLAGS, :

export LD_FLAGS="-L/home/tom/lib"

cvxopt :

~/src/cvxopt-1.1.6 $ . venv/bin/activate
~/src/cvxopt-1.1.6 (venv)$ python setup.py build install

LD_LIBRARY_PATH LD_RUN_PATH, , LD_FLAGS. , , LAPACK ; cvxopt .

+1

Source: https://habr.com/ru/post/1535643/


All Articles