指定编译器NVCC用于编译主机代码 [英] Specify compiler NVCC uses to compile host-code

查看:199
本文介绍了指定编译器NVCC用于编译主机代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行nvcc时,它总是使用Visual C ++编译器( cl.exe )。我如何使用GCC编译器?

When running nvcc, it always uses the Visual C++ compiler (cl.exe). How can I make it use the GCC compiler?

CC 环境变量设置为 gcc 没有修复它。

Setting the CC environment-variable to gcc didn't fix it. I also couldn't find any option for this in the executeables help-output.

推荐答案

在Windows上,NVCC只支持Visual C ++编译器(cl.exe)用于主机编译。

On Windows, NVCC only supports the Visual C++ compiler (cl.exe) for host compilation.

您可以使用GCC编译.cpp(非CUDA)代码,并将对象与由nvcc生成的对象链接。

You can of course compile .cpp (non-CUDA) code using GCC and link the objects with objects generated by nvcc.

这篇关于指定编译器NVCC用于编译主机代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