5

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?

bastijn
  • 5,841
  • 5
  • 27
  • 43

3 Answers3

5

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.

derobert
  • 49,731
  • 15
  • 94
  • 124
  • I ended up adding it to a separate file handling INCLUDEPATHS for that specific module. But verified that your option does work as well and is indeed the thing I originally asked for. Therefor accepted your answer as final. Thanks. – bastijn Feb 02 '11 at 09:10
  • Thanks, this just helped me to compile darktable with the new 200 series of the nvidia drivers. (There is no debian package yet which delivers the CL/cl.h header file.) – Simon A. Eugster Mar 08 '11 at 21:17
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
2

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

sudo apt-get install opencl-headers
OscarGarcia
  • 1,995
  • 16
  • 17