[Openmp-commits] [PATCH] D108534: [OpenMP][Docs] add clang to LLVM_ENABLE_PROJECTS in build instructions

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Aug 23 06:32:18 PDT 2021


JonChesterfield added reviewers: JonChesterfield, tianshilei1992.
JonChesterfield added a comment.

Building openmp offloading via LLVM_ENABLE_PROJECTS makes it difficult to get the deviceRTL and clang to exactly match so it's not as heavily tested as it might be. Corresponding part of the CMakeLists is:

  if (LLVM_DIR)
    # Builds that use pre-installed LLVM have LLVM_DIR set.
    find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
    find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}
      NO_DEFAULT_PATH)
    find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)
    libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}")
  else()
    # LLVM in-tree builds may use CMake target names to discover the tools.
    set(CLANG_TOOL $<TARGET_FILE:clang>)
    set(LINK_TOOL $<TARGET_FILE:llvm-link>)
    set(OPT_TOOL $<TARGET_FILE:opt>)
    libomptarget_say("Building AMDGCN device RTL. Using clang from in-tree build")
  endif()

Nvptx has done something different. Things like

  if (LLVM_TOOL_CLANG_BUILD AND NOT CMAKE_CROSSCOMPILING)

  if (NOT OPENMP_STANDALONE_BUILD AND NOT CMAKE_CROSSCOMPILING)

Looks like that was introduced by D101265 <https://reviews.llvm.org/D101265>.

Mismatch between clang and the deviceRTL is really easy to do by accident with the ENABLE_PROJECTS approach and we don't do anything like burn a git hash into the deviceRTL to check at runtime that they match. I'm inclined to say that we should totally disable openmp offloading when not building via ENABLE_RUNTIMES. Anyone know how to spell that in cmake?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108534/new/

https://reviews.llvm.org/D108534



More information about the Openmp-commits mailing list