问题描述
我试图构建Magma,我遇到的问题,我确信我没有遇到使用早期版本的CUDA。 (我现在使用6.5)。发生什么是makefile生成以下命令:
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. (I'm using 6.5 now). What happens is that the makefile generates the following command:
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显示-fPIC只能与-Xcompiler一起使用,因为它不是nvcc选项。但是你可以看到我在我的nvcc命令中有-Xcompiler。
Googling shows that -fPIC should be used only with -Xcompiler because it's not an nvcc option. But as you can see I do have -Xcompiler in my nvcc command.
我尝试将-fPIC放在-Xcompiler后面,如下所示:
I tried putting -fPIC behind -Xcompiler like this:
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'
在下一个非nvcc选项失败,即使它在-Xcompiler后面。这是什么工作的:
It fails on the next non-nvcc option, even though it is behind -Xcompiler. 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
我在其中复制了-Xcompiler switch。
有人知道这是否是预期的行为?我找不到任何参考文献或文档,我很确定它没有使用像以前的CUDA版本那样工作。
Where I have duplicated -Xcompiler switch.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. Could it be a bug?
推荐答案
根据,你必须用逗号分隔不同的-Xcompiler子选项,为每个选项使用一个单独的-Xcompile,就像你在上一次尝试。看起来这是想要的。
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 -Xcompile, like you did in your last try. It looks like this is intended.
这篇关于NVCC,与-Xcompiler的奇怪交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!