LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-12-2008, 03:32 AM   #1
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Rep: Reputation: 17
Question your opinion: eclipse vs anjunta vs kdevelop vs younameit for large C++ OpenGL app


I'm trying to get back to work on a 3D simulation/graphics/physics/game engine/server application after being sidetracked for a few months. But I'm having problems making the application build/run/debug properly with current C/C++ IDEs. Hence my request to hear the experiences of linux C/C++ programmers currently building/debugging largish applications with an IDE --- or trying and failing and/or struggling and/or overcoming difficulties and able to convey warnings and tips.

Some background: My application requires the following elements to function:

OpenGL 2.0+ with GLSL 1.1+ shader language (vertex and pixel shaders)
low-level XWindows via xlib function libraries
GLX 1.4+ (part of XWindows/OpenGL)
standard C function libraries
32-bit assembler

In other words, only [what I consider] mainstream software packages.

The C/C++ IDEs that I know about and have tried recently include:
- eclipse IDE/CDT (CDT = v5.0, called "ganymede")
- kdevelop
- anjuta

After MUCH screwing around, I managed to get eclipse to compile and run my application. But the IDE crashes and all the windows just vanish from the desktop at random intervals - usually when I am not running my application, and usually when I am not doing much of anything at all. Furthermore, the IDE is the slowest piece of software I have ever seen! I disabled [forgot the word now] so it doesn't try to parse and update the entire program every keystroke, and that helps alot. But it is still klunky, klunky, klunky - orders of magnitude klunkier and slower than VS on windoze.

I was not able to get kdevelop to incorporate its own documentation, much less the documentation of other important packages it claims to support and offer. And I was not able to build and execute a simple "hello world" program either --- it appears to be missing something, but what is not clear. Question: Is kdevelop ready for prime time? What needs to be done to set it up? I did read the basic document (which does exist, amazingly), and did install a couple packages it wanted to process documentation in various ways. But still, no joy.

The story with anjuta is similar to kdevelop, only it was more confusing. And it almost seemed like anjuta does virtually nothing for me at all - except put a GUI around the low level tools. But maybe I'm reading the documentation wrong.

So, anyone have opinions?

-----

More background about my application (in case it matters). I have windoze and linux versions of the application, and the code is "identical" - in the sense that the exact same set of .h and .cpp files compile and run on both windoze and linux. But of course they include some #ifdef ... #endif sections where OS-specific code exists (all driven off of 4 pre-processor symbols CPU32, CPU64, LINUX, WINDOZE). Still, since OpenGL is on both systems, not much code is different between them (mostly create/destroy/resize windows, and turning the windoze and xlib message queues into an OS-independent unified message queue).

Anyhow, when I left off a few months ago, I had been running fedora8 + eclipse to develop/test on linux, and had just switched to fedora9 --- but was not able to make fedora9 behave well enough to continue.

So a week or two ago when I tried to restart development, I tried fedora9 again without success, and finally ended up downloading and installing 32-bit and 64-bit ubuntu 8.04.1 LTS on two separate 1TB hard drives. Both of the ubuntu operating systems seem to work fine, so far. I was hoping to be able to build (and maybe even execute) both 64-bit and 32-bit versions of my code on 64-bit ubuntu, and I think that should work (in theory) --- but I have not made that work. However, I am willing to have two separate linux systems to test 32-bit and 64-bit versions.

I think that's enough. Obviously my applications are not tiny, but also not huge. The .h and .cpp files add up to about 4~5 megabytes of text in about 40 files, not counting a few large images (2K x 2K pixels @ RGBA) loaded as texture-maps, normal-maps, height-fields, etc.

Which IDE do you think is best to invest my time in? Which are probably not up to this kind of work well? Hopefully at least one will be "good enough". Yes, I know it is possible to do everything with command line tools like gdb, but let's not go there.
 
Old 08-12-2008, 11:18 PM   #2
graemef
Senior Member
 
Registered: Nov 2005
Location: Hanoi
Distribution: Fedora 13, Ubuntu 10.04
Posts: 2,379

Rep: Reputation: 148Reputation: 148
I have used KDevelop (under the Gnome desktop sitting on top of fedora 6, 7) without any problem. With some sizeable projects normally using the Qt library. Did you install it from the package manager or compile from source? I would certainly suggest using the package manager.

I have had problems with Eclipse and the C++ plugin and just not invested sufficient time to workout what it was that was going wrong.
 
Old 08-13-2008, 12:02 AM   #3
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by graemef View Post
I have used KDevelop (under the Gnome desktop sitting on top of fedora 6, 7) without any problem. With some sizeable projects normally using the Qt library. Did you install it from the package manager or compile from source? I would certainly suggest using the package manager.

