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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cmake/FindCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,15 @@ if(is_dpcpp)
INTERFACE_LINK_LIBRARIES ${SYCL_LIBRARY})
endif()

endif()
if(ENABLE_ROCBLAS_BACKEND OR ENABLE_ROCRAND_BACKEND OR ENABLE_ROCSOLVER_BACKEND)
# Allow find_package(HIP) to find the correct path to libclang_rt.builtins.a
# HIP's CMake uses the command `${HIP_CXX_COMPILER} -print-libgcc-file-name --rtlib=compiler-rt` to find this path.
# This can print a non-existing file if the compiler used is icpx.
if(NOT HIP_CXX_COMPILER)
find_path(HIP_CXX_COMPILER clang++
HINTS ENV HIPROOT ENV ROCM_PATH
)
endif()
endif()

endif(is_dpcpp)
13 changes: 8 additions & 5 deletions docs/building_the_project_with_dpcpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,14 @@ Build FAQ

clangrt builtins lib not found
Encountered when trying to build oneMKL with some ROCm libraries. There are
several possible solutions: * If building Open DPC++ from source, add
``compiler-rt`` to the external projects compile option:
``--llvm-external-projects compiler-rt``. * The *clangrt* from ROCm can be
used, depending on ROCm version: ``export
LIBRARY_PATH=/path/to/rocm-$rocm-version$/llvm/lib/clang/$clang-version$/lib/linux/:$LIBRARY_PATH``
several possible solutions:

* If building Open DPC++ from source, add ``compiler-rt`` to the external
projects compile option: ``--llvm-external-projects compiler-rt``.
* Manually set the variable ``HIP_CXX_COMPILER`` to HIP's toolkit ``clang++``
path, for instance ``-DHIP_CXX_COMPILER=/opt/rocm/6.1.0/llvm/bin/clang++``.
oneMKL may fail to link if the clang versions of ``icpx`` and ``rocm`` are
not compatible.

Could NOT find CBLAS (missing: CBLAS file)
Encountered when tests are enabled along with the BLAS domain. The tests
Expand Down