<div dir="ltr"><div></div><div></div><div>Based on the CMake output, LLVM was found on the machine so LLVM_DIR is set.</div><div>However, clang was not found so CLANG_TOOL is NOT-FOUND<br></div><div><br></div><div>if (LLVM_DIR)</div>  # Builds that use pre-installed LLVM have LLVM_DIR set.<br>  find_program(CLANG_TOOL clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)<br>  find_program(LINK_TOOL llvm-link PATHS ${LLVM_TOOLS_BINARY_DIR}<br>    NO_DEFAULT_PATH)<br>  find_program(OPT_TOOL opt PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH)<br><div>  libomptarget_say("Building AMDGCN device RTL. Using clang: ${CLANG_TOOL}")</div><div><br></div><div>Use ENABLE_RUNTIMES does workaround this issue as this part is bypassed.<br></div><div><br></div><div>@Jon please take care of the case when any of the find_program fails.</div><div><br></div><div>Second issue is libelf. I had this issue in the past when libelf is spack installed.<br></div><div> libomptarget CMake found libelf library files but didn't check the header files.</div><div>This caused all the complaints about <libelf/libelf.h> not found.</div><div>The workaround in my case is apt instal libelf-dev.<br></div><div><br></div><div>I think the libelf search needs to be more robust in libomptarget.<br></div><div><br></div><div>Best,<br></div><div>Ye<br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">===================<br>
Ye Luo, Ph.D.<br>Computational Science Division & Leadership Computing Facility<br>
Argonne National Laboratory</div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 19, 2021 at 8:19 PM Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com">itaru.kitayama@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi all,<br>
As the files are too large for the list; I've uploaded them to:<br>
<br>
<a href="https://github.com/spack/spack/issues/23654" rel="noreferrer" target="_blank">https://github.com/spack/spack/issues/23654</a><br>
<br>
On Thu, May 20, 2021 at 10:14 AM Itaru Kitayama<br>
<<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>> wrote:<br>
><br>
> Hi Ye,<br>
> <a href="https://github.com/ikitayama/spack" rel="noreferrer" target="_blank">https://github.com/ikitayama/spack</a> for-ye , as I need to set<br>
> ENABLE_RUNTIMES explicitly.<br>
><br>
> $ spack install llvm@main+omp_debug+cuda cuda_arch=80<br>
><br>
> On Thu, May 20, 2021 at 6:53 AM Ye Luo <<a href="mailto:xw111luoye@gmail.com" target="_blank">xw111luoye@gmail.com</a>> wrote:<br>
> ><br>
> > -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp"<br>
> > I think this is what Jon refers to.<br>
> ><br>
> > If you have issues building llvm@main in spack. Please provide your spack command and attach the following files<br>
> > spack-build-01-cmake-out.txt<br>
> > spack-build-02-build-out.txt<br>
> > from your spack-stage llvm build folder.<br>
> > Best,<br>
> > Ye<br>
> > ===================<br>
> > Ye Luo, Ph.D.<br>
> > Computational Science Division & Leadership Computing Facility<br>
> > Argonne National Laboratory<br>
> ><br>
> ><br>
> > On Wed, May 19, 2021 at 4:34 PM Itaru Kitayama <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>> wrote:<br>
> >><br>
> >> Jon, Ye,<br>
> >> Is this<br>
> >><br>
> >> -DLLVM_ENABLE_PROJECTS="clang" -DLLVM_ENABLE_RUNTIMES="openmp"<br>
> >><br>
> >> correct? I used, and Spack as well, combined them (clang and openmp<br>
> >> projects) together indeed in ENABLE_PROJECTS.<br>
> >> On Thu, May 20, 2021 at 5:18 AM Ye Luo via Openmp-dev<br>
> >> <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> wrote:<br>
> >> ><br>
> >> > spack install llvm@main does work on my workstation with ubuntu 20.04. rocm is installed and amd pieces for OpenMP offload are rebuilt properly. I have limited ideas about the experience on other OSes.<br>
> >> ><br>
> >> > yeluo@epyc-server:~/opt/llvm-clang/llvm-project$ ls /home/packages/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.2.0/llvm-main-6n25gihrin6rc727fbothf44yq6zbp5a/lib/libomp<br>
> >> > libomp.so                      libomptarget-amdgcn-gfx803.bc  <a href="http://libomptarget.rtl.cuda.so" rel="noreferrer" target="_blank">libomptarget.rtl.cuda.so</a><br>
> >> > libomptarget-amdgcn-gfx700.bc  libomptarget-amdgcn-gfx900.bc  <a href="http://libomptarget.rtl.x86_64.so" rel="noreferrer" target="_blank">libomptarget.rtl.x86_64.so</a><br>
> >> > libomptarget-amdgcn-gfx701.bc  libomptarget-amdgcn-gfx906.bc  libomptarget.so<br>
> >> > libomptarget-amdgcn-gfx801.bc  <a href="http://libomptarget.rtl.amdgpu.so" rel="noreferrer" target="_blank">libomptarget.rtl.amdgpu.so</a><br>
> >> ><br>
> >> > yeluo@epyc-server:~/opt/llvm-clang/llvm-project$ which clang-tidy<br>
> >> > /home/packages/spack/opt/spack/linux-ubuntu20.04-zen2/gcc-10.2.0/llvm-main-6n25gihrin6rc727fbothf44yq6zbp5a/bin/clang-tidy<br>
> >> ><br>
> >> > spack uses ENABLE_PROJECTS and doesn't use ENABLE_RUNTIMES right now.<br>
> >> > So the output from building clang-tools-extra and openmp can be blended.<br>
> >> ><br>
> >> > Best,<br>
> >> > Ye<br>
> >> > ===================<br>
> >> > Ye Luo, Ph.D.<br>
> >> > Computational Science Division & Leadership Computing Facility<br>
> >> > Argonne National Laboratory<br>
> >> ><br>
> >> ><br>
> >> > On Wed, May 19, 2021 at 2:22 PM Jon Chesterfield via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> wrote:<br>
> >> >>><br>
> >> >>> Date: Wed, 19 May 2021 15:09:18 +0900<br>
> >> >>> From: Itaru Kitayama via Openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>><br>
> >> >>> To: openmp-dev <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>><br>
> >> >>> Subject: [Openmp-dev] AMDGPU and clang-tools-extra<br>
> >> >>> Message-ID:<br>
> >> >>>         <CANW9uysd4uCQ7j3Jr1qmn2=RPo5a5OGU9e8-vPuuGv=<a href="mailto:P0nAXDQ@mail.gmail.com" target="_blank">P0nAXDQ@mail.gmail.com</a>><br>
> >> >>> Content-Type: text/plain; charset="UTF-8"<br>
> >> >>><br>
> >> >>> I am trying to build llvm on main branch with Spack with help from Tom, however<br>
> >> >>> the AMDGPU code does not seem to work well with clang-tools-extra<br>
> >> >>> project, which<br>
> >> >>> is added together with the clang project when a Spack build initiated.<br>
> >> >>> Has anyone<br>
> >> >>> observed an issue with AMDGPU code with tools in upstream?<br>
> >> >><br>
> >> >><br>
> >> >> None reported. I don't build clang-tools-extra, seems totally independent.<br>
> >> >><br>
> >> >> Are you building openmp with ENABLE_PROJECTS and a clang that can't build amdgpu code, instead of ENABLE_RUNTIMES? If so, use ENABLE_RUNTIMES, a working clang, or disable the amdgpu library.<br>
> >> >><br>
> >> >> Otherwise, please expand on 'does not seem to work well'.<br>
> >> >><br>
> >> >> Jon<br>
> >> >> _______________________________________________<br>
> >> >> Openmp-dev mailing list<br>
> >> >> <a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
> >> >> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
> >> ><br>
> >> > _______________________________________________<br>
> >> > Openmp-dev mailing list<br>
> >> > <a href="mailto:Openmp-dev@lists.llvm.org" target="_blank">Openmp-dev@lists.llvm.org</a><br>
> >> > <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/openmp-dev</a><br>
</blockquote></div>