Suggest an open-source C/C++ IDE

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Suggest an open-source C/C++ IDE

Postby Rysto » Sun Mar 16, 2014 9:46 pm UTC

I'm getting sick of editing code in simple text editors (e.g. kate) because I find that it really hampers my productivity. At work I use a nice Windows-only IDE, but I need something more portable (and with a better price tag ;)) for my personal use. My requirements are:

- It must run on Linux and FreeBSD (I use KDE in both cases)
- It must not put any of its metadata in the source code directory. Anything in the source directory gets nuked whenever I run git clean -f. It's unbelievable how many open-source IDEs don't understand this.
- It must not insist on understanding my build system, or worse try to impose its own. I'm working on something that has it's own quite complicated build system. No IDE is ever going to understand it, and that's fine. It's fine if the IDE doesn't try to build my project at all -- I'm perfectly happy to drop to the command line to run my builds. But I have tried some IDEs that refused to create a project that they could not build, so those are out.
- It must scale to large projects (thousands of source files and headers). This probably means not trying to keep the entire symbol index in memory.
- It must have good code navigation tools. This is the primary reason why I want an IDE over a simple text editor. The most important thing is to be able to navigate to a symbol's definition quickly. Ideally Control-left click does this. The ability to go back where I came from is also very important.
- One thing that I would really like but have never seen any open source IDE do is have a good method for opening files quickly. Typically they make you navigate the directory tree to find the file

korona
Posts: 495
Joined: Sun Jul 04, 2010 8:40 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby korona » Sun Mar 16, 2014 9:48 pm UTC

Have you tried Eclipse?

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Suggest an open-source C/C++ IDE

Postby Rysto » Sun Mar 16, 2014 10:19 pm UTC

korona wrote:Have you tried Eclipse?

It dies horribly on thousands of source files. It was completely unusable the last several times that I tried it.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Suggest an open-source C/C++ IDE

Postby troyp » Mon Mar 17, 2014 6:47 pm UTC

Rysto wrote:- It must not put any of its metadata in the source code directory. Anything in the source directory gets nuked whenever I run git clean -f. It's unbelievable how many open-source IDEs don't understand this.

Why not add patterns for the metadata files to .gitignore (or configure them as excludes from the clean command)?

I don't have any experience with large projects, but if you have the time to invest to set it up, I'd consider Emacs. I'm pretty sure it can handle even very large projects, and it has any number of options for file and code navigation. The best part is that it's the most scriptable editor/IDE you'll find. You never have to worry about stupid things like little bits of functionality you really need being missing: it's easy to just add them. It does take time to customize it to your needs, though (not to mention, to learn in the first place).

User avatar
ahammel
My Little Cabbage
Posts: 2135
Joined: Mon Jan 30, 2012 12:46 am UTC
Location: Vancouver BC
Contact:

Re: Suggest an open-source C/C++ IDE

Postby ahammel » Mon Mar 17, 2014 10:26 pm UTC

troyp wrote:You never have to worry about stupid things like little bits of functionality you really need being missing: it's easy to just add them.
Provided you have decent Lisp skills, of course.
He/Him/His/Alex
God damn these electric sex pants!

EvanED
Posts: 4331
Joined: Mon Aug 07, 2006 6:28 am UTC
Location: Madison, WI
Contact:

Re: Suggest an open-source C/C++ IDE

Postby EvanED » Mon Mar 17, 2014 10:29 pm UTC

troyp wrote:You never have to worry about stupid things like little bits of functionality you really need being missing: it's easy to just add them. It does take time to customize it to your needs, though (not to mention, to learn in the first place).
I use Emacs because it's a great editor, but I don't consider it an IDE and I do miss IDE-style features. For instance, I've never been successful getting code completion or search working well. Maybe I just am not very good at it or something.

lgw
Posts: 437
Joined: Mon Apr 12, 2010 10:52 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby lgw » Tue Mar 18, 2014 12:38 am UTC

