intel / intel/intel-graphics-compiler
CMake doesn't handle the case when multiple `opencl-c.h` are found
- Dominant language
- C++
- Stars
- 718
- Forks
- 191
- PR merge metrics
- No merged PRs in 30d
Description
`get_filename_component` invocation fails because it's being done on a list (since multiple opencl-c.h can exist in a single LLVM installation)
```
-- =============================================================================
-- [IGC] : opencl-clang will be taken from prebuilds
-- [IGC] : Find CLANG_TOOL in : /home/pvelesko/install/llvm/14.0/dynamic/bin/clang
-- [IGC] : Find opencl-clang-lib in : /home/pvelesko/install/llvm/14.0/dynamic/lib/libopencl-clang.so
-- [CMFE] CM Frontend headers are taken from: /home/pvelesko/intel-compute-runtime-build/igc/IGC/CMFE/AdaptorCM
-- [CMFE] Using CMFE library name: libclangFEWrapper.so
-- +++ Source/IGC/VectorCompiler +++
-- [VC] Build proj: VectorCompiler
-- [VC] Using vc-intrinsics source from: /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/../../../vc-intrinsics/GenXIntrinsics
>>/home/pvelesko/intel-compute-runtime-build/igc/build/IGC/VectorCompiler/lib/GenXCodeGen/Utils/../<< -> /home/pvelesko/intel-compute-runtime-build/igc/build/IGC/VectorCompiler/lib/GenXCodeGen/Utils
COMMAND -> /usr/bin/python3 /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/GenXCodeGen/Utils/cisa_gen_intrinsics.py /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/GenXCodeGen/Utils/cisa_gen_intrinsics.json /home/pvelesko/intel-compute-runtime-build/igc/build/IGC/VectorCompiler/lib/GenXCodeGen/Utils/../ <-
/home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/GenXCodeGen/Utils
vc_build_bif - VCBiFPrintfOCL32 has extra dependencies: /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/BiF/printf_not_cm_common.h
vc_build_bif - VCBiFPrintfOCL64 has extra dependencies: /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/BiF/printf_not_cm_common.h
vc_build_bif - VCBiFPrintfZE32 has extra dependencies: /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/BiF/printf_not_cm_common.h
vc_build_bif - VCBiFPrintfZE64 has extra dependencies: /home/pvelesko/intel-compute-runtime-build/igc/IGC/VectorCompiler/lib/BiF/printf_not_cm_common.h
[IGC\BiFModuleCache] - IGC_BUILD__BIF_ROOT_DIR: /home/pvelesko/intel-compute-runtime-build/igc/build/IGC/Release/bif/
[IGC\BiFModuleCache] - Looking for files inside /home/pvelesko/install/llvm/14.0/dynamic/lib/clang/14.0.5/include/opencl-c.h
[IGC\BiFModuleCache] - BiFModule_SRC: /home/pvelesko/intel-compute-runtime-build/igc/IGC/BiFModule/cmake/../
CMake Error at IGC/BiFModule/CMakeLists.txt:48 (get_filename_component):
get_filename_component unknown component
/home/pvelesko/install/llvm/14.0/dynamic/lib/clang/14.0.5/include/opencl-c.h
```
```
╭─pvelesko@aurora-uan-0011 ~/install/llvm/14.0
╰─$ find ./ -name "opencl-c.h"
./include/cclang/opencl-c.h
./lib/clang/14.0.6/include/opencl-c.h
```
As a workaround I was able rename: `./include/cclang/opencl-c.h_BACKUP`
or edit CMakeLists.txt to use the first found `opencl-c.h`
Contributor guide
Assessment
This issue has not been assessed yet.