<div dir="ltr"><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,</div><div><br></div><div>I'm trying to use openmp offloading to gpu, and I'm getting linking errors during compilation:</div><div><br></div><div>[  7%] Linking CXX executable MPI_PMRF<br>/usr/bin/ld: CMakeFiles/MPI_PMRF.dir-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.device_images[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x10): undefined reference to `.omp_offloading.entries_begin'<br>/usr/bin/ld: CMakeFiles/MPI_PMRF.dir-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.device_images[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x18): undefined reference to `.omp_offloading.entries_end'<br>/usr/bin/ld: CMakeFiles/MPI_PMRF.dir/-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.descriptor[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x10): undefined reference to `.omp_offloading.entries_begin'<br>/usr/bin/ld: CMakeFiles/MPI_PMRF.dir/-------/cfuncs-pmrf.c.o:(.rodata..omp_offloading.descriptor[.omp_offloading.descriptor_reg.nvptx64-nvidia-cuda]+0x18): undefined reference to `.omp_offloading.entries_end'<br>/usr/bin/ld: link errors found, deleting executable `MPI_PMRF'<br>clang-9: error: linker command failed with exit code 1 (use -v to see invocation)<br>CMakeFiles/MPI_PMRF.dir/build.make:265: recipe for target 'MPI_PMRF' failed<br>make[2]: *** [MPI_PMRF] Error 1<br>CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/MPI_PMRF.dir/all' failed<br>make[1]: *** [CMakeFiles/MPI_PMRF.dir/all] Error 2<br>Makefile:83: recipe for target 'all' failed<br>make: *** [all] Error 2<br></div><div><br></div><div>I actually can compile the code just fine without the #pragma omp target.</div><div><br></div><div>Some additional info:</div><div><br></div><div>- I'm compiling the code with <b>-fopenmp -fopenmp-targets=nvptx64-nvidia-cuda</b></div><div><b><br></b></div><div>- <b>clang version 9.0.0</b> (<a href="https://github.com/clang-ykt/clang">https://github.com/clang-ykt/clang</a> e50a43ae7e2fe6e6ff515cedb2a8ae658120e32f) (<a href="https://github.com/clang-ykt/llvm">https://github.com/clang-ykt/llvm</a> 3cd66813b063ab08a389470f1bc53e18fbe595b2)<br></div><div><br></div><div>- <b>cuda info:</b></div><div><br></div><div>+-----------------------------------------------------------------------------+<br>| NVIDIA-SMI 418.67       Driver Version: 418.67       CUDA Version: 10.1     |<br>|-------------------------------+----------------------+----------------------+<br>| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |<br>| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |<br>|===============================+======================+======================|<br>|   0  Tesla V100-SXM2...  On   | 00000000:3E:00.0 Off |                    0 |<br>| N/A   30C    P0    38W / 300W |      0MiB / 16130MiB |      0%      Default |<br>+-------------------------------+----------------------+----------------------+<br></div><div><br></div><div>- Linux kernel: <b>4.4.176-96-default</b></div><div><b><br></b></div><div>Any thoughts?</div><div><br></div><div>Thanks!</div><div>Talita</div><div><br></div></div></div></div></div></div></div></div>