XapaJIaMnu
XapaJIaMnu

Reputation: 1502

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. (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 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.

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'

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

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?

Upvotes: 1

Views: 11754

Answers (1)

Vincent
Vincent

Reputation: 646

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. It looks like this is intended.

Upvotes: 8

Related Questions