<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class="">Hi everyone! </div>
<div class=""><br class="">
</div>
<div class="">I am trying to build clang trunk with OpenMP CUDA device support and run into the following error. I am observing the same error in the released version of Clang 7. </div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><b class="">[1/3] Building NVCC intermediate link file libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/omptarget-nvptx_intermediate_link.o</b></div>
<div class=""><b class="">FAILED: </b>cd /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx && /usr/local/cuda-9.0/bin/nvcc -gencode arch=compute_70,code=sm_70 -m64 -ccbin /usr/bin/cc -dlink /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_cancel.cu.o
 /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_critical.cu.o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_data_sharing.cu.o
 /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_libcall.cu.o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_loop.cu.o
 /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_omptarget-nvptx.cu.o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_parallel.cu.o
 /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_reduction.cu.o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_sync.cu.o
 /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_task.cu.o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/src/./omptarget-nvptx_generated_omp_data.cu.o
 -o /home/wuqiongs/eco_llvm/build-openmp/libomptarget/deviceRTLs/nvptx/CMakeFiles/omptarget-nvptx.dir/./omptarget-nvptx_intermediate_link.o</div>
<div class=""><b class="">/usr/local/cuda-9.0/bin/crt/link.stub:16:26: fatal error: host_defines.h: No such file or directory</b></div>
<div class="">compilation terminated.</div>
</div>
<div class=""><br class="">
</div>
<div class="">It seems that the linking failed due to an issue with the “host_defines.h” header. My CUDA library contains two headers with this name. </div>
<div class=""><br class="">
</div>
<div class="">
<div class="">/usr/local/cuda-9.0/include/host_defines.h</div>
<div class="">/usr/local/cuda-9.0/include/crt/host_defines.h</div>
</div>
<div class=""><br class="">
</div>
<div class="">and the top one includes the bottom one in it (in fact that is the only thing the top one has). </div>
<div class=""><br class="">
</div>
<div class="">Also, my CMakeCache.txt contains the following:</div>
<div class="">
<div class="">./CMakeCache.txt:200:CUDA_TOOLKIT_INCLUDE:PATH=/usr/local/cuda-9.0/include</div>
<div class="">./CMakeCache.txt:203:CUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-9.0</div>
<div class="">./CMakeCache.txt:206:CUDA_TOOLKIT_TARGET_DIR:PATH=/usr/local/cuda-9.0</div>
</div>
<div class=""><br class="">
</div>
<div class="">, which look like the correct CUDA library directories. </div>
<div class=""><br class="">
</div>
<div class="">May I get some suggestions from the community on how to proceed? </div>
<div class=""><br class="">
</div>
<div class="">Thanks for your help! </div>
<br class="">
<div class="">
<div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
Sincerely,</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
Qiongsi</div>
<div style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<br class="">
</div>
<br class="Apple-interchange-newline">
</div>
<br class="Apple-interchange-newline">
</div>
<br class="">
</body>
</html>