I hear good things about QT Creator - it might not have your complete checklist, I'm not sure, but it's a full-featured IDE. Anyone have some first-hand QT Creator experience to share?
"In no set of physics laws do you get two cats." - doogly

Iv
Posts: 1207
Joined: Thu Sep 13, 2007 1:08 pm UTC
Location: Lyon, France

Re: Suggest an open-source C/C++ IDE

Postby Iv » Tue Mar 18, 2014 7:02 am UTC

QT Creator is my prefered tool for doing C++ (which is half of the time approximately). Let's run through this checklist.

Rysto wrote:- It must run on Linux and FreeBSD (I use KDE in both cases)
Yup. And also works on windows and Mac OS smoothly.

Rysto wrote:- It must not insist on understanding my build system, or worse try to impose its own. I'm working on something that has it's own quite complicated build system. No IDE is ever going to understand it, and that's fine. It's fine if the IDE doesn't try to build my project at all -- I'm perfectly happy to drop to the command line to run my builds. But I have tried some IDEs that refused to create a project that they could not build, so those are out.
That's ok, but you will still need to create a project file to indicate which files are part of the project. Alternatively it understands CMake files pretty well

Rysto wrote:- It must not put any of its metadata in the source code directory. Anything in the source directory gets nuked whenever I run git clean -f. It's unbelievable how many open-source IDEs don't understand this.
It does that and I agree that it is annoying. However, what it really does is that it adds meta data in the same directory as your project file, which can be in a clean separated directory. It never annoyed me to the point that I tried to configure this behavior differently though. As others have mentionned, .gitignore handles that pretty well.

Rysto wrote:- It must scale to large projects (thousands of source files and headers). This probably means not trying to keep the entire symbol index in memory.
I am not sure I went to the thousands, but I already did open my project + the sources of a big lib (OpenCV) in it and it worked fine.

Rysto wrote:- It must have good code navigation tools. This is the primary reason why I want an IDE over a simple text editor. The most important thing is to be able to navigate to a symbol's definition quickly. Ideally Control-left click does this. The ability to go back where I came from is also very important.
Note that in order to have that, you need the symbol index in memory. Code navigation is the main reason why I use QtCreator. It works really nice, I use F2 (I think it is the default key) to get to a definition, ctrl+shift+u finds the uses of the symbol in the project and alt left/right work like the back/forward buttons in a navigator. I also like the fact that it highlights other occurrences of the symbol under your cursor. (I put a more visible color scheme for that) It is a small feature but it is amazingly useful.

Rysto wrote:- One thing that I would really like but have never seen any open source IDE do is have a good method for opening files quickly. Typically they make you navigate the directory tree to find the file
[/quote]
ctrl+o and IIRC in KDE there is a shortcut to just start typing the name of the file. Otherwise, "F2" on an include reference will open the appropriate file. I almost never use that to open files in a project, I reach other files through code navigation using search across files or go to definition/reference shortcuts.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Suggest an open-source C/C++ IDE

Postby troyp » Tue Mar 18, 2014 12:43 pm UTC

EvanED wrote:I use Emacs because it's a great editor, but I don't consider it an IDE and I do miss IDE-style features. For instance, I've never been successful getting code completion or search working well. Maybe I just am not very good at it or something.

I don't really consider it an IDE, but that's mainly because I don't choose to use it as one. It does have a lot of the features of IDEs available (not to mention a shitload that they lack). It certainly has the file and code navigation features Rysto's after. For instance, the facilities Iv describes for Qt Creator are all readily available. As for code search and completion, there's a whole range of options, some generic and some language-specific.
Spoiler:
For completion, good basic generic solution would be yasnippet + dynamic abbrev + a tag completion function*, bound to one or more keys (hippie-expand is useful for combining a prioritized list of completion sources). Language-specific completion is often available, eg. emacs-clang (C/C++/objC), eclim (java),etc. Auto-complete provides a drop-down menu for these and other completion sources. (You could probably use alternate UIs like anything or imenu). There are also monolithic solutions like CEDET.

