0

I ran the following and have no idea where it got installed

sudo apt-get install opencl-headers

I thought it went here: /usr/include

but it might have gone here: /usr/include/x86_64-linux-gnu I tried both like on the following

-DOPENCL_INCLUDE_DIRS=/usr/include/x86_64-linux-gnu  

I am getting duplicate definition such as time_t and time64_t so it appears that neither of the above are the actual include for opencl

1 Answers1

4

Let's take a look at the package description:

$ apt show opencl-headers

... This metapackage depends on packages providing the C and C++ headers files for the OpenCL API as published by The Khronos Group Inc. The corresponding specification and documentation can be found on the Khronos website. ...

A metapackage doesn't provide ANY files itself. Instead, dependencies provide the files. We must look up the dependencies of this metapackage:

$ apt depends opencl-headers

opencl-headers Depends: opencl-c-headers (= 2.2~2019.01.17-g49f07d3-1) Depends: opencl-clhpp-headers (>= 2.0.10)

So you must look at those packages for the files provided.

After you know which package(s) to look at, dpkg has a convenient feature to list the files provided any installed package.

From man dpkg:

      -L, --listfiles package-name...
          List files installed to your system from package-name.

For example, here are the files installed by the hello package:

$ dpkg -L hello

/. /usr /usr/bin /usr/bin/hello /usr/share /usr/share/doc /usr/share/doc/hello /usr/share/doc/hello/NEWS.gz /usr/share/doc/hello/changelog.Debian.gz /usr/share/doc/hello/copyright /usr/share/info /usr/share/info/hello.info.gz /usr/share/man /usr/share/man/man1 /usr/share/man/man1/hello.1.gz

For fun, let's also work backwards and determine whoch package provides a specific file:

      -S, --search filename-search-pattern...
          Search for a filename from installed packages.

In this example, you can see that the file is provided by the hello package:

$ dpkg -S /usr/share/doc/hello/NEWS.gz

hello: /usr/share/doc/hello/NEWS.gz

user535733
  • 62,253
  • Thanks, found it but also found another problem and was able to solve it. I found the opencl folder at /usr/include/CL but another problem arose. The source file was "CL/cl.h" and the cmake had to be /usr/include to get the CL BUT BUT that include picked up all types of conflicts with mingw. So I created the folder "OpenCL" and moved the "CL" folder into it. That allowed me to change the cmake to "/usr/include/OpenCL" which got the CL folder but did not cause conflicting definitions such as time64_t and time_t as well as 100's of others. – Joseph Stateson Dec 26 '19 at 18:47