[gecode-users] How to compile faster gecode programs

Guido Tack tack at ps.uni-sb.de
Thu Jun 12 12:38:37 CEST 2008


Mauricio Toro wrote:
> I've been developing an application with Gecode.
> I am compiling this way:
>
> g++ -I. -DNDEBUG -fvisibility=hidden -fPIC -Wextra -Wall -pipe -ggdb  
> -O3 -fno-strict-aliasing -finline-limit=3000 -ffast-math    \
> 	 -o examples/nttcfo  examples/nttcfo.cc -lgecodesearch - 
> lgecodecpltset  -lgecodeset -lgecodeint -lgecodeminimodel - 
> lgecodeserialization -lgecodekernel -lgecodesupport -L /System/ 
> Library/Frameworks/MidiShare.framework/MidiShare
>
> It has been great for the developement, but now, I want the  
> compilation
> and the application to run faster and I don't want to add support
> for assertions, ggdb, debug symbols, etc.

You already used full optimization (-O3), and no assertions are  
compiled in (-DNDEBUG).  The only thing left are the symbols (-ggdb),  
which shouldn't do much harm.

> How should I compile?

Exactly the way you did.

> Additionally, I would like to know if it matters when say
> -lgecodecpltset -lgecodeserialization, etc
> when I am not using those APIs.

If you don't need them, you don't have to link them, but that won't  
change your executable's efficiency. A slightly faster system can be  
built by disabling set variables when you compile Gecode, i.e., using  
the --disable-set-vars configure switch.  But I doubt the performance  
will be really noticeably faster for you.

Cheers,
	Guido





More information about the gecode-users mailing list