Skip to content

[OpenMP] nvptx64-nvidia-cuda device library ignores LLVM_LIBDIR_SUFFIX #159762

@tuliom

Description

@tuliom

Since the migration of the device libraries in #136729, we started seeing an unexpected behavior while building the nvptx64-nvidia-cuda device library.
The library does get built, but it the installation ignores the value from -DLLVM_LIBDIR_SUFFIX=64.

I investigated this a bit and the earliest point where LLVM_LIBDIR_SUFFIX is erased is the following.
Notice also the warning messages about LLVM and Clang not being found:

-- Detecting CXX compiler ABI info - failed
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find LLVM (missing: LLVM_DIR)
-- Could NOT find Clang (missing: Clang_DIR)
CMake Warning at CMakeLists.txt:94 (message):
  debug-tm20 OPENMP_INSTALL_LIBDIR=


CMake Warning at CMakeLists.txt:95 (message):
  debug-tm20
  LLVM_LIBRARY_OUTPUT_INTDIR=/builddir/build/BUILD/llvm-22.0.0_pre20250909.g6a726e9a4d3d05-build/llvm-project-6a726e9a4d3d05f9aecf366fb6488d63135f04f3/llvm/redhat-linux-build/runtimes/runtimes-nvptx64-nvidia-cuda-bins/lib


CMake Warning at CMakeLists.txt:96 (message):
  debug-tm20 LLVM_LIBDIR_SUFFIX=


-- Performing Test CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG
-- Performing Test CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOSTDLIBXX_FLAG
-- Performing Test CXX_SUPPORTS_NOSTDLIBXX_FLAG - Failed
-- Performing Test CXX_SUPPORTS_NOSTDINCXX_FLAG
-- Performing Test CXX_SUPPORTS_NOSTDINCXX_FLAG - Failed
CMake Warning (dev) at /usr/share/cmake/Modules/GNUInstallDirs.cmake:253 (message):
  Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
  target architecture is known.  Please enable at least one language before
  including GNUInstallDirs.
Call Stack (most recent call first):
  /builddir/build/BUILD/llvm-22.0.0_pre20250909.g6a726e9a4d3d05-build/llvm-project-6a726e9a4d3d05f9aecf366fb6488d63135f04f3/llvm/cmake/modules/AddLLVM.cmake:1 (include)
  CMakeLists.txt:202 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

When setting -DRUNTIMES_nvptx64-nvidia-cuda_LLVM_LIBDIR_SUFFIX=64 behavior does not reproduce, although the warnings about not finding LLVM and Clang are still there. A full build log is available at:
builder-live.log.gz

The amdgcn-amd-amdhsa library does not show the same issue after applying #159758 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    cmakeBuild system in general and CMake in particularopenmp

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions