Yuanfeng Peng via llvm-dev
2016-Jul-29 13:27 UTC
[llvm-dev] [GPUCC] link against libdevice
Hi, I was trying to compile scalarProd.cu (from CUDA SDK) with the following command: * clang++ -I../ -I/usr/local/cuda-7.0/samples/common/inc --cuda-gpu-arch=sm_50 scalarProd.cu* but ended up with the following error: *ptxas fatal : Unresolved extern function '__nv_mul24'* Seems to me that libdevice was not automatically linked. I wonder what flags I need to pass to clang to have the code linked against libdevice? Thanks! Yuanfeng Peng -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160729/ffdf3989/attachment.html>
Chandler Carruth via llvm-dev
2016-Aug-01 04:24 UTC
[llvm-dev] [GPUCC] link against libdevice
Directly CC-ing some folks who may be able to help. On Fri, Jul 29, 2016 at 6:27 AM Yuanfeng Peng via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi, > > I was trying to compile scalarProd.cu (from CUDA SDK) with the following > command: > > * clang++ -I../ -I/usr/local/cuda-7.0/samples/common/inc > --cuda-gpu-arch=sm_50 scalarProd.cu* > > but ended up with the following error: > > *ptxas fatal : Unresolved extern function '__nv_mul24'* > > Seems to me that libdevice was not automatically linked. I wonder what > flags I need to pass to clang to have the code linked against libdevice? > > Thanks! > Yuanfeng Peng > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160801/d381706a/attachment.html>
Hi, Yuanfeng. What version of clang are you using? CUDA is only known to work at tip of head, so you must build clang yourself from source. I suspect that's your problem, but if building from source doesn't fix it, please attach the output of compiling with -v. Regards, -Justin On Sun, Jul 31, 2016 at 9:24 PM, Chandler Carruth <chandlerc at google.com> wrote:> Directly CC-ing some folks who may be able to help. > > On Fri, Jul 29, 2016 at 6:27 AM Yuanfeng Peng via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> >> Hi, >> >> I was trying to compile scalarProd.cu (from CUDA SDK) with the following >> command: >> >> clang++ -I../ -I/usr/local/cuda-7.0/samples/common/inc >> --cuda-gpu-arch=sm_50 scalarProd.cu >> >> but ended up with the following error: >> >> ptxas fatal : Unresolved extern function '__nv_mul24' >> >> Seems to me that libdevice was not automatically linked. I wonder what >> flags I need to pass to clang to have the code linked against libdevice? >> >> Thanks! >> Yuanfeng Peng >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev