2012-07-05 158 views
0

我安装了芭雍Linux和我试图安装pycuda但我收到以下错误,当我尝试pycuda - 错误:命令“x86_64的-PC-Linux的GNU-G ++”失败,退出状态1

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

我必须提及,我可以用cuda编译。

同样的情况,当我与

sudo -E sh -c "make install"

尽我的.bashrc是:

# 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 

(当我这样做回声$ PATH为用户它显示我中:/ opt/CUDA /箱但是当我以root身份尝试时,它不显示任何内容,为了显示,我必须再次执行导出PATH ...)

+1

你的问题让我感到困惑。“我必须提及,我可以用cuda编译。”你,而不是根? “我的.bashrc是”。你是其他用户?另外,我在环境变量中看不到包含路径。您是否检查过默认的包含CUDA头文件的路径?也许尝试退后一步,以不同的方式描述,运行make时,什么起作用,什么不起作用以及为什么要使用su和sudo。 – 2012-07-05 18:52:37

+0

我的意思是cuda可以正常工作。问题在于pycuda。我的意思是“.bashrc”。我正在尝试“su -c make install”和“sudo -E ...”,根据http://stackoverflow.com/questions/8368815/pycuda-cuda-root-not-设置和NVCC-未在路径。上面的.bashrc用于为我工作。我不知道还有什么要插入那里。谢谢 – George 2012-07-06 08:36:31

回答

2

您将CUDA安装在非标准路径中,并且PyCUDA安装程序不会'不知道如何找到工具它需要编译头文件。由于每installation instructions,你需要做的是这样的:

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

然后

su -c "make install" 

这将确保编译可以找到所需的驱动程序API头打造的支持库和硬编码的所有进入PyCUDA python库的正确路径,以便一切工作正常。

+0

我做了“python configure.py --cuda-root =/opt/cuda/bin”。谢谢你的帮助talonmies! – George 2012-07-06 09:32:37

相关问题