Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am installing pycuda2011.2.2 on ubuntu 11.10, but can't complete it. When i do pycuda-2011.2.2 $ make -j 4

I get this error:

/usr/bin/ld: cannot find -lboost_python-mt    ,
/usr/bin/ld: cannot find -lcuda

I got 1 exact problem match in google search and solution as well :

 $ sudo ln -s /usr/lib/libboost_python-mt-py26 /usr/lib/libboost_python-mt

But booooom, My problem doesn't vanish.

It makes me wonder that why there are no relavant results in google search, as if only I have this problem. What is wrong ? Any help is appreciated.

Thanks,

share|improve this question

5 Answers 5

There are two libraries you seem to be missing, which you need to install first.

Boost.Python

This is provided by libboost-python and ``. Or as these instructions say, to install this and some of the other prerequisites (which you may or may not already have, based on your error messages), run:

sudo apt-get install build-essential python-dev python-setuptools libboost-python-dev libboost-thread-dev -y

(I wouldn't advise following all the instructions on that page to the letter from beginning to end, though, as they're not written with Ubuntu 11.10 in mind and you don't need, and probably don't want, to set your system up to use an older compiler than is provided officially for it.)

CUDA

If you have already downloaded CUDA from Nvidia's website and installed it, then you just need to specify where:

./configure.py --cuda-root=/where/ever/you/installed/cuda

(See pycuda's generic instructions page for details.)

Before doing that, you may want to either start over from scratch or run make distclean (or make clean if make distclean is not recognized).

If you haven't yet downloaded and installed CUDA, you can do that at Nvidia's website. Specifically, on this page, grab the 32-bit or 64-bit version of the CUDA toolkit for Ubuntu 11.04 (that's the closest to your system that's available, and will probably work). If you're unsure if you have the 32-bit or 64-bit version of Ubuntu installed, run uname -m. If it says x86_64, you have the 64-bit version; otherwise you have the 32-bit version. Also grab the development drivers and SDK.

Quick links (32-bit): Toolkit Drivers SDK
Quick links (64-bit): Toolkit Drivers SDK

share|improve this answer

Eliah is on point about the -lcuda fix. You might also add the location of your cuda lib directory to your LD_LIBRARY_PATH.

As for the libboost-python problem, re-run the ./configure command from pycuda's generic instructions and replace --boost-python-libname=boost_python-mt with --boost-python-libname=boost_python-mt-py26.

share|improve this answer

elzirac's solution worked best for me. Overall, the installation workflow that worked for me on Ubuntu 12.04 is:

Make sure system is using python 2.7.x by default:

python --version    

(it should say Python 2.7.x)

Eliminate old Nvidia drivers and install CUDA 5.5 prerequisites:

sudo apt-get remove --purge nvidia*    
sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev    

Install CUDA 5.5:

wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_5.5-0_amd64.deb    
sudo dpkg -i cuda-repo-ubuntu1204_5.5-0_amd64.deb    
sudo apt-get update    
sudo apt-get install cuda    

Update CUDA 5.5 environment variables:

sudo echo "/usr/local/cuda-5.0/lib64" > /etc/ld.so.conf.d/cuda-5-5.conf    

Use a text editor to append :/usr/local/cuda-5.5/bin to the end of the PATH line in /etc/environment

Download pycuda:

wget https://pypi.python.org/packages/source/p/pycuda/pycuda-2013.1.1.tar.gz

Unpack:

tar xvzf pycuda-2013.1.1.tar.gz    

Install:

cd pycuda-2013.1.1    

rm siteconf.py    

./configure.py --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python-mt-py27 --boost-thread-libname=boost_thread-mt --no-use-shipped-boost    
sudo make install    

Test pycuda installation:

cd test
python test_driver.py    
share|improve this answer

problem solved. I found answer in this thread: http://forums.nvidia.com/index.php?showtopic=224718&st=0#entry1413660

share|improve this answer
3  
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  fossfreedom May 29 '12 at 19:27

I also ran into this problem, but on Ubuntu 12.04. I had a solution similar to max beckett's answer but instead of replacing --boost-python-libname=boost_python-mt with --boost-python-libname=boost_python-mt-py26 it was --boost-python-libname=boost_python-mt-py27 (note that "26" changed to "27" depending on the boost version you have)

Check what boost you have:

ls /usr/lib/libboost_python*

This was changed in the call to ./configure making the final call:

./configure.py --cuda-root=/usr/local/cuda --cudadrv-lib-dir=/usr/lib --boost-inc-dir=/usr/include --boost-lib-dir=/usr/lib --boost-python-libname=boost_python-mt-py27 --boost-thread-libname=boost_thread-mt --no-use-shipped-boost

If you had already run the ./configure, you'll need to delete ./siteconf.py

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.