On 02/06/2011 07:42 PM, Mark Knecht wrote:
On Sun, Feb 6, 2011 at 9:09 AM, Nikos Chantziaras<rea...@arcor.de>  wrote:
On 02/06/2011 12:08 AM, Mark Knecht wrote:

Can someone recommend a good IDE to write C code in?
[...]

I use Qt Creator.  Though it's primarily for C++, I also use it for C. I
recommend it because it's very easy to use.  For version control, it
supports Git, Subversion, Mercurial and Perforce.

If you decide to use it and also make use of its own build system (qmake),
post about it so I can tell you how to configure a project for plain C,
because by default new projects are C++.

I'll take a look at it. Do you recommend the testing 2.0 versions or stable 1.3?

I use 2.1.0_rc1 since it came out.  Turned out to be very stable.


At this time I have no need for GUI development. The app I want to do
right now could run on the command line. However getting started with
something that did support eventually doing a GUI would be nice as
long as it doesn't kill me.

I use it both for GUI as well as for plain C CLI apps.


As for the C vs C++ issue, I only say C because the NVidia nvcc
compiler seems to be primarily a C compiler. It's not until you get to
Appendix D in the programming guide that they even mention C++ in the
context of CUDA.

I started studying CUDA development recently too. While reading the examples that come with the SDK, I found out that they're all C++ though. The reason you can use C is that C is actually valid C++ (most of the time.)


That said, however, my understanding of what nvcc does is that what it
really does breaks apart the *.cu input files into portions that are
sent to the CUDA compiler, and portions that are sent to gcc. I
suspect the gcc/host computing side can be whatever is legal for gcc.
All I need, as best I understand it today, is to call nvcc instead of
gcc.

nvcc compiles into C++. The end result is then compiled with g++ and linked with the CUDA libraries. This is normally done automatically by nvcc, unless you use the --cuda option. For example, to suppress that automation, you can compile a CUDA program with:

  nvcc --cuda myprogram.cu

"myprogram.cu" can be something as simple as:

  int main()
  { return 0; }

This will "compile" the program into "myprogram.cu.cpp". This can then be compiled manually with g++:

  g++ myprogram.cu.cpp -L/opt/cuda/lib64/ -lcudart

It's just that nvcc does that automatically for you.


Reply via email to