从命令提示符编译 CUDA 时出错 [英] Error compiling CUDA from Command Prompt

查看:20
本文介绍了从命令提示符编译 CUDA 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过命令提示符在 Windows 7 上编译一个 cuda 测试程序,我是这个命令:

I'm trying to compile a cuda test program on Windows 7 via Command Prompt, I'm this command:

nvcc test.cu

但我得到的只是这个错误:

But all I get is this error:

nvcc fatal : Cannot find compiler 'cl.exe' in PATH

什么可能导致这个错误?

What may be causing this error?

推荐答案

您需要将包含cl.exe"文件的文件夹添加到您的路径环境变量中.例如:

You will need to add the folder containing the "cl.exe" file to your path environment variable. For example:

C:Program FilesMicrosoft Visual Studio 10.0VCin

编辑:好的,进入我的电脑 -> 属性 -> 高级系统设置 -> 环境变量.在这里在列表中查找PATH",然后添加上面的路径(或任何 cl.exe 的位置).

Edit: Ok, go to My Computer -> Properties -> Advanced System Settings -> Environment Variables. Here look for "PATH" in the list, and add the path above (or whatever is the location of your cl.exe).

这篇关于从命令提示符编译 CUDA 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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