-
Notifications
You must be signed in to change notification settings - Fork 203
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
The GCC OpenMP runtime (libgomp
) should be a banned library for GCCcore
(only)
#4535
Comments
So, I guess it should be banned from |
This is really only an issue when considering Clang, as Clang is interoperable with |
Shouldn't this affect all LLVM-based compilers then? See this example (note that my toolchain is built without EB here): $ cat hello-world.c
#include <stdio.h>
#include <omp.h>
void hello_world()
{
#pragma omp critical
printf( "Hello World from thread %d\n", omp_get_thread_num() );
}
int main( void )
{
#pragma omp parallel
hello_world();
}
$ module load Clang
$ clang -fopenmp=libgomp ./hello-world.c
$ ldd ./a.out
linux-vdso.so.1 (0x00007ffd87ddd000)
libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x0000798b0d619000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000798b0d200000)
/lib64/ld-linux-x86-64.so.2 (0x0000798b0d689000)
$ module load oneAPI
Lmod is automatically replacing "LLVM/18.1.2" with "oneAPI/2024.1".
$ icx -fopenmp=libgomp hello-world.c
$ ldd ./a.out
linux-vdso.so.1 (0x00007ffd971d8000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x0000761ae9412000)
libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x0000761ae93c8000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000761ae9000000)
/lib64/ld-linux-x86-64.so.2 (0x0000761ae951a000) In both cases, One interesting thing to note: When trying out Clang 19-trunk on my machine, it properly links against the LLVM |
I suspect you know more about this than me! So what happens if you are just giving The issue I am considering here is specific to |
We can freely choose the library we want to use during the Clang CMake call. By default, the LLVM OpenMP runtime is used. This probably also works for Flang in a similar fashion. https://github.com/llvm/llvm-project/blob/main/clang/CMakeLists.txt#L273
Agreed. We should only allow OpenMP once a toolchain has been selected. Then, we can ensure that everything is linked with the same OpenMP runtime. |
There are different API possibilities for OpenMP and they shouldn't be mixed. For
GCCcore
level, we shouldn't allow the OpenMP runtime to be linked as we create the possibility for strange behaviour if used as a dependency for an application that uses another runtime.The text was updated successfully, but these errors were encountered: