简体   繁体   English

NVCC,与-Xcompiler的奇怪交互

[英]NVCC, strange interaction with -Xcompiler

I'm trying to build Magma and I'm running into problems which I'm pretty sure I didn't run into when using earlier versions of CUDA. 我正在尝试构建Magma,但遇到了一些问题,我敢肯定我在使用较早版本的CUDA时没有遇到过这些问题。 (I'm using 6.5 now). (我现在使用的是6.5)。 What happens is that the makefile generates the following command: 发生的情况是makefile生成以下命令:

nvcc -fPIC -O3 -DADD_ -Xcompiler -fno-strict-aliasing  -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -I/opt/cuda/include -I../include -I../control -I../sparse-iter/include -c zgemv_conjv.cu -o zgemv_conjv.o
nvcc fatal   : Unknown option 'fPIC'

Googling shows that -fPIC should be used only with -Xcompiler because it's not an nvcc option. Google搜索显示-fPIC只能与-Xcompiler一起使用,因为它不是nvcc选项。 But as you can see I do have -Xcompiler in my nvcc command. 但是如您所见,我的nvcc命令中确实有-Xcompiler。

I tried putting -fPIC behind -Xcompiler like this: 我尝试将-fPIC放在-Xcompiler之后,如下所示:

nvcc -O3 -DADD_ -Xcompiler -fPIC -fno-strict-aliasing  -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -I/opt/cuda/include -I../include -I../control -I../sparse-iter/include -c zgemv_conjv.cu -o zgemv_conjv.o
nvcc fatal   : Unknown option 'fno-strict-aliasing'

It fails on the next non-nvcc option, even though it is behind -Xcompiler. 即使在-Xcompiler后面,它在下一个非nvcc选项上也会失败。 What works is this: 这是可行的:

nvcc -O3 -DADD_ -Xcompiler -fno-strict-aliasing -Xcompiler -fPIC -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_35,code=compute_35 -I/opt/cuda/include -I../include -I../control -I../sparse-iter/include -c zgemv_conjv.cu -o zgemv_conjv.o

Where I have duplicated -Xcompiler switch. 我在其中复制了-Xcompiler开关。 Does anyone know if this is the intended behaviour? 有人知道这是否是预期的行为吗? I couldn't find any reference or documentaion regarding it, and I'm pretty sure it didn't use to work like that in previous versions of CUDA. 我找不到关于它的任何参考或文档,而且我很确定它在以前的CUDA版本中没有像以前那样工作。 Could it be a bug? 可能是错误吗?

According to this , you have to separate your different -Xcompiler sub-options with a comma or you have to use for each option a separate -Xcompiler , like you did in your last try. 根据这个 ,你要分开你的不同-Xcompiler用逗号分隔的子选项,或者你必须使用每个选项单独-Xcompiler ,就像你在你的最后一次尝试做。 It looks like this is intended. 看来这是预期的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM