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

Fix openmp-offload-amdgpu-clang-flang #395

Conversation

Meinersbur
Copy link
Member

@Meinersbur Meinersbur commented Feb 27, 2025

Since 0ac8f9d, openmp-offload-amdgpu-clang-flang is failing with

CMake Error at /home/botworker/builds/openmp-offload-amdgpu-clang-flang/llvm.src/flang-rt/lib/quadmath/CMakeLists.txt:85 (message):
  FLANG_RUNTIME_F128_MATH_LIB setting requires quadmath.h to be available:
  libquadmath

The reason is that flang-rt now is built using Clang (like all LLVM runtimes in a bootstrapping build), instead of gcc. quadmath.h is located in gcc's "resource dir" (on my system, it is /usr/lib/gcc/x86_64-linux-gnu/13/include/quadmath.h) instead in default paths such as /usr/include. Hence, clang cannot find it.

Remove the FLANG_RUNTIME_F128_MATH_LIB=libquadmath option since by design it does not work with Clang.

Alterantive approaches:

  • Instead of a bootstrapping build, do a out-of-tree build of flang-rt where we can set CMAKE_CXX_COMPILER=gcc.
  • Clang already looks for compatible gcc installation to access its libc files such as crtbegin.o. It wouldn't be too far fetched to also add its include dir to Clang's default search path. Otherwise, we need to wait until LLVM gets its own equivalent of libquadmath.

@Meinersbur Meinersbur requested a review from jplehr February 27, 2025 17:46
@jplehr jplehr requested a review from dpalermo February 27, 2025 20:07
@jplehr
Copy link
Contributor

jplehr commented Feb 27, 2025

Adding @dpalermo for awareness.

Copy link
Contributor

@jplehr jplehr left a comment

Choose a reason for hiding this comment

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

LGTM

@Meinersbur Meinersbur merged commit 63d43f5 into llvm:main Feb 27, 2025
2 checks passed
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.

2 participants