Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to specify option to host compiler using nvcc

📅 2014-Feb-14 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

[caption id="attachment_4250" align="aligncenter" width="640"][Options specified to host compiler in Nsight](http://codeyarns.files.wordpress.com/2014/02/20140214-nvcc-xcompiler.png) -std=c++11 option specified to host compiler in Nsight[/caption]

nvcc is the CUDA compiler driver that is used to compile both .cu and .cpp files. There are many options that be specified to nvcc for device code compilation. To specify options to the host compiler, place them after the option -Xcompiler.

If you are using Nsight, go to Project > Properties > Build > Settings > Tool Settings > NVCC Compiler > Build Stages. Add the compiler options that you want to the Preprocessor options (-Xcompiler) section.

Tried with: Nsight 5.5 and Ubuntu 12.04 LTS