OpenCL-CLHPP icon indicating copy to clipboard operation
OpenCL-CLHPP copied to clipboard

Error when using external cl headers

Open isuruf opened this issue 2 years ago • 2 comments

CMake Error: install(EXPORT "OpenCLHeadersCppTargets" ...) includes target "HeadersCpp" which requires target "OpenCLHeaders" that is not in any export set.
CMake Error in CMakeLists.txt:
  export called with target "HeadersCpp" which requires target
  "OpenCLHeaders" that is not in any export set.

Here's how we invoke cmake https://github.com/conda-forge/clhpp-feedstock/blob/65ec400d4f221776e11078c5903b4c56cc8edc83/recipe/build.sh#L6-L16

Any ideas on how to fix this?

isuruf avatar Oct 02 '22 23:10 isuruf

Hello! The OpenCL C++ bindings (this repo) has a dependency on the OpenCL headers, which provides the target "OpenCLHeaders". Please see the build instructions and dependency information in the README:

https://github.com/KhronosGroup/OpenCL-CLHPP#build-instructions

Can you build and install the OpenCL headers before invoking CMake for the OpenCL C++ bindings? Note, you should not need the OpenCL ICD loader unless you are also building the examples, and it doesn't look like you are in the link above. Please let us know if this will work for you.

CC @MathiasMagnus in case I got any of this wrong - thanks!

bashbaug avatar Oct 03 '22 18:10 bashbaug

Thanks for the reply. I do have the OpenCL headers installed in ${OPENCL_DIST_DIR}/include as mentioned in the build instructions. It used to work with clhpp=2.0.16, but not anymore.

isuruf avatar Oct 03 '22 19:10 isuruf