I have had problems with Eclipse and the C++ plugin and just not invested sufficient time to workout what it was that was going wrong.
Yes, I installed kdevelop with the synaptic package manager application. Then I installed a couple other elements the kdevelop documentation said I should to support the documentation. But much of the documentation doesn't work, and the IDE doesn't seem to work right either, though that could be me (being newbie on kdevelop).

I'm not sure where I will get the best return for investing my time and effort.

To be sure, eclipse is obviously massive bloatware AND a perfect illustration of why I would never consider Java [or any [semi]-interpreted language] for my applications.

Anyone else? I'll probably [try to] work on eclipse until somebody "sets me straight" (if possible).
 
Old 08-13-2008, 12:48 PM   #4
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
I hear that eclipse doesn't like java 6. Since you can install java 5 from the Ubuntu repositories too (Fedora requires manual install) , have you tried that as an alternative? You may need to switch versions manually after installing (unless you unintall jdk6/jre6 completely, I guess) but if you install galternatives, that should be quite straightforward.

Last edited by jay73; 08-13-2008 at 01:10 PM.
 
Old 08-13-2008, 03:06 PM   #5
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Have you tried netbeans with the c/c++ plugin and/or sun studio 12?
 
Old 08-13-2008, 04:21 PM   #6
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by jay73 View Post
Have you tried netbeans with the c/c++ plugin and/or sun studio 12?
I do believe I installed jre6u7 (which presumably is version 6.7). I don't really understand what netbeans, studio 12, and various other versions that sun/java lists on their website. Which of their listed packages will work for me, I have no idea. If you suggest your "best guess", I will be happy to uninstall what I have (if i can figure out how) and install your best guess.
 
Old 08-13-2008, 11:10 PM   #7
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
OK, you should look here: http://developers.sun.com/sunstudio/downloads/index.jsp
Before you can download, you need to subscribe as an SDN member(it's free). When you click on the download button, you can log in with your SDN membership information, which will take you to the download page. Select platform (linux x86 for both 32 and 64 bit) and accept their terms.
You will find that there are two options: you can download a version for Suse/RedHat or a more generic version (end ins ii-tar.bz2). If you are using Fedora, yoiu may want to try the former but considering the pace at which Fedora introduces updates, there aren't any guarantees (it is always about a year ahead of RedHat); I know that it intalled on Fedora 6 without a hiccup but that was then. If it doesn't work, you can try the generic version; in fact, it is a bit cleaner to set up and remove. All you need to do is extract it, go into the netbeans/etc subdirectory and set your java_home path and then you can start studio directly by going into the sunstudio/bin directory and running ./sunstudio. I have not had time to try this on Fedora but I tried it on Ubuntu 64 bit - no problems at all (at first sight).

A new studio has been forthcoming. As you can see studio 12 is ten months old by now and it is still using netbeans 5.5 (netbeans provides the GUI). If you would like to try the latest beta, which uses netbeans 6.1, you should go back to the link above and look in the bottom right corner to download Studio Express.
 
Old 08-14-2008, 11:23 AM   #8
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
Thanks for the information. I'm gonna trust your much more extensive experience with this stuff and try what you say. But first I need to tell you which linux I am working on, and confirm which package I should select. I *was* working on fedora8, but when I installed fedora9 on a new computer, I was not able to get it working well enough to work with. For one, it would not upgrade successfully, which was enough for me to pull the plug. So I switched to ubuntu for both 32-bit and 64-bit and both installed and work okay (though the motion of objects in my graphics applications seem to be "jittery" for some unknown reason, even though it appears to be consuming only 4% of one of the four CPUs on my phenom 9850 CPU. Not sure what that is caused by, but I'm sticking with ubuntu for now.

So, would I be correct to assume I should adopt the "generic version"? It seems that is what you did on ubuntu 64-bit, which will be one of my 2 platforms. Once you confirm, I'll give it a try. Thanks for helping.
 
Old 08-14-2008, 11:56 AM   #9
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Yes, that's it, the generic version is what is needed. It's the smaller of the two (about 220MB), the one that is "unsupported" - which doesn't matter unless you were intending to shell out $1000/year for support.

Don't forget to set the proper path to your java directory in netbeans/conf (should be /usr/lib/jvm/jdk-6-latest if you installed jdk6 from the repositories) as it does not seems to check environment variables.
 
Old 08-14-2008, 12:38 PM   #10
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by jay73 View Post
Yes, that's it, the generic version is what is needed. It's the smaller of the two (about 220MB), the one that is "unsupported" - which doesn't matter unless you were intending to shell out $1000/year for support.

Don't forget to set the proper path to your java directory in netbeans/conf (should be /usr/lib/jvm/jdk-6-latest if you installed jdk6 from the repositories) as it does not seems to check environment variables.
Okay, thanks. What should I do to uninstall jre6u7 before I do all the above? Or do I even need to do that? Incidentally, after I installed jre6u7 that allowed eclipse to start and function, but the ubuntu web browser still cannot run java apps (when I run the test on the www.java.com web page).
 
Old 08-14-2008, 02:23 PM   #11
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
I wouldn't bother uninstalling the jre. Just install the sun-java6-jdk through Synaptic and it will erase the jre if it gets in the way (the jdk contains its own jre so a separate one is not really required).

Netbeans does not depend on environment variables to the extent that eclipse does. Just specifying the path in sun studio/netbeans/etc/conf should do the trick. And neither - unlike eclipse - will it fail to work if you use a 32 bit jdk with a 64 bit IDE or the other way round. If you are working on a large project, you may want to have a closer look at the conf file; it also has options to optimize java garbage clean-up and to increase the memory heap (assigning too little memory can cause crashes).

Your current java issues may be a result of Linux not automatically picking up the sun-jre. Most distros now provide Open-JDK, the open source version of Java. This works quite well in most cases but it is not fully implemented and has been known to cause issues. In fact, you may even be using gcj, which is yet another open source version of java and which tends to get installed almost by default. The trouble is that most distros will keep using the first java that was installed even if you later install another version. To check which one is your default, open a terminal and run
java -version
and
echo $JAVA_HOME
On a 64 bit system, you should get something like:

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) 64-Bit Server VM (build 10.0-b22, mixed mode)

