Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile CUDA without Visual Studio - "Cannot find compiler cl.exe in path"

I've just begun a small project in CUDA.

I need to know the following: Is it possible to compile CUDA code without using/buying Microsoft Visual Studio? Using Nvcc.exe I get the error "Cannot find compiler cl.exe in path".

I've tried to install a CUDA plugin for NetBeans, but it doesn't work. (with current version of NetBeans)

Platform: Windows 7

Thanks in advance.

like image 606
Panos Kal. Avatar asked Jan 24 '12 11:01

Panos Kal.


2 Answers

Use windows subsystem for linux and install ubuntu and nvcc along with gcc and g++ using the ubuntu terminal in windows (gui does not works for linux subsystem for windows). Then configure .bashrc using bash and vim/nano with a 'cd' command to your desired location as it is done in usual linux terminal (makes it easy as bash opens in system32 folder everytime). And then you can compile .cu files using nvcc over bash. As nvcc supports gcc and g++ under linux so it solves the problem. No need to sacrifice peace for switching over to linux or dealing with crappy visual studio. It worked for me.

enter image description here

like image 81
Rahul Gogoi Avatar answered Sep 28 '22 19:09

Rahul Gogoi


Update

As noted in the comments, versions of the SDK after Windows 7's do not include the build tools. If you want to use Microsoft's most recent tools you have to install Visual Studio. Once installed, you can use the tools from the command-line.

At the moment the free versions are the "Community" versions, e.g. Microsoft Visual Studio Community 2015.

You can continue to develop apps for Windows 7 and earlier (and they will run on later versions of Windows) using the old SDK tools as I described before:

Original Answer

If you desperately want to avoid Visual Studio, download and install the Windows SDK. This contains (more or less) the same build tools as Visual Studio.

Then run the Windows SDK Command Prompt (which you'll find on the start menu under Microsoft Windows SDK) to set the path to point to the tools, and you are set.

Or just use Visual C++ Express.

like image 27
arx Avatar answered Sep 28 '22 20:09

arx