<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90707>90707</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
offload: Fails to build libomp with `missing and no known rule to make it`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
cmake,
openmp,
build-problem,
offload
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sylvestre
</td>
</tr>
</table>
<pre>
with
```
cmake -S ../llvm/ -B build-llvm \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr/lib/llvm-19 \
-DLLVM_VERSION_SUFFIX= \
-DCMAKE_SUPPRESS_REGENERATION=ON \
-DCMAKE_BUILD_TYPE=Release \
-DPACKAGE_VENDOR=Debian \
-DENABLE_LINKER_BUILD_ID=ON \
-DLLVM_TARGETS_TO_BUILD=Native \
-DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;cross-project-tests;mlir;bolt;flang;polly;openmp;lldb" \
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libc;libunwind;offload" \
-DLLVM_ENABLE_PIC=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_INCLUDE_GO_TESTS=OFF \
-DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON \
-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON \
-DLLVM_ENABLE_CURL=ON \
-DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=ON \
-DCLANG_PLUGIN_SUPPORT=OFF \
-DCLANG_BUILD_EXAMPLES=OFF \
-DCLANG_DEFAULT_LINKER=ld \
-DCLANG_DEFAULT_RTLIB=libgcc \
-DCOMPILER_RT_BUILD_XRAY=OFF \
-DCOMPILER_RT_INCLUDE_TESTS=OFF \
-DCOMPILER_RT_USE_LIBCXX=OFF \
-DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON \
-DLIBUNWIND_INSTALL_LIBRARY=OFF \
-DOPENMP_ENABLE_LIBOMP_PROFILING=OFF \
-DOPENMP_ENABLE_LIBOMPTARGET_PROFILING=OFF \
-DLIBOMP_ENABLE_RTTI=OFF \
-DLIBOMP_OMPT_SUPPORT=OFF \
-DCLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=ON \
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \
-DLLVM_LIBC_GPU_BUILD=ON \
-DCMAKE_C_COMPILER_LAUNCHER=/opt/sccache//sccache -DCMAKE_CXX_COMPILER_LAUNCHER=/opt/sccache//sccache -DLLVM_USE_LINKER=gold -DLLVM_BINUTILS_INCDIR=/usr/include/ -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DLIBOMP_LIBFLAGS="-lm" -DOPENMP_USE_LLVM_UNWINDER=ON \
-DCLANG_ENABLE_BOOTSTRAP=ON
```
and
```
cmake --build build-llvm -j 13 --target stage2
```
The second stage fails with:
```
-- Configuring done (33.6s)
-- Generating done (1.3s)
-- Build files have been written to: /home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/runtimes/runtimes-bins
[3159/3170] cd /home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/runtimes/runtimes-bins && /usr/bin/cmake --build .
Change Dir: '/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/runtimes/runtimes-bins'
Run Build Command(s): /usr/bin/ninja -v
ninja: error: '/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/lib/libomp.so', needed by '/home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/lib/libomptarget.so.19.0', missing and no known rule to make it
FAILED: runtimes/runtimes-stamps/runtimes-build /home/sylvestre/dev/debian/pkg-llvm/llvm-toolchain/branches/llvm-project/build/build-llvm/runtimes/runtimes-stamps/runtimes-build
```
@jdoerfert @jhuber6 rings a bell ?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMV0tv4jwX_jVmYwUFh0tZsMiV-puQRCF02lWUiwF3nBjFoZ3--092AqUD7YzezYyESBw_5_hcHp9jZ0LQXU3IAkwsMHEG2bHd82Yh3tgLEW1DBjkv3xavtN1DoDtAN8FU739qWFTZDwK1NRwOAfIYe6kA8qBmwfxIWanJDxBM7A6sLWFA6-fs4otjr8xvboqDdWL6fhrFrocfgeEA5B1FI1XSvFesjeaXgr7_sEof3HiNwyBdb7xO7lr1ehNFsbtep7G7dAM3NhMcBsBwwuAaa22w76TJU-QCw4kJI5kgl6jItL-ZSzd9cAMnjIHhOCSnWX0JcQPT8t3Ux8E3N-4VYudqPWV9YsZLN1mnSdgBgeEEWUtfyBWy1xrF4f9cO1mrAKGCZfUOGJZ6ai3nTGjkZ9tkwLAYK-VMw4XQDg1_JkWrtUS0AhhWxWgDDCvnrAWGte21HDhjb8Cw-IHU1aFTkQOEPrMl3gQJXrknW3h1oIw0WiN1MpoXP3-eX7Kc9u_d41i_0lrax7dbxrPyi1UibN-O3cmKJMG3AV3ondCWFoaedwXAge1vHDddhmnirpPPYJu1m8aubyb4wU0jM7lfpzhIPewr129l1V1FYWzG2H9KTd8Pv6ehJFUY-va9ia-pd-mOvYn924DbZjiutVmmOPDCa0b7ZrBMI3-zxIHaBGGcXLvYobpYuY_mKurduoVyXM_c-EnPbWA4rPwcFCc-tiSG5rui-IALVxH23TiNk37hx9h8urHoBe6Uq08SdQmVgfKxZT8-_h4nl09wsJYCsRk_XYceW5vgOw6cc4W6QH7UHUZusIrS8_63wlUkN6yHfRws_wzfFYSvpHq9v7D_Jkbq-13ivTC23XRlJvY9DpYqbur7Ouwr65dsjdy4r2GnapA6OP5kH0nd6TLanEvdrQJsp-cU-eYmsO8VzwDy-KEFyBNFkRV7ApD3PoBn2cfH_yR93l5nXu84K08TFg42CfblbrM7586tidYFO5ZENTyno5xp4U6V0qmYozS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