Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   IDE recommendations for writing C? (http://www.linux-archive.org/gentoo-user/485569-ide-recommendations-writing-c.html)

Mark Knecht 02-05-2011 11:12 PM

IDE recommendations for writing C?
 
On Sat, Feb 5, 2011 at 2:39 PM, Alex Schuster <wonko@wonkology.org> wrote:
> Mark Knecht writes:
>
>> Can someone recommend a good IDE to write C code in?
>>
>> 1) Something that can display multiple files in a project.
>>
>> 2) Something that have some sort of version control built into it?
>>
>> 3) If possible, I can compile right in the IDE.
>
> Emacs. If you dare to go this way. The learning curve is high, but once
> you know how to use it, you probably will be glad.
> Eclipse is pretty cool, and I've heard good things about Kdevelop.
>
>> I've starting writing something. It's hundreds of lines long in 1 file
>> and I just messed up a brace somewhere which I haven't been able to
>> figure out in vi.
>
> Just use the % key.
>
> * * * *Wonko

I specifically _don't_ want a high learning curve. I want this to
remain fun, if possible.

After an hour and a half of llooking for the problem in vi KDevelop
with it's color editor helped me find the problem in a few minutes.
That's a big help.

I haven't figured out how to tell Kdevelop to use a different compiler
but that's not important right now. I can build in a terminal until I
learn how.

Thanks for the ideas.

I also loaded up codeblocks which I read good things about. CodeLite
is supposed to be good but I couldn't get it unmasked.

Netbeans wanted to install too much Java stuff. Understandable as it's
written in Java but I decided not to look at that one right now.

For now I'm set. Thanks!

Cheers,
Mark

Florian Philipp 02-06-2011 09:57 AM

IDE recommendations for writing C?
 
Am 05.02.2011 23:08, schrieb Mark Knecht:
> Can someone recommend a good IDE to write C code in?
>

Eclipse CDT. It is not as good as Eclipse JDT for Java but it is still
pretty good and gets you started really quick.

> 1) Something that can display multiple files in a project.
>

Multiple tabs and multiple windows. You can also place two tabs next to
each other for comparison by drag-and-drop.

> 2) Something that have some sort of version control built into it?
>

I believe there is something called a "local history" but I don't rely
on it. There are good plugins for SVN (Subclipse, Subversive), Mercurial
and Git (EGit). I've only worked with Subclipse, though.

> 3) If possible, I can compile right in the IDE.
>

It comes with a GUI make file generator. It is not great for
distribution and such alike but it is good enough to compile code while
developing. You can also configure it to use existing make files or do
other things when you press "build" or "run".

> I've starting writing something. It's hundreds of lines long in 1 file
> and I just messed up a brace somewhere which I haven't been able to
> figure out in vi.
>

If the syntax check doesn't help you and the error markers after
executing GCC don't help either, just mark everything and tell Eclipse
to correct the indentation (Ctrl+A Ctrl+I). Usually you can then see
where it messes up.

BTW: If you try it out, please just download it from eclipse.org. Don't
use the version from portage. It is a bit outdated, takes ages to build
and I also had problems with it in the past.

Hope this helps,
Florian Philipp

Vortex 3 02-06-2011 02:29 PM

IDE recommendations for writing C?
 
2011/2/5 Mark Knecht <markknecht@gmail.com>

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



1) Something that can display multiple files in a project.



2) Something that have some sort of version control built into it?



3) If possible, I can compile right in the IDE.



I've starting writing something. It's hundreds of lines long in 1 file

and I just messed up a brace somewhere which I haven't been able to

figure out in vi.



Thanks,

Mark




An option could be the Bluefish editor, if you like it. Take a look here:

http://bluefish.openoffice.nl/index.html

Cheers!

Nikos Chantziaras 02-06-2011 04:09 PM

IDE recommendations for writing C?
 
On 02/06/2011 12:08 AM, Mark Knecht wrote:

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

1) Something that can display multiple files in a project.

2) Something that have some sort of version control built into it?

3) If possible, I can compile right in the IDE.

I've starting writing something. It's hundreds of lines long in 1 file
and I just messed up a brace somewhere which I haven't been able to
figure out in vi.


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++.

Grant Edwards 02-06-2011 04:17 PM

IDE recommendations for writing C?
 
