OpenCL ICD will not compile under Win7

Hi Everyone,

I am having a brutal time trying to compile the cl_khr_icd extension.
I have the latest CMake installed (, and using VC++ 2010.

I have copied the CL includes folder from the most recent NVidia CUDA SDK in to the “inc” folder.
(This wasn’t mentioned in the README file, by the way, I had to dig around to find this out.)

Running the “build_using_cmake.bat” works, until it tries to get nmake to compile the first binary.
I get a “CL/cl.h” not found error.

I modified the CMakeLists.txt file, changing “include_directories (./inc)” to “include_directories (inc)”.
This fixed the “CL/cl.h” problem, but then i get a new include error: “stddef.h” not found.

The Windows build is broken.
How is this supposed to work?


A followup!
I found out what the problem was: (and a solution, for other users.)

The documentation is pretty sparse that comes with the ICD. The information on the CL folder is misleading/wrong.
In the “inc” folder, there is a README document that recommends copying a CL folder there. The assumption that one makes is to grab the CL folder from your vendor’s SDK that you might have installed on your system.

That is simply going to cause a large number of problems, as the vendors alter the headers. Or worse, change the file names.

To make this work with a Windows build, you must use the CL headers located on the Khronos website.
As soon as I downloaded all of them and placed them in the CL folder within the “inc” folder, the build worked as advertised.

For those that maintain the ICD, here are some suggestions:

  • Update the documentation to specifically describe where to get the headers. Or, better yet, add the headers!
  • Add a step in the “CMake” config file to build a lib library, along with the DLL. I am sure the Linux users would use a link library, too. The command to build a link library can easily be added to the CMakeLists file… Something like "add_library (STATIC file.c file.c etc…)