0

i installed sabayon linux and i tried to install pycuda but i am receiving the following error when i try

su -c "make install"

In file included from src/cpp/cuda.cpp:1:0: src/cpp/cuda.hpp:12:18: fatal error: cuda.h: No such file or directory compilation terminated. error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1

I must mention that i can compile with cuda.

The same happens and when i try with

sudo -E sh -c "make install"

My .bashrc is :

# Put your fun stuff here.
export PATH=~/bin:$PATH 
export PATH=$PATH:$HOME/Matlab_2010b/bin 
export PATH=/opt/cuda/bin:$PATH 
export LD_LIBRARY_PATH=/opt/cuda/lib64:$LD_LIBRARY_PATH 
export CUDA_ROOT=/opt/cuda/bin   

(When i do echo $PATH as user it shows me : /opt/cuda/bin but when i try it as root it doesn't show anything and i had to do export PATH...again in order to show.)

George
  • 5,808
  • 15
  • 83
  • 160
  • 1
    Your question is confusing to me."I must mention that i can compile with cuda." You, as opposed to root? "My .bashrc is". You're some other user? Also, I don't see an include path in your environment variables. Have you checked that the default one includes the path to the CUDA headers? Maybe try to take a step back and describe in a different way, what works, what doesn't work and why you're using su and sudo when running make. – Roger Dahl Jul 05 '12 at 18:52
  • I mean cuda works ok.The problem is with pycuda. I mean "the .bashrc".I am trying both "su -c make install " ans "sudo -E..." according to http://stackoverflow.com/questions/8368815/pycuda-cuda-root-not-set-and-nvcc-not-in-path. The above .bashrc used to work for me.I don't know what else to insert there.Thanks – George Jul 06 '12 at 08:36

1 Answers1

2

You have CUDA installed in a non-standard path and the PyCUDA installer doesn't know how to find the toolkit headers it needs to compile. As per the installation instructions, you need to do something like this:

python configure.py --cuda-root=/opt/cuda  

then

su -c "make install"

this will ensure that the compilation can find the necessary driver API headers to build the support libraries and hardcode all the right paths into the PyCUDA python libraries so that everything works correctly.

talonmies
  • 70,661
  • 34
  • 192
  • 269
  • I did "python configure.py --cuda-root=/opt/cuda/bin" .This worked for previous installs though..Thank you for your help talonmies! – George Jul 06 '12 at 09:32