It's a similar story with code search. You can use various tools like ctags, cscope, clang, rope, etc, or native elisp libraries, for code-specific searching (either regex- or parser-based). Plus there are a ton of general search facilities like isearch+, regex-search, grep-mode, search-at-point, occur-mode, anything, imenu-anywhere, etc, etc.

* using tags for completion requires (re)generation of tags files, but that can be streamlined or automated as required.
For more full-fledged IDE facilities, there are ECB and CEDET.

Mind you, I'm not sure about Emacs for Java. I've heard complaints about JDEE. Emacs-eclim provides an alternative, but it relies on Eclipse which Rysto wasn't having much luck with. Also, Java is quite dependent on IDE features and has very mature IDEs available, so Emacs might be less compelling by comparison.

Apart from Java, though, the only reason I'd ever use an IDE over Emacs is because I don't have the time atm to set up (and/or learn) a proper environment for that language. (Which admittedly can be an important reason.)

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Suggest an open-source C/C++ IDE

Postby Rysto » Tue Mar 18, 2014 2:56 pm UTC

So qtcreator consumes all 32G in the system while trying to parse the project and eventually gets killed when the OS runs out of swap. It didn't come close to finishing parsing, either. It didn't even make it 1/4 of the way.

The winner so far is something called Codelite, which honestly could use more memory than it does. It only gets up to 500M or so, so it must store its index in a file and searches it each time. That's the right approach but given that I have 32G it'd be nice if it used some of that to speed things up. It actually stays stable though which is a big step up over the others.

User avatar
LucasBrown
Posts: 299
Joined: Thu Apr 15, 2010 2:57 am UTC
Location: Poway, CA

Re: Suggest an open-source C/C++ IDE

Postby LucasBrown » Tue Mar 18, 2014 6:29 pm UTC

What about Geany?

lgw
Posts: 437
Joined: Mon Apr 12, 2010 10:52 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby lgw » Tue Mar 18, 2014 7:52 pm UTC

Rysto wrote:So qtcreator consumes all 32G in the system while trying to parse the project and eventually gets killed when the OS runs out of swap. It didn't come close to finishing parsing, either. It didn't even make it 1/4 of the way.

The winner so far is something called Codelite, which honestly could use more memory than it does. It only gets up to 500M or so, so it must store its index in a file and searches it each time. That's the right approach but given that I have 32G it'd be nice if it used some of that to speed things up. It actually stays stable though which is a big step up over the others.


Wow, what kind of crazy system do you have here. Or does QT need more memory for the index than the entire codebase takes?
"In no set of physics laws do you get two cats." - doogly

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Suggest an open-source C/C++ IDE

Postby Rysto » Tue Mar 18, 2014 11:05 pm UTC

lgw wrote:Wow, what kind of crazy system do you have here. Or does QT need more memory for the index than the entire codebase takes?

I suspect that it's the index, but it's difficult to be 100% sure.

Iv
Posts: 1207
Joined: Thu Sep 13, 2007 1:08 pm UTC
Location: Lyon, France

Re: Suggest an open-source C/C++ IDE

Postby Iv » Wed Mar 19, 2014 3:02 am UTC

I had QT grind to a halt when I inadvertently added huge binary files as project files. It was trying to parse them as text.

If that is not the case, I am very curious about the kind of project that makes QTCreator eat 32G of memory. Is that proprietary?

scheurneus
Posts: 1
Joined: Wed Mar 19, 2014 1:48 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby scheurneus » Wed Mar 19, 2014 2:10 pm UTC

I'd recommend Code::Blocks (codeblocks.org). Free, and quite powerful. Haven't tried really big projects in it, however

Rysto
Posts: 1460
Joined: Wed Mar 21, 2007 4:07 am UTC

Re: Suggest an open-source C/C++ IDE

Postby Rysto » Wed Mar 19, 2014 11:13 pm UTC

