[gecode-users] embedded gecode

Mikael Zayenz Lagerkvist zayenz at gmail.com
Fri Apr 8 07:15:50 CEST 2011


On Fri, Apr 8, 2011 at 6:54 AM, Ruben Zilibowitz <ruben.zilibowitz at gmail.com
> wrote:

> >> 2) My executables, even after dead code elimination and other
> optimisations are very large. It's around 17 Mb. I'm not sure there's an
> easy fix for this, but any ideas would be welcome, for how to reduce file
> size of the executable. It seems that there are many features I'm not going
> to need, so perhaps I can try to strip down the library.
> >
> > First of all, that sounds like you're linking statically, right?  It's
> true, the Gecode libraries are a bit on the fat side.  What you can
> definitely do is strip the debug symbols.  Other than that, I think the
> linker already only includes the symbols that it needs, so there's not much
> you can do in addition.
>
> Yes, statically. I'm not sure there's any other way when it comes to
> building iPhone apps. That 17 Mb is for a "fat" binary that supports two
> architectures (armv6 and armv7). So the real figure is about half that.
> Still it would be nice if it was smaller.


Stripping debug symbols helps a lot with size. On my machine, the size of
the dynamic libraries goes from 52 MiB to 7.1 MiB when stripped.

In addition, you can try and compile Gecode with -Os as optimization flag.
It won't be as fast, but it might make the executable smaller (I haven't
tried it, you'll need to experiment). Also, make sure that you are only
including the parts that you need (Gist and flatzinc might not be relevant
for example).

If you really want to make the executables as small as possible, then you
could start to remove parts that you are not using. You might want to
investigate if there is a way to make your compilation tool-chain do
automatic dead-code removal.

Out of curiosity, what does your App do?

Cheers,
Mikael

-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20110408/9036fc3b/attachment.htm>


More information about the users mailing list