llvm-project
llvm-project copied to clipboard
Recent regression: `The dependency target "omptarget.devicertl.amdgpu" of target "omptarget.rtl.amdgpu" does not exist.`
Failing to build on apt.llvm.org - linux
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- Configuring done
CMake Error at /home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt:92 (add_dependencies):
The dependency target "omptarget.devicertl.amdgpu" of target
"omptarget.rtl.amdgpu" does not exist.
CMake Error at /home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/openmp/libomptarget/plugins/cuda/CMakeLists.txt:85 (add_dependencies):
The dependency target "omptarget.devicertl.nvptx" of target
"omptarget.rtl.cuda" does not exist.
With:
cd "/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/runtimes/runtimes-bins" && /usr/bin/cmake "-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF "-DCMAKE_C_COMPILER=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/clang" "-DCMAKE_CXX_COMPILER=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/clang++" "-DCMAKE_ASM_COMPILER=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/clang" "-DCMAKE_LINKER=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/ld.lld" "-DCMAKE_AR=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-ar" "-DCMAKE_RANLIB=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-ranlib" "-DCMAKE_NM=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-nm" "-DCMAKE_OBJDUMP=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-objdump" "-DCMAKE_OBJCOPY=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-objcopy" "-DCMAKE_STRIP=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-strip" "-DCMAKE_READELF=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/./bin/llvm-readelf" -DCMAKE_C_COMPILER_TARGET=x86_64-pc-linux-gnu -DCMAKE_CXX_COMPILER_TARGET=x86_64-pc-linux-gnu -DCMAKE_ASM_COMPILER_TARGET=x86_64-pc-linux-gnu -DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-16 "-DLLVM_BINARY_DIR=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm" "-DLLVM_CONFIG_PATH=/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/bin/llvm-config" -DLLVM_ENABLE_WERROR=OFF -DLLVM_HOST_TRIPLE=x86_64-pc-linux-gnu -DLLVM_HAVE_LINK_VERSION_SCRIPT=1 -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=OFF -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON -DLLVM_LIT_ARGS=-sv -DLLVM_SOURCE_PREFIX= -DPACKAGE_VERSION=16.0.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DCMAKE_C_COMPILER_LAUNCHER= -DCMAKE_CXX_COMPILER_LAUNCHER= -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCOMPILER_RT_BUILD_BUILTINS=Off -DLLVM_INCLUDE_TESTS=ON -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-pc-linux-gnu -DLLVM_ENABLE_PROJECTS_USED=ON -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_BUILD_TOOLS=ON -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER_WORKS=ON -DCMAKE_CXX_COMPILER_WORKS=ON -DCMAKE_ASM_COMPILER_WORKS=ON -DHAVE_LLVM_LIT=ON "-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2" "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF "-DLLVM_ENABLE_RUNTIMES=compiler-rt;libcxx;libcxxabi;libunwind;openmp" -DLLVM_USE_LINKER=gold -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_INCLUDE_TESTS=OFF -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON -DCOMPILER_RT_USE_LIBCXX=OFF -DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXXABI_INSTALL_LIBRARY=OFF -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBCXX_ENABLE_EXCEPTIONS=ON -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON -DLIBCXX_INSTALL_LIBRARY=OFF -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON -DLIBCXX_USE_COMPILER_RT=ON -DLIBCXXABI_ENABLE_EXCEPTIONS=ON -DLIBCXXABI_INSTALL_LIBRARY=OFF -DLIBCXXABI_USE_COMPILER_RT=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBUNWIND_INSTALL_LIBRARY=OFF -DLIBUNWIND_USE_COMPILER_RT=ON -DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF -DOPENMP_ENABLE_LIBOMP_PROFILING=OFF -DOPENMP_USE_LLVM_UNWINDER=ON -DLIBOMP_ENABLE_RTTI=OFF -DLIBOMP_LIBFLAGS=-lm -DLIBOMP_OMPT_SUPPORT=OFF -DRUNTIMES_BUILD_BUILTINS=ON "-DRUNTIMES_CMAKE_ARGS=-DCMAKE_C_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2;-DCMAKE_CXX_FLAGS=-fstack-protector-strong -Wformat -Werror=format-security -Wno-unused-command-line-argument -Wdate-time -D_FORTIFY_SOURCE=2;-DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id;-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id;-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-z,relro -Wl,--build-id;-DCMAKE_BUILD_TYPE=Release;-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF" -GNinja "/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/llvm/runtimes/../../runtimes" && /usr/bin/cmake -E touch "/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-toolchain-snapshot_16~++20221007093751+a6a0d9ecd5d7/build-llvm/runtimes/runtimes-stamps/runtimes-configure"
Was working with fdadb5c14696
@llvm/issue-subscribers-openmp
Full log: https://llvm-jenkins.debian.net/job/llvm-toolchain-binaries/architecture=amd64,distribution=unstable,label=amd64/663/consoleFull
The logs suggest that it's not building the device runtime library because it cannot find one of the tools. I recently made a small change there in 92233159035d1b50face95d886901cf99035bd99. I don't get this error locally, would it be possible for you to verify that it is picking up the llvm-extract
binary?
it is picking up the llvm-extract binary?
@jhuber6 sorry but what do you mean here? at time of the failure, llvm-extract isn't built yet (it is using stage 2 + runtime builds)
it is picking up the llvm-extract binary?
@jhuber6 sorry but what do you mean here? at time of the failure, llvm-extract isn't built yet (it is using stage 2 + runtime builds)
The DeviceRTL requires already built LLVM tools. It already uses opt
and other tools, so I'm unsure why adding another LLVM tool dependency would cause an issue. The reason for this is that the DeviceRTL is a bitcode library, which requires it to be built using the same compiler / LLVM version that will import it. The change I linked only added an additional tool, so I am unsure why it seems to prevent it from building when it worked before. You could try removing the EXTRACT_TOOL
from this line as it's the only change that would start this suddenly not building anymore.
if ((NOT CLANG_TOOL) OR (NOT LINK_TOOL) OR (NOT OPT_TOOL) OR (NOT EXTRACT_TOOL))
Alternatively, you can build openmp with -DLLVM_ENABLE_RUNTIMES=openmp
and remove it from the projects. This is more likely to work. I can't reproduce this problem locally so it's difficult for me to test myself.
I will try to remove the (NOT EXTRACT_TOOL)
OpenMP is already building as RUNTIMES, not as PROJECTS
I will try to remove the (NOT EXTRACT_TOOL)
OpenMP is already building as RUNTIMES, not as PROJECTS
I just pushed that should actually print the value of EXTRACT_TOOL
in the error message. This should hopefully make it easier to figure out what the problem is in the next build's logs.
The commit for others: https://github.com/llvm/llvm-project/commit/1bddb0fc2312efd82987c8ea20a5a7d66f6d1b26
Removing EXTRACT_TOOL give
/bin/sh: 1: EXTRACT_TOOL-NOTFOUND: not found
Removing EXTRACT_TOOL give
/bin/sh: 1: EXTRACT_TOOL-NOTFOUND: not found
But it seems to find opt
, those should be installed next to each-other as they're both LLVM tools. They're found using the same path so I'm not sure why it cannot find llvm-extract
.
With the error:
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Not building DeviceRTL. Missing clang: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/clang, llvm-link: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/llvm-link, opt: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/opt, llvm-extract: EXTRACT_TOOL-NOTFOUND, or clang-offload-packager: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/clang-offload-packager
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- Configuring done
CMake Error at /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt:92 (add_dependencies):
The dependency target "omptarget.devicertl.amdgpu" of target
"omptarget.rtl.amdgpu" does not exist.
CMake Error at /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/openmp/libomptarget/plugins/cuda/CMakeLists.txt:85 (add_dependencies):
The dependency target "omptarget.devicertl.nvptx" of target
"omptarget.rtl.cuda" does not exist.
I guess the build of openmp arrives too quickly
With the error:
-- LIBOMPTARGET: Building x86_64 offloading plugin. -- LIBOMPTARGET: Not building DeviceRTL. Missing clang: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/clang, llvm-link: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/llvm-link, opt: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/opt, llvm-extract: EXTRACT_TOOL-NOTFOUND, or clang-offload-packager: /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/build-llvm/bin/clang-offload-packager -- LIBOMPTARGET: Building the llvm-omp-device-info tool -- Configuring done CMake Error at /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt:92 (add_dependencies): The dependency target "omptarget.devicertl.amdgpu" of target "omptarget.rtl.amdgpu" does not exist. CMake Error at /build/llvm-toolchain-snapshot-16~++20221007052802+3e6767ed5f6d/openmp/libomptarget/plugins/cuda/CMakeLists.txt:85 (add_dependencies): The dependency target "omptarget.devicertl.nvptx" of target "omptarget.rtl.cuda" does not exist.
I guess the build of openmp arrives too quickly
I'm confused because it finds opt
and other tools, but not llvm-extract
. Can you verify that llvm-extract
exists in ./bin
of your build directory? Also is it possible for you to try a completely clean build? It might not be updating some needed dependencies.
Can you verify that llvm-extract exists in ./bin of your build directory?
No, it doesn't exist. replacing "stage2" by "llvm-extract stage2" in the ninja target build fixes the issue
is it possible for you to try a completely clean build?
all my builds are fresh (with a new chroot) This is a regression from your change, not a local issue. openmp should force the build of llvm-extract first
all my builds are fresh (with a new chroot) This is a regression from your change, not a local issue. openmp should force the build of llvm-extract first
it was my understanding that using a -DLLVM_ENABLE_RUNTIMES=openmp
build forced building openmp
after both LLVM and the projects have already been built. This is why I'm unsure why it's an issue here. Does this still fail? There was a recent change in that file that fixed a (somewhat) separate issue 053e894106beb534ec27010b960ee58031a2fdb8.
This patch made things worse (even more failures)
This patch made things worse (even more failures)
Can you provide a link to the CMake logs? @ye-luo any ideas?
https://llvm-jenkins.debian.net/job/llvm-toolchain-kinetic-binaries/architecture=amd64,distribution=kinetic,label=amd64/43/consoleFull
-- LIBOMPTARGET: Building x86_64 offloading plugin.
-- LIBOMPTARGET: Building DeviceRTL. Using clang: /build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/build-llvm/bin/clang, llvm-link: /build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/build-llvm/bin/llvm-link and opt: /build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/build-llvm/bin/opt
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- Configuring done
CMake Error at /build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/openmp/libomptarget/DeviceRTL/CMakeLists.txt:197 (add_dependencies):
The dependency target "extracted_libomptarget-nvptx-sm_35.bc" of target
"packaged_libomptarget-nvptx-sm_35.bc" does not exist.
Call Stack (most recent call first):
/build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/openmp/libomptarget/DeviceRTL/CMakeLists.txt:252 (compileDeviceRTLLibrary)
CMake Error at /build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/openmp/libomptarget/DeviceRTL/CMakeLists.txt:197 (add_dependencies):
The dependency target "extracted_libomptarget-nvptx-sm_37.bc" of target
"packaged_libomptarget-nvptx-sm_37.bc" does not exist.
Call Stack (most recent call first):
/build/llvm-toolchain-snapshot-16~++20221011034011+183bf9b34b7a/openmp/libomptarget/DeviceRTL/CMakeLists.txt:252 (compileDeviceRTLLibrary)
[...]
Note that I am forcing llvm-extract to be built earlier with:
VERBOSE=1 cmake --build build-llvm -j 32 --target llvm-extract stage2
I checked out 183bf9b34b7a and found compileDeviceRTLLibrary is not at line 252. Could you check your source code?
@ye-luo i have a few patches on top of the repo (unrelated to this issue)
Also, https://github.com/llvm/llvm-project/commit/183bf9b34b7a0880fea2fcea3e805abdc890290f was just to share when it was working but https://github.com/llvm/llvm-project/commit/92233159035d1b50face95d886901cf99035bd99 is clearly the regressor
https://github.com/llvm/llvm-project/commit/053e894106beb534ec27010b960ee58031a2fdb8 should have fixed the regression caused by https://github.com/llvm/llvm-project/commit/92233159035d1b50face95d886901cf99035bd99 at least in my use case. Since I changed add_custom_command to add_custom_target, it is likely your patch needs to be updated since it touches openmp/libomptarget/DeviceRTL/CMakeLists.txt
. Probably you could try a clean commit without the patches and see if the old error appears.
it seems that removing my revert and with your fix, it now works :) many thanks
Actually, it is still fail bionic on arm64 with:
-- LIBOMPTARGET: Not building nec-aurora plugin: libveo or libveosinfo not found.
-- LIBOMPTARGET: Not building x86_64 offloading plugin: machine not found in the system.
-- LIBOMPTARGET: Not building DeviceRTL. Missing clang: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/clang, llvm-link: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/llvm-link, opt: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/opt, llvm-extract: EXTRACT_TOOL-NOTFOUND, or clang-offload-packager: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/clang-offload-packager
-- LIBOMPTARGET: Building the llvm-omp-device-info tool
-- Configuring done
CMake Error at /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/openmp/libomptarget/plugins/amdgpu/CMakeLists.txt:92 (add_dependencies):
The dependency target "omptarget.devicertl.amdgpu" of target
"omptarget.rtl.amdgpu" does not exist.
CMake Error at /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/openmp/libomptarget/plugins/cuda/CMakeLists.txt:85 (add_dependencies):
The dependency target "omptarget.devicertl.nvptx" of target
"omptarget.rtl.cuda" does not exist.
@ye-luo do you have an update on this ? I can provide a way to reproduce if it helps thanks
I saw -- LIBOMPTARGET: Not building DeviceRTL. Missing clang: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/clang, llvm-link: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/llvm-link, opt: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/opt, llvm-extract: EXTRACT_TOOL-NOTFOUND, or clang-offload-packager: /build/llvm-toolchain-snapshot-16~++20221014091649+ae27323428ff/build-llvm/bin/clang-offload-packager
Probably you need to first figure out why llvm-extract: EXTRACT_TOOL-NOTFOUND,
Try adding openmp in LLVM_ENABLE_PROJECTS instead of LLVM_ENABLE_RUNTIMES
I'll close this for now. Feel free to reopen it if it's still the case.