and

/usr/lib/jvm/java-6-sun

You can switch to a different version from the command line but you can also install the galternatives GUI to do so (it should appear under Applications > System tools). Make sure that javac and java are pointing to /usr/lib/jvm etc.

Other potential causes of conflict, as suggested, are running a 32 bit jdk/jre when you are using a 64 bit eclipse or the other way round. Or having installed your jdk/jre from a package that you downloaded directly from Sun - that would require setting all the paths manually unless you'll use it for netbeans only. I installed the latest netbeans today and pointed it to a 1.6.10 jdk that I had downloaded directly from sun (because it's not available from the repository yet). I have not bothered settings its paths because I don't want it to conflict with my default but netbeans runs even so. jdk1.6.10 is reported to run faster and consume less memory than previous versions. Something to keep in mind should you find that things are too slow.

As for not being able to run java apps from your browser, you may be using 64 bit sun java, which does not provide any browser plug-in at all. The solution in that case is installing icedtea-gcjwebplug-in. 32 bit sun-java does have the plug-in and it should work out of the box - but if it doesn't, you can always create a symlink from the plug-in to your mozilla plug-ins directory.

Last edited by jay73; 08-14-2008 at 02:44 PM.
 
Old 08-14-2008, 07:01 PM   #12
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
java -version displayed:

java version "1.5.0"
gij (GNU libgcj) version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)

Copyright (C) 2007 Free Software Foundation, Inc.
this is free software; see the source for copying conditions. There is NO warranty;
not even for MERCHANTABILITY or FITNESS FOR A PARTIUCLAR PURPOSE.

echo $JAVA_HOME displayed nothing at all

I am rather surprised at the above, because I downloaded and installed java from the www.java.com website, and it was version "6u7". Got me batman.

Also, I am installing this on 32-bit ubuntu at the moment. I want to get the 32-bit stuff working first, because I don't have 64-bit versions of all my assembly language routines finished (so it won't compile and run yet). Furthermore, I suspect the 32-bit nvidia drivers are more reliable (just a guess).

Also interestingly, synaptic claimed sun java 6 was already installed. Oh well. The documentation and source parts were not selected, so I re-selected *everything* and let it "reinstall" what it thought it already had, and newly "install" everything it did not yet have.

What do you mean by "javac" and "java"? Are they links that the installation process creates? Or something else (environment variable)?

When I am trying to view large source files, eclipse crashes, sometimes displaying "out of memory" errors before vanishing into nothingness. Since I do have some largish source files, I did what it said, namely "turn off scalability" (or something like that) - which prevents it from trying to reparse and create new symbol tables on every keystroke --- WHAT MORONS.