It's FreeBSD. I was nice to it and only told it to tag the kernel, too. I can only imagine how badly it would die if I made it tag the userland too.

AndyG314
Posts: 99
Joined: Mon Feb 11, 2008 5:16 pm UTC
Location: Waltham MA
Contact:

Re: Suggest an open-source C/C++ IDE

Postby AndyG314 » Fri Mar 21, 2014 11:41 pm UTC

QT creater is good if you are doing QT work, it wants you to use qmake, but I think you can use another build system if you want.

Geany is an excellant IDE that is general purpose and can do any build system you want (You just give it the build command and it maps it to a button/menu item. It has a project file where it stores metadata, but you can put it anywhere you want. It doesn't do source code completion (at least not when I tried it) and it doesn't do git integration (again last time I used it)

BUT....

you should consider adopting a more linux style workflow if you are developing on linux. Linux dev's don't tend to rely on an ide, instead they rely on several tools each doing it's own thing, a text editor, grep, merge tool, git etc... This is a pritty common workflow and it works well. But if your heart set on an integrated ide, Geany should check all your boxes.
If it's dead, you killed it.

User avatar
You, sir, name?
Posts: 6983
Joined: Sun Apr 22, 2007 10:07 am UTC
Location: Chako Paul City
Contact:

Re: Suggest an open-source C/C++ IDE

Postby You, sir, name? » Sat Mar 22, 2014 4:35 am UTC

Rysto wrote:
korona wrote:Have you tried Eclipse?

It dies horribly on thousands of source files. It was completely unusable the last several times that I tried it.


Sure you just don't need to up the memory a bit on the JVM? It's configurable in eclipse.properties. The defaults are

Code: Select all

-Xmx512m

You'll probably want at least like

Code: Select all

-Xmx2048m

Possibly 4096 or 8192, depending on just how large your project is.

At least in Java it scales reasonably well. You can definitely feel it's a bit more sluggish when it needs to index 50,000 source files, but it's still impressively non-broken.
I edit my posts a lot and sometimes the words wrong order words appear in sentences get messed up.

FLHerne
Posts: 41
Joined: Fri Jan 13, 2012 9:44 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby FLHerne » Sat Mar 22, 2014 10:45 pm UTC

If you already use KATE, why not KDevelop? It's essentially KATE with IDE cruft strapped onto it, in the finest KDE style. :D

It has highlighting/context/comment interpretation/variable renaming; a crazy-flexible build system; plugins for gdb, git, a shell, file management, patch reviewing, aaargh too many buttons; auto-formatting with customisable spacing/newlines/indent style; QCH/HTML documentation viewer (really handy for Qt/OpenGL/PHP). Oh, and just about every other bell, whistle or knob you can imagine.

You can open the file something's declared in from its tooltip, enter the filename in the quick-open bar, or look at the file tree.

It does create .kdev* files in the source directory, but that's why my ~/.gitignore has a *.kdev* line in it. Might be possible to make it not do that, I haven't tried.

Initial parsing for the context/highlighting can be a bit slow, but once it's cached (persistently) it's fine. I haven't attempted to use it on anything larger than a couple of hundred files. The existence of the kdev-kernel plugin for Linux hacking suggests that it can cope with megaprojects if you have one. :)

Iv
Posts: 1207
Joined: Thu Sep 13, 2007 1:08 pm UTC
Location: Lyon, France

Re: Suggest an open-source C/C++ IDE

Postby Iv » Sun Mar 23, 2014 9:18 am UTC

AndyG314 wrote:BUT....

you should consider adopting a more linux style workflow if you are developing on linux. Linux dev's don't tend to rely on an ide, instead they rely on several tools each doing it's own thing, a text editor, grep, merge tool, git etc... This is a pritty common workflow and it works well. But if your heart set on an integrated ide, Geany should check all your boxes.

I respectfully disagree. As a linux dev who spent years doing it this way, I finally, reluctantly, admitted that a full-fledged IDE is a huge productivity boost. Sure, you can mimic some features of IDEs with a set of tools that you spend hours if not days configuring (and god forbids you use something other than C/C++). But when I was forced by a client to do some C#.Net I was amazed at the speed I could do what I need in a framework I did not know. 50% of the time, autocomplete will give you the function you are looking for without you having to dig the docs. It will tell you what type the parameters are. It will catch errors before compiling. It allows to navigate back and forth in the code, looking up usage of a function, finding definitions, putting a breakpoint, steping in and out and watching expressions on the fly.

None of this is impossible in the "linux flow" but I have never seen anyone do it as quickly as even a rookie developer does in a good IDE. I still have a terminal on the side. I consider it absolutely necessary for many things: git management, file operations, occasional python parsing, etc... but I don't think we still can say that it is a match to a good IDE.

Qt Creator is open source, works very well on linux (which is, I believe, their primary target), can use a regular workflow with cmake. I really recommend it. Apparently, MonoDevelop is pretty good as well, but mainly for C# code, which I still find a bit of an heresy under linux (for no good reasons, I know). I have never managed to use eclipse for anything, and even the java programmers I know prefer netbeans by far.

troyp
Posts: 557
Joined: Thu May 22, 2008 9:20 pm UTC
Location: Lismore, NSW

Re: Suggest an open-source C/C++ IDE

Postby troyp » Sat Mar 29, 2014 5:13 am UTC

FLHerne wrote:If you already use KATE, why not KDevelop? It's essentially KATE with IDE cruft strapped onto it, in the finest KDE style. :D

I'm pretty sure it's no such thing. The editor component would be an embedded KatePart, if that's what you mean, but your comment is roughly analogous to saying "bash is essentially readline with shell cruft strapped onto it".

Anyway, are sure that meets Rysto's criteria, particularly regarding the build system? I haven't used it myself, but I think it's pretty oriented towards cmake. For example, I'm sure I heard it doesn't support autotools, and that people have had trouble trying to use it with custom build systems.

FLHerne
Posts: 41
Joined: Fri Jan 13, 2012 9:44 pm UTC

Re: Suggest an open-source C/C++ IDE

Postby FLHerne » Sun Mar 30, 2014 8:00 pm UTC

troyp wrote:
FLHerne wrote:If you already use KATE, why no KDevelop? it essentially KATE wid IDE cruft strapped onto it, in de finest KDE style. :D

Me be pretty sure it no such ting. de editor component would be an embedded KatePart, if dat's wa you mean, but you comment be roughly analogous to a say "bash be essentially readline wid shell cruft strapped onto it".

Anyway, be sure dat meets Rysto's criteria, particularly regarding de build system? I nuh used it myself, but I tink it pretty oriented towards cmake. For example, Me be sure I heard it nuh support autotools, an' dat people dem have had trouble a try a use it wid custom build systems.
You're correct that it's built around KatePart, but since the standalone KATE application has very few features that aren't in KatePart that comes down to the same thing. :P It's certainly very noticeable that the editor component is separate, because it has its own configuration dialog with some settings that are overridden by the main one...

As to build-systems, that's why the project system is pluginned. The 'Generic Project Manager' allows executing arbitrary executables for configure and build, and the launch system always allows that, so writing a script to run any weird build sequence is possible. :wink:

User avatar
chasesan
Posts: 6
Joined: Thu Oct 13, 2011 3:53 pm UTC
Location: Walking the orbits of electrons.

Re: Suggest an open-source C/C++ IDE

Postby chasesan » Tue Apr 15, 2014 9:34 am UTC

I generally use Eclipse, but then again I am something of an old salt with that IDE. So I managed to get it working with C/C++ rather easily. The biggest gotcha's with running C/C++ in it is when your Index(er) isn't properly setup (making everything display as an error), and your tool chain not being detected.


Return to “Coding”

Who is online

Users browsing this forum: No registered users and 14 guests