cl.h not found - how to link in makefile

僤鯓⒐⒋嵵緔 提交于 2019-12-07 06:21:18

问题


I have a project which requires opencl. I have installed CUDA and openCL on my machine but when I 'make' my project the following error occurs:

CL/cl.h: No such file or directory

I know that the i can create a hard link (in my unix (ubuntu) system) to fix the problem:

ln -s /usr/include/nvidia-current/CL

But i consider this a quick fix and not the correct solution. I would like to handle this in my makefile (i guess) so that a simple "make" command would compile. How could I do this?


回答1:


You need to pass an appropriate -I option to the compiler (by setting CPPFLAGS or CFLAGS, for example). -I/usr/include/nvidia-current sounds like it'd work.




回答2:


I saw this thread from compile opencl program using CL/cl.h file

I installed 7.5 and added below link in /usr/include, it works for my opencl program. looks like CUDA forget to implement this link after the installation.

ln -s /usr/local/cuda-7.5/include/CL /usr/include



回答3:


Are you using Ubuntu or Debian distro? Then now you can use this package:

sudo apt-get install opencl-headers


来源:https://stackoverflow.com/questions/4872143/cl-h-not-found-how-to-link-in-makefile

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!