synaptic told me to download "jdk-6-doc.zip" from java.sun.com/downloads and save it into the /tmp folder during installation, then press enter (to continue the installation process). I did that (though I found that kind of strange).

I found no "galternatives" so I ran "apt-get install galternatives" and that made an "alternatives configurator" appear in the menus as you mentioned. When I ran galternatives and selected "java" on the left, it gave me 4 options to choose from:

/usr/lib/jvm/java-gcj/jre/bin/java (priority = 1042)
/usr/lib/jvm/java-6-sun/jre/bin/java (priority = 63)
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java (priority = 53)
/usr/bin/gij-4.2 (priority = 43)

With the first on the list selected. I selected the second item in the list, cuz thats the one that looks most plausible to me. For "javac" the only option was similar to the one I selected for "java", namely:

/usr/lib/jvm/java-6-sun/bin/javac

After I tweaked things in galternatives, "java -version" output:

java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Server VM (build 10.0-b22, mixed mode)

but "echo $JAVA_HOME" still output nothing at all.

Well, eclipse runs - still - but who knows whether it is invoking the new jre/jvm/whatever. I guess I'll work for awhile and see what happens.

Oh, one more thing. It is not compiling now, not sure why, but it has something to do with files I am including from another directory, like this:

#include "../ice/math.h"
#include "../ice/mathasm.h"

I marked that directory as "referenced" by this application, but that didn't seem to solve the problem. The compilation generates an "undefined reference" error at every line that calls a function in any file in that directory (apparently). Any ideas?
 
Old 08-14-2008, 07:44 PM   #13
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
To make sure that Eclipse is using the sun java JVM, you can edit your .profile (hidden inside your home directory). Just add this to the bottom:
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export J2RE_HOME=/usr/lib/jvm/java-6-sun/jre
export JAVA_BIN=$JAVA_HOME/bin
export PATH=$JAVA_BIN:$PATH
These changes should go through as soon as your run
source .profile
(check again with echo $JAVA_HOME)
If it doesn't work, then logging out and back in should get it going.

Javac and java are the Java compiler and the java interpreter. Both can be found inside /usr/lib/jvm/jdk-6-latest/bin and /usr/lib/jvm/jdk-6-latest/jre/bin. These are the guys that actually drive the GUI (java in particular).

The compilation issue may be explained here (item 10):
http://www.vtk.org/Wiki/CMake:Eclipse_UNIX_Tutorial
 
Old 08-15-2008, 01:08 AM   #14
maxreason
Member
 
Registered: Dec 2007
Location: phobos, mars
Distribution: 64-bit linux mint v20
Posts: 259

Original Poster
Rep: Reputation: 17
Hmmmm, strange. I don't see how this happens, or is related to changing which java is behind everything, but now when I try to compile my program I get 7 errors that are all essentially one error:

/usr/include/bits/stat.h field 'st_atim' has incomplete type
/usr/include/bits/stat.h field 'st_ctim' has incomplete type
/usr/include/bits/stat.h field 'st_mtim' has incomplete type

I cannot decode what the problem is, but after reviewing all the links provided to me by google on these lines of text, the likely culprit is <time.h> not being included by <sys/stat.h> in certain situations, and <time.h> is where the required definition is. At least that's what my best guess is from reading the messages and replies.

One of my files does #include <time.h> and <sys/time.h>, but none of my files #include <sys/stat.h> --- at least not directly. Of course, some other file that my files include might include <sys/stat.h>.

Any idea what the problem is? Any idea how getting Java setup properly could have caused this?

I can't say why exactly, but I do get the feeling the eclipse IDE is behaving better (less sluggish and strangely). So maybe all the upgrade effort we did helped. I think we are very close here... continued thanks.
 
Old 08-16-2008, 06:28 PM   #15
jay73
LQ Guru
 
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 133Reputation: 133
Hard to tell. I have seen that kind of message when a class declaration had a bad brace but if it worked before then that can't be the problem. Couldn't it be because of the way that your files are organized in /usr/include?

Last edited by jay73; 08-16-2008 at 06:35 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
best distribution for me - for C/C++ 3D OpenGL GLSL [eclipse IDE/CDT] maxreason Linux - General 47 08-23-2008 08:20 PM
LXer: Opinion : XGL- An Xserver framework based on OpenGL LXer Syndicated Linux News 0 02-11-2006 01:01 AM
Your Opinion on KDevelop Cyb3rKnyght Linux - Software 1 12-12-2004 03:44 AM
probs with compiling kdevelop app joeman3429 Programming 1 08-27-2004 07:41 PM
what app to use for large download Lindy Linux - Software 5 12-15-2003 10:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration