Pregunta

I'm trying to compile CUDA code using nvcc on Ubuntu. However, when I do, I get this output:

> make
/usr/local/cuda/bin/nvcc -m64 --ptxas-options="-v" -gencode arch=compute_11,code=sm_11 -gencode arch=compute_13,code=sm_13 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -o main main.cu
gcc: No such file or directory
make: *** [main] Error 1

Even when I'm trying to compile a file with only a main function in it, it still doesn't work:

> /usr/local/cuda/bin/nvcc main.cu 
gcc: No such file or directory

nvcc seems to respond to --version, so it's definitely there. I'm not sure why it's invoking gcc though.

¿Fue útil?

Solución

nvcc is not a compiler in itself. It's a "compiler driver", orchestrating the entire process of compiling device code, host code and linking it together. On Linux, it uses gcc for compiling the host code.

To install gcc on Ubuntu:

$ sudo apt-get --yes install build-essential

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top