Linux Debug vs Release not much difference...

Get answers to all your basic programming questions. No Ogre questions, please!
Post Reply
User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

Linux Debug vs Release not much difference...

Post by toglia »

I know in windows (visual studio actually) there's a HUGE difference when building the apps with "debug" or "release" configurations, but lately that I have started to work in Linux I haven't seen that. I know visual studio embeds a lot of information to the debug build to make those extensive debug features possible but is this still a windows thing?

I didn't even see OgreMain_d.so when building ogre...

Please excuse my ignorance... :P

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Re: Linux Debug vs Release not much difference...

Post by CABAListic »

If you want a debug version of Ogre, you need to set CMAKE_BUILD_TYPE to Debug in CMake. Otherwise, you'll get a release build with debug symbols. Generally, GCC has a lot less trouble linking debug applications to release libraries, so you can link your debug applications to a release Ogre which will result in relatively fast rendering.

User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Re: Linux Debug vs Release not much difference...

Post by milliams »

Here's what I posted on another forum when talking about a similar topic. Maybe it is of some help here:


In Linux we don't tend to bother with 'debug' libraries. Any library we get from our distro will have been build with the RelWithDebInfo CMake build type which sets -O2 -g. This means that it's optimised but not to the point of mangling line numbers and symbols and the -g means that debug symbols are included. Then, before it's all put into an RPM, the debug symbols are stripped out and put into a separate package. This way we can run with almost fully optimised libraries but can get the debuginfo if we really need it.

The Debug build type will just set -g so there is 'no' optimisation in order to get most accurate symbol locations. This isn't used much since RelWithDebInfo is usually fine.

Finally, Release sets the flags -O3 -DNDEBUG which obviously optimises more but also sets -DNDEBUG which turns off asserts etc.

So really the only difference between release and debug (RelWithDebInfo) builds is a little bit of optimisation, inclusion of debug symbols and the lack of asserts. Because of this I think that most people developing against a copy of the library they built themselves would build the library with RelWithDebInfo and then only switch to a release build if they were then going to include the library (static or shared) along with their project.

User avatar
toglia
Gnome
Posts: 336
Joined: Sat Dec 08, 2007 4:28 am
Location: Canada
x 7

Re: Linux Debug vs Release not much difference...

Post by toglia »

Hey thanks!

I'm getting a little bit more comfortable with linux now. I'm still getting the hang of it, but it seems much simpler that windows itself! :P

Post Reply