OpenCL-ICD-Loader icon indicating copy to clipboard operation
OpenCL-ICD-Loader copied to clipboard

make fails when following the instruction

Open ggghamd opened this issue 4 years ago • 2 comments

Instruction mention to define OPENCL_ICD_LOADER_HEADERS_DIR to include header and has no effect so fails. Please test before publishing, otherwise it is useless. root@sriov-guest:/git.co/khronos# env | grep OPENCL OPENCL_ICD_LOADER_HEADERS_DIR=/git.co/khronos/OpenCL-Headers/CL/ root@sriov-guest:/git.co/khronos# cd OpenCL-ICD-Loader/ root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader# pwd /git.co/khronos/OpenCL-ICD-Loader root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader# ls CL CMakeLists.txt CODE_OF_CONDUCT.md LICENSE README.md build inc loader test root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader# cd build root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader/build# cmake .. -- Configuring done -- Generating done -- Build files have been written to: /git.co/khronos/OpenCL-ICD-Loader/build root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader/build# make [ 20%] Built target OpenCL [ 24%] Building C object test/log/CMakeFiles/IcdLog.dir/icd_test_log.c.o /git.co/khronos/OpenCL-ICD-Loader/test/log/icd_test_log.c:5:9: fatal error: CL/cl.h: No such file or directory #include<CL/cl.h> ^~~~~~~~~ compilation terminated. test/log/CMakeFiles/IcdLog.dir/build.make:62: recipe for target 'test/log/CMakeFiles/IcdLog.dir/icd_test_log.c.o' failed make[2]: *** [test/log/CMakeFiles/IcdLog.dir/icd_test_log.c.o] Error 1 CMakeFiles/Makefile2:1042: recipe for target 'test/log/CMakeFiles/IcdLog.dir/all' failed make[1]: *** [test/log/CMakeFiles/IcdLog.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2 root@sriov-guest:/git.co/khronos/OpenCL-ICD-Loader/build#

ggghamd avatar Mar 23 '20 04:03 ggghamd

Hi, the OPENCL_ICD_LOADER_HEADERS_DIR should be where you've cloned the OpenCL headers, and does not need the CL suffix. Also, this should be a CMake variable, not a shell environment variable. Looking at your output above, can you try:

cmake -DOPENCL_ICD_LOADER_HEADERS_DIR=/git.co/khronos/OpenCL-Headers/ ..

You can also refer to the build setup we use for the Travis CI builds in .travis.yml, if that helps. Thanks!

bashbaug avatar Mar 23 '20 05:03 bashbaug

Hi @ggghamd, can you please confirm that you were able to build the ICD loader following the instructions above? Thanks!

bashbaug avatar Apr 06 '20 16:04 bashbaug