From db3da0d302a33632a502cd271dfd9487f973bd2d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Wed, 19 Jun 2024 23:52:57 +0300 Subject: [PATCH] clc: find opencl headers from the installed llvm/clang location A number of people report the headers not being found when running intel-clc. I've run into the same issue but only on the most recent Ubuntu version. Signed-off-by: Lionel Landwerlin Reviewed-by: Karol Herbst Part-of: (cherry picked from commit 0f6fa4679d6705660b83579a20fb50cfad2c0184) --- .pick_status.json | 2 +- src/compiler/clc/clc_helpers.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 7d80a05db5b..53cfec15769 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5324,7 +5324,7 @@ "description": "clc: find opencl headers from the installed llvm/clang location", "nominated": false, "nomination_type": 3, - "resolution": 4, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/compiler/clc/clc_helpers.cpp b/src/compiler/clc/clc_helpers.cpp index 346a811386d..9cafc881037 100644 --- a/src/compiler/clc/clc_helpers.cpp +++ b/src/compiler/clc/clc_helpers.cpp @@ -906,6 +906,12 @@ clc_compile_to_llvm_module(LLVMContext &llvm_ctx, c->getHeaderSearchOpts().AddPath(clang_res_path.string(), clang::frontend::Angled, false, false); + + auto clang_install_res_path = + fs::path(LLVM_LIB_DIR) / "clang" / std::to_string(LLVM_VERSION_MAJOR) / "include"; + c->getHeaderSearchOpts().AddPath(clang_install_res_path.string(), + clang::frontend::Angled, + false, false); #endif // Enable/Disable optional OpenCL C features. Some can be toggled via `OpenCLExtensionsAsWritten`