Skip to content

docs: LLVM OpenMP build may require clang project even when system clang is installed #799

Description

@rintaro-okahara

Description

I am trying to build Codon's LLVM fork by following the build-from-source documentation by following official docs (link)

The documentation currently suggests the LLVMdependency with:

git clone --depth 1 -b codon https://github.com/exaloop/llvm-project
cmake -S llvm-project/llvm -B llvm-project/build \
    -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_INCLUDE_TESTS=OFF \
    -DLLVM_ENABLE_RTTI=ON \
    -DLLVM_ENABLE_ZLIB=OFF \
    -DLLVM_ENABLE_ZSTD=OFF \
    -DLLVM_ENABLE_PROJECTS="openmp" \
    -DLLVM_TARGETS_TO_BUILD=all

It also says:

You can use -DLLVM_ENABLE_PROJECTS="clang;openmp" if you do not have clang installed on your system.

However, on my machine, clang is already installed, but the CMake generation step still falls because the OpenMP test targets depend on a CMake target named clang , not. just a system-installed clang

The error log is below

Make Error at cmake/modules/AddLLVM.cmake:2100 (add_dependencies):
  The dependency target "clang" of target "check-openmp" does not exist.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:2167 (add_lit_target)
  /Users/rintaro/work/dev/private/llvm-project/openmp/cmake/OpenMPTesting.cmake:225 (add_lit_testsuite)
  /Users/rintaro/work/dev/private/llvm-project/openmp/cmake/OpenMPTesting.cmake:248 (add_openmp_testsuite)
  /Users/rintaro/work/dev/private/llvm-project/openmp/CMakeLists.txt:156 (construct_check_openmp_target)


CMake Error at cmake/modules/AddLLVM.cmake:2100 (add_dependencies):
  The dependency target "clang" of target "check-libomp" does not exist.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:2167 (add_lit_target)
  /Users/rintaro/work/dev/private/llvm-project/openmp/cmake/OpenMPTesting.cmake:233 (add_lit_testsuite)
  /Users/rintaro/work/dev/private/llvm-project/openmp/runtime/test/CMakeLists.txt:44 (add_openmp_testsuite)


CMake Error at cmake/modules/AddLLVM.cmake:2100 (add_dependencies):
  The dependency target "clang" of target "check-ompt" does not exist.
Call Stack (most recent call first):
  cmake/modules/AddLLVM.cmake:2167 (add_lit_target)
  /Users/rintaro/work/dev/private/llvm-project/openmp/cmake/OpenMPTesting.cmake:225 (add_lit_testsuite)
  /Users/rintaro/work/dev/private/llvm-project/openmp/runtime/test/CMakeLists.txt:46 (add_openmp_testsuite)

After checking the LLVM/OpenMP CMake files, this appears to be a CMake target dependency rather than a lookup for a clang executable on PATH.

Relevant reference is shown below.

My Environment

  • OS : macOS
  • Architecture : arm64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions