4

When I do pip install in my cluster (my cluster is designed to use intel compiler icpc), I get the following error:

$ pip install cvxopt --user
Collecting cvxopt
  Using cached cvxopt-1.1.8.tar.gz
Building wheels for collected packages: cvxopt
  Running setup.py bdist_wheel for cvxopt ... error
  Complete output from command /share/apps/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-sxngrO/cvxopt/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpTcH01Zpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  creating build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/coneprog.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/printing.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/msk.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/misc.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/__init__.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/cvxprog.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/info.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/modeling.py -> build/lib.linux-x86_64-2.7/cvxopt
  copying src/python/solvers.py -> build/lib.linux-x86_64-2.7/cvxopt
  running build_ext
  building 'base' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  creating build/temp.linux-x86_64-2.7/src/C
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/share/apps/include/python2.7 -c src/C/base.c -o build/temp.linux-x86_64-2.7/src/C/base.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/share/apps/include/python2.7 -c src/C/dense.c -o build/temp.linux-x86_64-2.7/src/C/dense.o
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/share/apps/include/python2.7 -c src/C/sparse.c -o build/temp.linux-x86_64-2.7/src/C/sparse.o
  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 -lm -llapack -lblas -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 think there might be 2 problems:

  1. it uses gcc rather than icpc which is what our cluster is set up for... So the question is that is it possible to specify icpc for all my installations?

  2. /usr/bin/ld: cannot find -llapack: lapack library is not found ... Lapack library is missing ... As I do not want to install from source, is there some way that I could use package manager to install all those dependencies? Thank you.

3
  • 4
    I think you can specify compiler by CC environment variable. So something like CC=icpc pip install cvxopt should work. What system are you using? Lapack and others are available for most systems through repository packages... Commented Sep 16, 2016 at 9:42
  • it is actually a linux cluster in my group. do you know how could i install lapack without root (nor asking admins) with package managers myself (like pip)? Commented Sep 16, 2016 at 21:07
  • I've been dealing with similar stuff for my group. You can take a look at my site probe-spherical-pic-docs.readthedocs.io/en/latest/…. Everything in that list is installed into ~/.local without need for root privileges. The documentation is not complete and might be bit outdated, however you might find it useful. Feel free to contact me if you have any questions. Commented Sep 17, 2016 at 15:35

1 Answer 1

2

You can configure the compiler for one installation with pip in the following way:

pip install --global-option build_ext --global-option --compiler=<compiler_name> <package_name>

just remember to swap <compiler_name> to the name of your compiler (icpc) and <package_name> to cvxopt

Please see this answer for a similar approach on Windows.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.