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

[HIP] Fix libclang_rt.builtins.a not found #532

Merged
merged 2 commits into from
Aug 9, 2024

Conversation

Rbiessy
Copy link
Contributor

@Rbiessy Rbiessy commented Jul 10, 2024

Description

Using the compiler from oneAPI's Base Toolkit and the Codeplay AMD plugin fails to compile by default with the error:

ninja: error: '/path/to/intel/oneapi/2024.2.0/compiler/2024.2/lib/clang/19/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a', needed by 'lib/libonemkl_sparse_blas_rocsparse.so.0', missing and no known rule to make it

As far as I know this is an issue for all ROC backends. The issue is that the command find_package(HIP) invokes ${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt to find the path of a dependency where HIP_CXX_COMPILER is set as CMAKE_CXX_COMPILER by default. This command is meant to be run with HIP's clang++ but when icpx is used the command is outputting a non-existant file.

As the documentation suggests this can be worked around by building intel/llvm which is not user friendly. The second workaround of setting LIBRARY_PATH did not work for me using ROCm 6.1.0 so I am suggesting to remove it.
The suggested solution should be more resilient and does not need any more action from the user as the environment variables HIPROOT or ROCM_PATH should already be set to use the ROC libraries.

Fixes #336

Checklist

All Submissions

  • [N/A] Do all unit tests pass locally? This does not affect the tests.
  • [N/A] Have you formatted the code using clang-format?

Bug fixes

  • [N/A] Have you added relevant regression tests?
  • Have you included information on how to reproduce the issue (either in a
    GitHub issue or in this PR)?

@Rbiessy Rbiessy requested a review from a team July 10, 2024 16:28
Copy link
Contributor

@hjabird hjabird left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docs render properly. I had trouble reproducing the clang-rt issue with the develop branch, but the changes in this PR also didn't create any new issues as far as I could tell.

Copy link
Contributor

@mkrainiuk mkrainiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thank you.

@npmiller
Copy link
Contributor

npmiller commented Aug 9, 2024

@hjabird @mkrainiuk would it be possible to merge this? It looks ready and it's a recurring issue we run into.

@hjabird hjabird merged commit 09b4123 into oneapi-src:develop Aug 9, 2024
8 checks passed
@Rbiessy Rbiessy deleted the romain/fix_clangrt_builtin branch August 15, 2024 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

clangrt builtins lib not found
4 participants