<div dir="ltr">Jonas, all,<div><br></div><div>Although Alexey warned me to use the recent Clan 7 or higher I recall, I was building the trunk llvm-project with GCC.</div><div><br></div><div>Can the future update to LLVM/Clang make GCC also usable in terms of building a toolchain which has OpenMP offload</div><div>capabilities?</div><div><br></div><div>Thanks,</div><div>Itaru. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Mar 16, 2019 at 6:57 PM Jonas Hahnfeld <<a href="mailto:hahnjo@hahnjo.de">hahnjo@hahnjo.de</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,<br>
<br>
On 2019-03-16 09:09, Itaru Kitayama via Openmp-dev wrote:<br>
> Doru et al.,<br>
> After checking the CUDA_ROOT environment variable gets set properly, I<br>
> configured the<br>
> Makefile for my application with CMake, however:<br>
> <br>
> -- Could NOT find LIBOMPTARGET_DEP_LIBFFI (missing:<br>
> LIBOMPTARGET_DEP_LIBFFI_LIBRARIES<br>
> LIBOMPTARGET_DEP_LIBFFI_INCLUDE_DIRS)<br>
> CMake Warning (dev) at<br>
> /p/project/cjzam11/kitayama1/projects/llvm-project/openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake:117<br>
> (find_package):<br>
> Policy CMP0074 is not set: find_package uses <PackageName>_ROOT<br>
> variables.<br>
> Run "cmake --help-policy CMP0074" for policy details. Use the<br>
> cmake_policy<br>
> command to set the policy and suppress this warning.<br>
> <br>
> Environment variable CUDA_ROOT is set to:<br>
> <br>
> /usr/local/software/jureca/Stages/2018b/software/CUDA/9.2.88<br>
> <br>
> For compatibility, CMake is ignoring the variable.<br>
> Call Stack (most recent call first):<br>
> <br>
> /p/project/cjzam11/kitayama1/projects/llvm-project/openmp/libomptarget/CMakeLists.txt:30<br>
> (include)<br>
> This warning is for project developers. Use -Wno-dev to suppress it.<br>
> <br>
> -- LIBOMPTARGET: Building offloading runtime library libomptarget.<br>
> -- LIBOMPTARGET: Not building aarch64 offloading plugin: machine not<br>
> found in the system.<br>
> -- LIBOMPTARGET: Building CUDA offloading plugin.<br>
> -- LIBOMPTARGET: Not building PPC64 offloading plugin: machine not<br>
> found in the system.<br>
> -- LIBOMPTARGET: Not building PPC64le offloading plugin: machine not<br>
> found in the system.<br>
> -- LIBOMPTARGET: Not building x86_64 offloading plugin: libffi<br>
> dependency not found.<br>
> -- LIBOMPTARGET: Building CUDA offloading device RTL.<br>
<br>
This looks good so far: You'll get the CUDA offloading plugin and the <br>
pure CUDA device RTL.<br>
(libffi is needed for host-offloading which you don't need for Nvidia <br>
GPUs...)<br>
<br>
> CMake Error at<br>
> /p/project/cjzam11/kitayama1/projects/llvm-project/openmp/libomptarget/cmake/Modules/LibomptargetUtils.cmake:26<br>
> (message):<br>
> LIBOMPTARGET: Cannot build CUDA LLVM bitcode offloading device RTL!<br>
> Call Stack (most recent call first):<br>
> <br>
> /p/project/cjzam11/kitayama1/projects/llvm-project/openmp/libomptarget/deviceRTLs/nvptx/CMakeLists.txt:115<br>
> (libomptarget_error_say)<br>
<br>
This is the code path when you manually specify <br>
LIBOMPTARGET_NVPTX_ENABLE_BCLIB, but have no capable compiler. This <br>
needs a (more or less) recent Clang compiler, what's your <br>
CMAKE_CXX_COMPILER?<br>
<br>
Regarding the earlier errors about manually specified variables: Yes, <br>
the warning about LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES could be <br>
related to CMake not finding CUDA, but the one about <br>
CLANG_OPENMP_NVPTX_DEFAULT_ARCH is not: Clang does not have a build-time <br>
dependency to CUDA and this variable is used unconditionally. Are you <br>
sure your set -DLLVM_ENABLE_PROJECTS=clang;openmp without typos in the <br>
initial cmake invocation? (you don't need llvm because that's the root <br>
project that you're pointing CMake to)<br>
<br>
Cheers,<br>
Jonas<br>
<br>
> I'm at today's HEAD of Trunk of llvm-project.<br>
> <br>
> On Sat, Mar 16, 2019 at 6:27 AM Gheorghe-Teod Bercea<br>
> <<a href="mailto:Gheorghe-Teod.Bercea@ibm.com" target="_blank">Gheorghe-Teod.Bercea@ibm.com</a>> wrote:<br>
> <br>
>> This typically happens when cmake cannot find the CUDA installation.<br>
>> <br>
>> Thanks,<br>
>> <br>
>> --Doru<br>
>> <br>
>> From: Itaru Kitayama via Openmp-dev<br>
>> <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>><br>
>> To: Lukas Sommer <<a href="mailto:sommer@esa.tu-darmstadt.de" target="_blank">sommer@esa.tu-darmstadt.de</a>><br>
>> Cc: <a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a><br>
>> Date: 03/15/2019 04:50 PM<br>
>> Subject: Re: [Openmp-dev] OpenMP offloading to the sm_35<br>
>> device from x86 compute nodes<br>
>> Sent by: "Openmp-dev" <<a href="mailto:openmp-dev-bounces@lists.llvm.org" target="_blank">openmp-dev-bounces@lists.llvm.org</a>><br>
>> <br>
>> -------------------------<br>
>> <br>
>> At the HEAD of Trunk of llvm-project, CMake seems to disregards<br>
>> these variables:<br>
>> [...]<br>
>> CMake Warning:<br>
>> Manually-specified variables were not used by the project:<br>
>> <br>
>> CLANG_OPENMP_NVPTX_DEFAULT_ARCH<br>
>> LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES<br>
>> <br>
>> Have you had a chance to build the latest one?<br>
>> <br>
>> On Fri, Mar 15, 2019 at 6:28 PM Lukas Sommer via Openmp-dev<br>
>> <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> wrote:<br>
>> Hi,<br>
>> <br>
>> I've been building the offloading toolchain for Nvidia GPUs on<br>
>> x86-systems before and found Jonas Hahnfeld's blog-post extremely<br>
>> useful to setup the compiler:<br>
>> <br>
>> <br>
> <a href="https://www.hahnjo.de/blog/2018/10/08/clang-7.0-openmp-offloading-nvidia.html" rel="noreferrer" target="_blank">https://www.hahnjo.de/blog/2018/10/08/clang-7.0-openmp-offloading-nvidia.html</a><br>
>> [1]<br>
>> <br>
>> Best regards,<br>
>> <br>
>> Lukas Sommer<br>
>> <br>
>> On 3/15/19 10:23 AM, Alexey Bataev via Openmp-dev wrote:<br>
>> I'm not sure about it, there are some others who can help with this.<br>
>> <br>
>> Best regards,<br>
>> Alexey Bataev<br>
>> <br>
>> 15 марта 2019 г., в 5:08, Itaru Kitayama<br>
>> <<a href="mailto:itaru.kitayama@gmail.com" target="_blank">itaru.kitayama@gmail.com</a>> написал(а):<br>
>> <br>
>> Thanks. Does setting<br>
>> <br>
>> LLVM_ENABLE_PROJECTS:STRING=clang;openmp;llvm<br>
>> <br>
>> enough to create the corresponding .bc lib?<br>
>> <br>
>> On Fri, Mar 15, 2019 at 6:01 PM Alexey Bataev <<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>><br>
>> wrote:<br>
>> Yes, it should support it.<br>
>> <br>
>> Best regards,<br>
>> Alexey Bataev<br>
>> <br>
>>> 15 марта 2019 г., в 4:55, Itaru Kitayama via Openmp-dev<br>
>> <<a href="mailto:openmp-dev@lists.llvm.org" target="_blank">openmp-dev@lists.llvm.org</a>> написал(а):<br>
>>> <br>
>>> Hi,<br>
>>> I'm wondering if LLVM/Clang supports OpenMP offloading to NVIDA<br>
>>> targets from x86 nodes.<br>
>>> <br>
>>> Thanks,<br>
>>> Itaru.<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> [2]<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> [2]<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>
>> [2]_______________________________________________<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> [2]<br>
> <br>
> <br>
> Links:<br>
> ------<br>
> [1]<br>
> <a href="https://www.hahnjo.de/blog/2018/10/08/clang-7.0-openmp-offloading-nvidia.html" rel="noreferrer" target="_blank">https://www.hahnjo.de/blog/2018/10/08/clang-7.0-openmp-offloading-nvidia.html</a><br>
> [2] <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>
> 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>