Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cl.h not found - how to link in makefile

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?

like image 716
bastijn Avatar asked Feb 02 '11 08:02

bastijn


3 Answers

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.

like image 98
derobert Avatar answered Nov 15 '22 08:11

derobert


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
like image 30
perlking neo Avatar answered Nov 15 '22 07:11

perlking neo


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

sudo apt-get install opencl-headers
like image 34
OscarGarcia Avatar answered Nov 15 '22 06:11

OscarGarcia