[erlang-questions] reducing size of erlang

David Mercer dmercer@REDACTED
Tue Jul 15 21:00:39 CEST 2008

It was worth reading your whole post just to get to that last line... :-)

> -----Original Message-----
> From: erlang-questions-bounces@REDACTED [mailto:erlang-questions-
> bounces@REDACTED] On Behalf Of Matthias Lang
> Sent: Tuesday, July 15, 2008 12:48
> To: Andrew Harris
> Cc: erlang-questions@REDACTED
> Subject: Re: [erlang-questions] reducing size of erlang
> On Tuesday, July 15, Andrew Harris wrote:
> >    I'm new to erlang, but not new to functional programming.  I am
> > trying to compile erlang for the gumstix platform.  I think I've got
> > it compiled OK, but the bin/ and lib/ directories that are generated
> > from make install are really big.  I have read a few things on
> > removing debugging info by adding an argument to each makefile in
> > lib/, but this seems really tedious and I'm not sure how or where in
> > the makefile to do this.  I'm wondering if there is a command I can
> > pass to configure or something that will remove the debugging info
> > from the erlang build.  Also, I'm building R10B-10 because this is the
> > version I see some info on the web about how to build for a new
> > platform.
> Getting a basic, small Erlang down to 3MB is fairly straightforward.
> Is 3MB "really big". I don't know, you didn't give me any clues about
> what you were aiming for.
>   1. Add the +compressed and +slim flags to the build
>   2. Throw out all libraries you don't need.
>   3. Throw out all binaries you don't need.
>   4. Strip the remaining binaries.
> #1 is easily done by applying the attached patch (for R11, but the idea
> is the same) to a clean source tree. Clean means "before you run
> 'configure'".
> #2 is a bit more of a chore. "Really tedious", maybe. If you can muster
>    the will to do it, a quick way is to zap all libraries _apart_ from:
>      erlang/lib/erlang/lib/stdlib
>      erlang/lib/erlang/lib/kernel
>      erlang/lib/erlang/lib/sasl
> #3 is up to you. Chances are you don't need the dialyzer, epmd, erlc,
>    beam.hybrid
> #4 should be obvious.
> You can, of course, do more for a bit more effort. But it sounded like
> you were struggling to make it from the couch to the fridge ;-)
> Matt

More information about the erlang-questions mailing list