通过“easy_install”安装时,PyOpenCL 找不到包含文件。
所以我已经下载了 nVidia CUDA 库并将它们放在默认位置:
/usr/local/cuda
当我去运行这个时:
sudo easy_install pyopencl
它给了我这个错误:
In file included from src/wrapper/wrap_cl.cpp:1:0:
src/wrapper/wrap_cl.hpp:20:19: fatal error: CL/cl.h: No such file or directory
但是,我可以验证上述文件确实是否存在与其他几个头文件:
/usr/local/cuda/include/CL/cl.h
我什至尝试设置 LD_LIBRATH_PATH:
export LD_LIBRARY_PATH=/usr/local/cuda/lib
但它似乎没有任何效果。
任何帮助表示赞赏!
so I've downloaded the nVidia CUDA libraries and put them in the default location:
/usr/local/cuda
When I go to run this:
sudo easy_install pyopencl
It gives me this error:
In file included from src/wrapper/wrap_cl.cpp:1:0:
src/wrapper/wrap_cl.hpp:20:19: fatal error: CL/cl.h: No such file or directory
I can, however, verify that the above file does exist along with several other header files:
/usr/local/cuda/include/CL/cl.h
I've even tried setting the LD_LIBRATH_PATH:
export LD_LIBRARY_PATH=/usr/local/cuda/lib
But it doesn't seem to have any effect.
Any help is appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的编译器的包含路径可能不包含/usr/local/cuda/include/。环境变量 LD_LIBRARY_PATH 实际上是告诉编译器/运行时环境在哪里可以找到共享对象文件。有两种方法(已知)可以解决此问题:
1)大多数编译器接受一个标志,该标志指定添加到包含路径中;对于 gcc,它是 -I,因此
将告诉 gcc 除了系统包含路径之外,还在 /usr/local/cuda/include 中查找包含内容
2) 将 OpenCL 头文件链接到系统包含路径(通常为 /usr/include /)。
像这样的东西:
从目录 /usr/include 中执行应该可以工作。
如果解决此问题后,您遇到如下问题:
那么您可能需要查看 这个问题。
Your compiler's include path probably doesn't include /usr/local/cuda/include/. The environment variable LD_LIBRARY_PATH is actually there to tell the compiler/runtime environment where to find shared object files. There are two ways (that know of) to fix this:
1) Most compilers accept a flag that specifies an addition to the include path; for gcc, it's -I, so
will tell gcc to look for includes in /usr/local/cuda/include, in addition to the system include path
2) Link the OpenCL header files into your system include path (usually /usr/include/).
Something like:
executed from within the directory /usr/include should work.
If after fixing this problem, you have a problem like the following:
then you might want to look at this question.