<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112210>112210</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[offload] [test-suite] 19.1.1 Bug in the test-suite for the offload runtime
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Crivella
</td>
</tr>
</table>
<pre>
When running the test-suite after a 3 stage build, if the `offload` runtime is enabled (tested with host offloading only), all test related to offloading fails with error of the type described in:
- https://github.com/easybuilders/easybuild-easyblocks/pull/3373#issuecomment-2404623211
- https://github.com/llvm/llvm-project/issues/90333
I am unsure if I am doing something wrong in my build setup, but in case this is an actual bug, I was able to fix it by applying the patch in:
- https://github.com/easybuilders/easybuild-easyconfigs/blob/21f9b19ccb38095ee41dffdc5528f5db492a7eca/easybuild/easyconfigs/l/LLVM/LLVM-19.1.1_libomptarget_tests.patch
Description of the changes:
- offload/CMakeLists.txt: Required to add `-fopenmp` to the `test_openmp_flags` in the respective `lit.cfg` file
- offload/test/lit.cfg: Required to add the correct include path to:
- the `omp.h` header as `omp_header_directory` (`LIBOMPTARGET_OPENMP_HEADER_FOLDER`) are not being set
- This should probably be solved in the `CMakeLists.txt` but I am not sure if it is as straightforward as copying the old lines from `openmp/runtime` as I assume `CMAKE_CURRENT_BINARY_DIR` is not gonna be the same when run from the `offload` dir.
- Use the correct target: the offload tests will set the target to `x86_64-pc-linux-gnu` even if the default target for the clang compilation is `x86_64-unknown-linux-gnu`. If the correct target is not set the tests will fail for not finding the `clang_rt.builtins.a` file
```
ld.lld: error: cannot open /home/crivella/.local/easybuild/build/LLVM/19.1.1/system-system/llvm.obj.3/lib/clang/19/lib/x86_64-pc-linux-gnu/libclang_rt.builtins.a: No such file or directory
```
- I am unsure if the way this is implemented would be able to catch all triples provided by [config.guess](https://github.com/llvm/llvm-project/blob/main/llvm/cmake/config.guess) beyond the x86_64 archs.
- offload/test/lit.site.cfg.in: Same as last point in order to pass `config.host_triple` to the `lit.cfg` file in order to check the currently set host triple vs the tested openmp_target
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVt1u47wRfRr6ZmBBomTHvvBFsonboNkfuPu16JVBUSOJG4pUScpev30xlOQ4uynQFgWCSCap-T3nDIX3qjGIO7Z6YKvHhRhCa93uk1Mn1FosSltddn9v0YAbjFGmgdAiBPRh6QcVEEQd0IGAHHwQDUI5KF0x_glUHY-ydWrrWltRsXVKRoLqEJQHNKLUWAHjGzKHFZxVaKG1PsD0BbmzRl8Y35JFoXX0DA61oA-CvT1ZC6X9aASdsw7sGEG49AgVeulUiRUow_J7lj6ydPq_hDaE3tMq3zO-b1RohzKRtmN8j8JfYkro_O3PZXzTVr7Scj9ozfg-z-9yxnPl_YDSdh2asORFWqx5zrPsP_Cm9Wl-LHtnf6AMjO-jPXKzTfM8vw39GUQHg_GDQ6p3_FlZKoa3HYaW3s7OmgaUge4yNgc8hqGngpZDoA0pPEJolae2CANChkFoKIeGDj3DWXigXlG9a_UTVIDyAqLv9WUGRC-CbP-fpZXW1Kqh9VLbkvE9z-ptmW2lLPNNul0hFllV15VcrfimXlVlseXiDqW4tTS9v9miJr28_O3z9Fhm2yRLsqNWpe36IFyD4UgI80lM6DaV2_-PEUx9UNbMIJOtMA363_Kfsc_3nz6LV3xRZDz8DCy_hwP-c1BuxLGoKqLKsrY9mq4nrgQ7E4hCOo4bx1qLxtO2MnHboe9RBnWKJ7UKiawb2q-Vxt-jIFNUiOncB1HEbKxzKAkcUg9VbG8LwV6zA1heyd31SUv-WhQVKYGfVo_jwrFSZMq6Cx1ifMPW6cvzw9fP377fH_709P349dvTl8_fjn9-un98Ohz3X18enw5snTK-BeEQjA1QYoQ0htk7UADfCbG-tYOuoHe2FKW-QIngrT5Fns8h_lL5dRqBH8lC1mf2qBDx78EHJ1TThtq6s3AVLUnbX7FudQVaGfRQO9vFbMee8f0kb-R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