I'm trying to install PyOpenCL on Ubuntu 16.04, but getting the following error:
/usr/bin/ld: cannot find -lOpenCL
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
How can I solve this issue?
Thanks.
You need to install: ocl-icd-opencl-dev
apt-get install ocl-icd-opencl-dev
You can check what was actually installed with that package running:
$ dpkg -L ocl-icd-opencl-dev
which should return something along these lines:
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/ocl-icd-opencl-dev
/usr/share/doc/ocl-icd-opencl-dev/copyright
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/pkgconfig
/usr/lib/x86_64-linux-gnu/pkgconfig/OpenCL.pc
/usr/share/doc/ocl-icd-opencl-dev/changelog.Debian.gz
/usr/lib/x86_64-linux-gnu/libOpenCL.so # <--- this is the important bit
Bonus
If you get a complaint about missing headers, e.g CL/cl.h, then you should install:
apt-get install opencl-headers.
Don't forget to install specific OpenCL drivers for your platform. You could be running against an Intel CPU/GPU, an AMD or NVidia graphics card or even an FPGA.
A good way of checking everything is well setup, is to run clinfo which will show useful information about available platforms (apt-get install clinfo).
Based on this page, it seems that I had to only run this command on my bash for the error to be removed:
apt-get install python-pyopencl
Related
Macbook
Mac OSX 10.12.6
Python 3.6.2
cython 0.28.5
pip 18.0
I'm trying to install pysam:
pip3 install pysam
It keeps hitting an error at:
creating build/temp.macosx-10.6-intel-3.6/htslib/cram
htslib/cram/cram_io.c:63:10: fatal error: 'os/lzma_stub.h' file not found
#include "os/lzma_stub.h"
^~~~~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
Seems like this issue, this, and this were version issues. But I've tried pip3 install pysam==0.13 and 0.14 and 0.15 with the same results.
Suggestions?
I really don't want to deal with installing conda...
My mistake! pip3 install pysam==0.13 actually DOES work. Just leaving this here for posterity.
Clearly, you are missing lzma, which is now part of xz library (https://tukaani.org/xz/). Install that and see if it works. In OSX, you can install it using homebrew: brew install xz.
Another option is to install htslib (http://www.htslib.org/download/), or samtools (can be found in the htslib url).
I think I pretty much followed all the instructions in:
https://github.com/BVLC/caffe/wiki/Ubuntu-16.04-or-15.10-Installation-Guide.
I still get the error:
/usr/bin/ld: cannot find -lopenblas
collect2: error: ld returned 1 exit status
Makefile:567: recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc3' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0-rc3] Error
Has anyone come across this?
Did you install OpenBLAS? Try the following command and repeat the compillation process:
sudo apt-get install -y libopenblas-dev
If it fails, you could try compilling caffe with cmake.
From the build folder, do:
cmake -DBLAS=open ..
make all -j $(($(nproc) + 1))
make install
make runtest
You should provide the config file to better understand the links.
I seem to be one of the many people struggling to install gensim on windows. I have trawled through countless forums but the errors poster there never appear to match my errors. So hopefully someone can point me in the right direction!
I am running Windows Server 2012 R2 Standard 64-bit. I have installed MinGW & Anaconda 2.2.0 (64-bit), which comes with Python 2.7.9.
I have added a file distutils.cfg into C:\Users\Sam\Anaconda\Lib\distutils with the contents:
[build]
compiler=mingw32
I have added C:\MinGW\bin to my Environment variables.
If I install gensim using pip I do not get any errors, until I try to run Word2Vec when I get the error:
C:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\gensim\models\word2vec.py:459: UserWarning: C extension com
pilation failed, training will be slow. Install a C compiler and reinstall gensim for fast training.
So I have uninstalled gensim and tried to re-install using the mingw32 compiler, but this gives me this error:
python setup.py build --compiler=mingw32
c:\users\sam.passmore\appdata\local\continuum\anaconda\lib\site-packages\setuptools-14.3-py2.7.egg\setuptools\dist.py:282: UserWarni
ng: Normalizing '0.11.1-1' to '0.11.1.post1'
running build
running build_ext
building 'gensim.models.word2vec_inner' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Igensim\models -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\include -IC:
\Users\sam.passmore\AppData\Local\Continuum\Anaconda\PC -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\n
umpy\core\include -c ./gensim/models/word2vec_inner.c -o build\temp.win-amd64-2.7\Release\.\gensim\models\word2vec_inner.o
gcc: error: ./gensim/models/word2vec_inner.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
setup.py:82: UserWarning:
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for gensim to run,
although they do result in significant speed improvements for some modules.
%s
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.
Debian and Ubuntu users should issue the following command:
$ sudo apt-get install build-essential python-dev
RedHat, CentOS, and Fedora users should issue the following command:
$ sudo yum install gcc python-devel
If you are seeing this message on OSX please read the documentation
here:
http://api.mongodb.org/python/current/installation.html#osx
********************************************************************
The gensim.models.word2vec_inner extension moduleThe output above this warning shows how the compilation failed.
"The output above this warning shows how the compilation failed.")
building 'gensim.models.doc2vec_inner' extension
C:\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Igensim\models -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\include -IC:
\Users\sam.passmore\AppData\Local\Continuum\Anaconda\PC -IC:\Users\sam.passmore\AppData\Local\Continuum\Anaconda\lib\site-packages\n
umpy\core\include -c ./gensim/models/doc2vec_inner.c -o build\temp.win-amd64-2.7\Release\.\gensim\models\doc2vec_inner.o
gcc: error: ./gensim/models/doc2vec_inner.c: No such file or directory
gcc: fatal error: no input files
compilation terminated.
command 'C:\\MinGW\\bin\\gcc.exe' failed with exit status 1
setup.py:82: UserWarning:
********************************************************************
WARNING: %s could not
be compiled. No C extensions are essential for gensim to run,
although they do result in significant speed improvements for some modules.
%s
Here are some hints for popular operating systems:
If you are seeing this message on Linux you probably need to
install GCC and/or the Python development package for your
version of Python.
Debian and Ubuntu users should issue the following command:
$ sudo apt-get install build-essential python-dev
RedHat, CentOS, and Fedora users should issue the following command:
$ sudo yum install gcc python-devel
If you are seeing this message on OSX please read the documentation
here:
http://api.mongodb.org/python/current/installation.html#osx
********************************************************************
The gensim.models.doc2vec_inner extension moduleThe output above this warning shows how the compilation failed.
"The output above this warning shows how the compilation failed."
I have exhausted all options I can think of or find, so if anyone could give some advice it would be much appreciated.
I managed to solve this after using conda install for gensim, rather than pip.
conda install gensim
I am not sure what other steps I have included above have contributed to the answer, but this was the last thing I did before I no longer was getting the 'Install a C compiler and reinstall gensim for fast training.' message.
During my research in trying to solve this problem I saw that the most common methods were adding the lines
[build]
compiler=mingw32
to the distutils.cfg file as well as ensuring MinGW is in your path. Also ensuring that the MinGW bit version is the same as your python version.
I am running python 2.7 in Ubuntu 14.04 and have installed the python-pyo package, but when I import the pyo module I get the following error:
ImportError: /usr/lib/python2.7/dist-packages/_pyo.so: undefined symbol: jack_port_register
It seems like I must have screwed up the jack libraries on my system somehow, but I can't figure out what is broken.
[~/Downloads/pyo-read-only]$ ldconfig -p|grep jack
libjack.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjack.so.0
libjack.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjack.so
[~/Downloads/pyo-read-only]$ objdump -tT /usr/lib/x86_64-linux-gnu/libjack.so.0|grep jack_port_register
000000000000a3a0 g DF .text 00000000000001a1 Base jack_port_register
I have tried building python-pyo from scratch but I get the same error. If I build it without --use-jack, I get a segmentation fault when I try to boot a server.
I had this problem. It was fixed by ensuring I had the correct packages installed.
From http://ajaxsoundstudio.com/pyodoc/compiling.html
sudo apt-get install libjack-jackd2-dev libportmidi-dev portaudio19-dev liblo-dev
sudo apt-get install libsndfile-dev python-dev python-tk
sudo apt-get install python-imaging-tk python-wxgtk3.0
I was able to get a bit further by manually adding -ljack to the setup.py and building from source.
I am having trouble installing the Python package rpy2. I have already compiled R as a shared library, but I do not have admin priviledges so I am trying to install rpy2 with:
pip install -user rpy2
However, I am getting the following error:
./rpy/rinterface/_rinterface.c:86:31: fatal error:
readline/readline.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
I have downloaded readline to:
/some/path/readline-6.2/
where I can see readline.h (I have also compiled readline just in case)
My question:
How can I make rpy2 (or pip) aware of this location with readline.h to avoid the header compilation error?
You'll need to actually install readline, not just download it, and then point rpy2 to it with CFLAGS and LDFLAGS.
Try this approach. It's almost working for me - I have the same problem, except an additional wrinkle that rpy2 seems to be linking against the system R instead of my homedir install.
First, I downloaded readline to ~/src/readline-6.2, and installed it with ./configure --prefix=$HOME && make && make install. (You need to install it somewhere, not just download the source.)
Then I re-compiled R with
CPPFLAGS="-I/usr/local/include -I$HOME/include/" \
LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -L$HOME/lib64 -L$HOME/lib" \
./configure --prefix=$HOME --enable-BLAS-shlib --enable-R-shlib
make
make install
R is definitely now using that readline:
$ ldd ~/lib64/R/lib/libR.so | grep readline
libreadline.so.6 => /home/dsutherl/lib/libreadline.so.6 (0x00007f8104207000)
The same for my in-home install of Python (3.2.3, since h5py doesn't work with 3.3 yet):
CFLAGS="-I/usr/local/include -I$HOME/include/" \
LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -L$HOME/lib64 -L$HOME/lib" \
./configure --prefix=$HOME
make
make install
And again:
$ ldd ~/lib/python3.2/lib-dynload/readline.cpython-32m.so | grep readline
libreadline.so.6 => /home/dsutherl/lib/libreadline.so.6 (0x00007fbfff5c2000)
Then I downloaded the rpy2 source and built that:
CFLAGS="-I/usr/local/include -I$HOME/include/" \
LDFLAGS="-L/usr/local/lib64 -L/usr/local/lib -L$HOME/lib64 -L$HOME/lib" \
python3 setup.py build --r-home $HOME/lib64/R install
This seemed successful, and ldding the .sos in site-packages/rpy2 links to the right libreadline...but to the system R, instead of mine, despite the explicit --r-home.
more simple :
yum install readline-devel.x86_64
run for me on centos 7
for debian/ubuntu
apt-get install libreadline-dev
Sometime in linux is needed an sudo apt-get upgrade, to get the news libraries, may work
This is another option, but too you need root privilegies ...
sudo apt-get install libreadline-dev