Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am installing pycuda2011.2.2 on ubuntu 11.10, but can't complete it. Cuda is 4.0. When I do:

$ make -j 4 

I get this error:

/usr/bin/ld: cannot find -lcuda 
/usr/bin/ld: skipping incompatible /usr/local/cuda/lib/ when searching for -lcurand

Why this error? I think that cuda is 32 bit on 64 bit machine. But I can't see whether it's 32 bit or 64 bit.

Also, can anyone share code to make "gcc 4.4" as priority, just for my account and not all account?

share|improve this question

I don't understand why you would want to run make at all when building pycuda - it does not even have a Makefile (apart from the documentation).

You install pycuda by running ./ with the appropriate options followed by LDFLAGS=-L/usr/lib/nvidia-current python install.

You need to set the LDFLAGS environment variable so that the pycuda setup can find, which on ubuntu systems is in a non-standard location (/usr/lib/nvidia-current).

If you're really asking about compiling the CUDA SDK (in which case you should definitely edit your question!), see my response on the NVIDIA forums.

share|improve this answer
Shouldn't it be LDFLAGS='-L/usr/lib/nvidia-current' ? – wump Aug 12 '12 at 12:55
It should, fixed now. – kynan Aug 13 '12 at 15:58

What about removing -lcuda from the Makefile? Last time I checked the toolkit and sdk, I could not find a file.

There have also been changes in the strictness of the compiler, so -lcuda must come after object files and other libraries which depend on it. You likely have to move -lcuda to the end of the $(CC) line (or whatever compiler command is used).

share|improve this answer
I don't see -lcuda in Makefile.TRy this to find your – user55717 May 11 '12 at 18:57
Have you looked at for installing CUDA? A default installation does not work properly (at least, not for me on 12.04) – Lekensteyn May 11 '12 at 20:01
sorry, I left comment open and it got published.Try this to find your ......@ubuntu:/usr$ locate => /usr/lib/nvidia-current/ . Also, Can you please elaborate what you said before ? CUDA is already installed on machine which i got, so i don't know if its just default or not. – user55717 May 11 '12 at 20:17
i haven't checked that thread as CUDA is already installed. – user55717 May 11 '12 at 20:35
I got a therad that address same problem:<a href="http://… pycuda installed. I was about to try your suggestion, but that thread was a bullseye, so i didn't tried that.Lekensteyn, thanks a lot for continuous support. – user55717 May 25 '12 at 19:31

Your Answer


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.