-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build issues on Ubuntu 24.04 - incorrect openmp linkage in CMake #959
Comments
Coming back to this, I did some digging, and it's not clear to me how to set an actual vendor. Here's some background information: https://stackoverflow.com/questions/46414660/macos-cmake-and-openmp#48216682 I tried:
Which Clang gets it:
and links correctly. But GCC still doesn't:
And emits:
|
Weird, my build machine runs on Ubuntu 22.04.5 and does not have that problem. We run on Intel, AMD and Arm machines from AWS and did not have that problem either.
Not quite. This doesn't fix the issue, just makes GCC chose GOMP instead of OMP, which compiles and links fine, but the execution is really slow on high core count. Our rationale behind forcing LLVM's OMP is performance. You must install
I agree here. We probably got away with it because |
Reading CMake sources I don't see a way to specify a vendor. We should probably ping CMake maintainer on https://gitlab.kitware.com/cmake/cmake/-/issues/26263 and live with a hack in the meantime. |
OpenMP libraries a linked using the library name (i.e.
omp
):tpp-mlir/cmake/modules/xsmm-dnn.cmake
Lines 47 to 50 in 9c53a05
tpp-mlir/tools/tpp-run/CMakeLists.txt
Lines 12 to 14 in 9c53a05
This is not portable, as it assumes the
libomp.so
is in standard location, which might not be the case. And it seems that what happens on Ubuntu 24.04 withlibomp-dev
package installed.-lomp5
works, but not-lomp
.The recommended way to handle this is the following:
And that fix perfectly fixes the first code snippet.
For the second case it's a bit messy, because of
--no-as-needed
/--as-needed
hack. I suggest usingOpenMP_C_LIBRARIES
instead of-lomp
, though it brings two libraries on my machine:/usr/lib/llvm-18/lib/libomp.so;/lib/aarch64-linux-gnu/libpthread.a
The text was updated successfully, but these errors were encountered: