I’m trying to compile a simple HelloCuda from command line, cause am not willing to install the 4 GB MS VS … though i have the microsoft cl.exe compiler.
Documentation really doesn’t help much, just relying on VS for windows !!
I need someone to give me an exact syntax for compiling and linking 3 files A.cu B.cu and C.cu from the command line.
currently using win7 64 bit … but 32 bit would do … just need the exact line that actually works.
Thats really serious cause am doing my thesis using CUDA and i cant get the simplest thing to compile
If you ever do install VS, then you can go to Visual Studio>Project>Properties>CUDA Build Rule (or whatever it’s called in your setup) and then look at the “Command Line” value.
That should provide you a rather robust starting point for command line compilation of your project outside of VS.
You can probably significantly trim down what VS emits. Looking at the output of “[font=“Courier New”]nvcc --help[/font]” is also helpful in understanding what’s happening.
Too much errors when i tried that, I only want to know the command line for linking, maybe if the CMake works for you … could you generate a MSYS make file and post it here
Maybe I’ll do that next time I’m sitting at a windows machine (could be a few days).
But if all you really want to know is how to link object files into an exe on the command line in windows, there are probably better sources of information online than the CUDA forums. There is nothing CUDA specific about that operation.
nvcc -c file.cu -o file.obj
(possibly with all the other paths discussed previously) produces a standard object file that can be linked by a standard linker with along with all the other obj files. I’ve never done this by hand on windows so I cannot help further than my suggestion to use cmake, which is what I always use for projects larger than one file.
If it is just one .cu file, all you need is “nvcc -o test.exe test.cu” run in the visual studio command prompt. If that works for you, you could always add the --dryrun option to nvcc and see how it is linking the resulting object files.