Skip to content
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

Building Clang with gcccuda requires elfutils #13006

Closed
nordmoen opened this issue Jun 1, 2021 · 3 comments · Fixed by #13008 or #13015
Closed

Building Clang with gcccuda requires elfutils #13006

nordmoen opened this issue Jun 1, 2021 · 3 comments · Fixed by #13008 or #13015
Milestone

Comments

@nordmoen
Copy link
Contributor

nordmoen commented Jun 1, 2021

When building Clang/11.0.1-gcccuda-2020b on our cluster it was never able to properly offload to our Nvidia GPUs, however, the compiler never failed to compile and OpenMP still worked, it was just not able to detect any GPUs on the system. After a bit of digging I found the following in the build log of Clang:

-- LIBOMPTARGET: Building offloading runtime library libomptarget.                        
-- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not found in the system. 
-- LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found.        
-- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not found in the system.   
-- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not found in the system. 
-- LIBOMPTARGET: Not building nec-aurora plugin: libveo or libveosinfo not found.         
-- LIBOMPTARGET: Not building x86_64 offloading plugin: libelf dependency not found.      
-- LIBOMPTARGET: Building CUDA offloading device RTL.                                     

Which shows that it is build some part of the offloading support, but since -- LIBOMPTARGET: Not building CUDA offloading plugin: libelf dependency not found. I guess it was never able to properly generate the offload code.

Adding elfutils/0.183 to the build dependencies of Clang solved the problem and a very simple offloading program, that did not work before adding elfutils, was able to detect and offload to the Nvidia GPU.

@akesandgren
Copy link
Contributor

elfutils likely need to be a run time dependency but you should properly check if it is only used during building of clang first.

@nordmoen
Copy link
Contributor Author

nordmoen commented Jun 2, 2021

It worked on our cluster by just adding it as a build dependency.

@boegel
Copy link
Member

boegel commented Jun 3, 2021

I've re-opened this since #13015 should get merged too before closing this...

@boegel boegel closed this as completed Jun 3, 2021
@boegel boegel reopened this Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment