I've got a problem. I need to compile C code for linux, but I am using a windows IDE that I'd really want to use. Therefore I need an commandline compiler executable like gcc that is capable of compiling C code. Furthermore I also need to be able to compile CUDA C code into a linux program. Therefore my question:

Is it possible to compile CUDA C code into a Linux program on a Windows machine?

If it is possible, could someone give a full description to set up the compiler?

What is preventing you from compiling on a Linux machine? Typically cross-compiling requires going rather far out of your way to accomplish something done much more easily by simply compiling on the intended platform.
–
patrickvacekFeb 24 '14 at 14:45

2

There is no officially supported method. The only officially supported host code compiler on windows is cl.exe, the compiler that comes with visual studio, and it only targets windows platforms. On linux, the supported host compiler is gnu/gcc/g++, so the first step to trying this would be to get a version of gcc perhaps from cygwin or minGW on a windows machine. But I think you still have a long way to go from that point.
–
Robert CrovellaFeb 24 '14 at 14:48

1

I think the challenge you are looking at here is substantial. For example, I find it difficult to build a binary that will run correctly on a RHEL 5.5 machine from a RHEL 6 machine (linux->linux). The issue I'm worried about is not the compiler, but all the associated libraries. I'm also puzzled at the nature of the linux machine that you cannot use it to compile, but can use it to run codes. You mention that you cannot install nvcc. If nvcc is not installed, it probably means that the cuda tookit is not installed, which means cuda runtime apps will not run on that machine.
–
Robert CrovellaFeb 25 '14 at 0:19

Though I do not like the outcome of this question, I think that at the moment this is the easiest way of making possible what I asked in the question. Thanks for your answer
–
coolcat007Mar 6 '14 at 19:39