On 2011-02-06, Mark Knecht <markknecht@gmail.com> wrote:
> On Sat, Feb 5, 2011 at 2:39 PM, Alex Schuster <wonko@wonkology.org> wrote:
>> Mark Knecht writes:
>>
>>> Can someone recommend a good IDE to write C code in?
>>>
>>> 1) Something that can display multiple files in a project.
>>>
>>> 2) Something that have some sort of version control built into it?
>>>
>>> 3) If possible, I can compile right in the IDE.
>>
>> Emacs. If you dare to go this way. The learning curve is high, but
>> once you know how to use it, you probably will be glad. Eclipse is
>> pretty cool, and I've heard good things about Kdevelop.
>>
>>> I've starting writing something. It's hundreds of lines long in 1
>>> file and I just messed up a brace somewhere which I haven't been able
>>> to figure out in vi.
>>
>> Just use the % key.
>
> I specifically _don't_ want a high learning curve. I want this to
> remain fun, if possible.

Ah. Then you picked the wrong language, you should be using Python.

(I'm only half joking.)

I use emacs as well. I tried eclipse, but found it huge, slow,
clunky, and I ran into compatibility problems between versions. I
went back to emacs.

I also tried visual slick edit, and it's pretty nice, but it didn't
seem worth the hassle of dealing with the licensing.

The Scite editor is pretty decent (I really like the folding feature),
but I haven't used it much.

--
Grant

Mark Knecht 02-06-2011 04:42 PM

IDE recommendations for writing C?
 
On Sun, Feb 6, 2011 at 9:09 AM, Nikos Chantziaras <realnc@arcor.de> wrote:
> On 02/06/2011 12:08 AM, Mark Knecht wrote:
>>
>> Can someone recommend a good IDE to write C code in?
>>
>> 1) Something that can display multiple files in a project.
>>
>> 2) Something that have some sort of version control built into it?
>>
>> 3) If possible, I can compile right in the IDE.
>>
>> I've starting writing something. It's hundreds of lines long in 1 file
>> and I just messed up a brace somewhere which I haven't been able to
>> figure out in vi.
>
> 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?

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.

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.

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.

If I can find a simple C++ Hello World program that actually uses
classes or whatever makes C++ C++ then I'll see how it works. It's
pretty easy to drop in a few CUDA commands and see if i works.

Thanks for the info. Looks interesting.

Cheers,
Mark

Mark Knecht 02-06-2011 04:59 PM

IDE recommendations for writing C?
 
On Sun, Feb 6, 2011 at 9:42 AM, Mark Knecht <markknecht@gmail.com> wrote:
<SNIP>
> I'll take a look at it. Do you recommend the testing 2.0 versions or stable 1.3?
<SNIP>

Never mind on the 2.0 item. I run stable and that would require about
15 qt packages to be unmasked. Not interested in going there right now
- maybe later.

Cheers,
Mark

Nikos Chantziaras 02-06-2011 05:19 PM

IDE recommendations for writing C?
 
On 02/06/2011 07:42 PM, Mark Knecht wrote:

On Sun, Feb 6, 2011 at 9:09 AM, Nikos Chantziaras<realnc@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.

Nikos Chantziaras 02-06-2011 05:33 PM

IDE recommendations for writing C?
 
On 02/06/2011 07:59 PM, Mark Knecht wrote:

On Sun, Feb 6, 2011 at 9:42 AM, Mark Knecht<markknecht@gmail.com> wrote:
<SNIP>

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

<SNIP>

Never mind on the 2.0 item. I run stable and that would require about
15 qt packages to be unmasked. Not interested in going there right now
- maybe later.


You can also download it as a Linux installer:

http://qt.nokia.com/developer/qt-qtcreator-prerelease

I did this before it was put into portage. I simply installed it as a
normal user into my own home directory to make sure it won't mess with
system configuration.


But on the other hand, the 1.3 version is fine too and does the job just
as well.

Helmut Jarausch 02-06-2011 06:46 PM

IDE recommendations for writing C?
 
On 02/05/2011 11:08:34 PM, Mark Knecht wrote:
> Can someone recommend a good IDE to write C code in?
>
> 1) Something that can display multiple files in a project.
>
> 2) Something that have some sort of version control built into it?
>
> 3) If possible, I can compile right in the IDE.
>
> I've starting writing something. It's hundreds of lines long in 1
> file
> and I just messed up a brace somewhere which I haven't been able to
> figure out in vi.
>

Let me suggest another alternative.

I am enthusiastic about CodeLite, see
www.codelite.org

Helmut.

--
Helmut Jarausch
Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany


All times are GMT. The time now is 10:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.