<div dir="ltr">I'm assuming you are following guide at <a href="https://llvm.org/docs/CompileCudaWithLLVM.html#compiling-cuda-code">https://llvm.org/docs/CompileCudaWithLLVM.html#compiling-cuda-code</a><div><br></div><div>Have you tried -L and -l flags?</div><div><br></div><div>Kevin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 2, 2017 at 2:23 PM, Xipeng Shen via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_3280272557772410889divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p><span>Hi,</span></p>
<p><span><br>
</span></p>
<p><span>I have trouble compiling CUDA code with Clang. The following is a command I tried:</span></p>
<p><span><br>
</span></p>
<p><span>> clang++ <a href="http://axpy.cu" target="_blank">axpy.cu</a> -o axpy --cuda-gpu-arch=sm_35 --cuda-path=/usr/local/cuda</span><br>
</p>
<p><span><br>
</span></p>
<p><span>The error message is </span></p>
<p><span><br>
</span></p>
<p><span><span>error: unable to create target: 'No available targets are compatible with this triple.'</span><br>
</span></p>
<p><span><span><br>
</span></span></p>
<p>The info of the LLVM I'm using is as follows:</p>
<p></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">> lang++ --version</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">clang version 6.0.0 (<a href="http://llvm.org/git/clang.git" target="_blank">http://llvm.org/git/clang.git</a> 16a0981eccf1bfcc9ba928747aa825<wbr>e8948791cd) (<a href="http://llvm.org/git/llvm.git" target="_blank">http://llvm.org/git/llvm.git</a> 052dd78cb30f77a05dc8bb06b85140<wbr>2c4b6c6587)</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">Target: x86_64-unknown-linux-gnu</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">Thread model: posix</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures">InstalledDir: /home/xshen5/llvm/bin</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255);min-height:13px">
<span style="font-variant-ligatures:no-common-ligatures"></span><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><span class="m_3280272557772410889Apple-converted-space"> 
</span>Registered Targets:</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><span class="m_3280272557772410889Apple-converted-space">   
</span>x86<span class="m_3280272557772410889Apple-converted-space">    </span>- 32-bit X86: Pentium-Pro and above</span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0);background-color:rgb(255,255,255)">
<span style="font-variant-ligatures:no-common-ligatures"><span class="m_3280272557772410889Apple-converted-space">   
</span>x86-64 - 64-bit X86: EM64T and AMD64</span></p>
<br>
<p></p>
<p>Any help I could get? Thanks!</p>
<p><br>
</p>
<p>-Xin</p>
</div>
</div>

<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>