Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencl-c.h lookup fails, CLANG_RESOURCES_DIR determined at compile time #747

StefanBruens opened this issue Jul 28, 2019 · 1 comment


Copy link

StefanBruens commented Jul 28, 2019

The resources dir, containing opnecl-c.h is fixed at compile time:

ClangResourceDir = CLANG_RESOURCE_DIR;

If libclang gets a minor version upgrade later (e.g. from 8.0.0 to 8.0.1), the header is still searched for in the old location (e.g. /usr/lib64/clang/8.0.0/include/opencl-c.h). As the SOVERSION is unchanged, is is typically not picked up by the regular dependency mechanisms.

Related Debian bug report:

With LLVM master (> 8.0), the Resources patch can be queried with llvm::driver::Driver::GetResourcesPath(binarydir)

StefanBruens added a commit to StefanBruens/pocl that referenced this issue Jul 29, 2019
When the resources dir is determined at compile time, it also includes
the full version (e.g. /usr/lib64/clang/8.0.0/include/opencl-c.h). If
clang gets a minor version update later (e.g. from 8.0.0 to 8.0.1), pocl
will still add the obsolete path for the header lookup.

Determine the path at runtime instead. LLVM 9.0 adds a static method
llvm::driver::Driver::GetResourcesPath(...) which can be used, LLVM 8.0
and older have to use a dummy Driver instance.

Fixes pocl#747.
Copy link

franz commented Aug 1, 2019

Thanks, i've forward-ported this to master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants