I'm quite new to Erlang and this list so I hope I'm posting in the right place?
I would like to use Erlang code (couchdb) in an Mac OS X app I'm
developing and I would like to bundle it with my app. Exactly like the
Mac OS X version of Wings3D is bundling a version of erlang.
I was wondering if someone kind provide me with some ideas of how to
compile a smaller version of the Erlang VM without the developing
tools etc?
Cheers,
Albin
_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
The methods described at http://learnyousomeerlang.com/release-is-the-word
use systools and reltool, which result in rather large distributables.
"...with systools...the files are a bit large. The whole release takes
over 20 MB on disk..."
"...Some of our more general releases would weigh in at over 35 MB.
The one described above is reduced to less than 20 MB [with
reltool}... The size is still fairly large though. That's because of
ERTS, which itself takes 18.5 MB."""
However, http://www.erlang.org/faq/implementations.html says
"A 2 MB stripped Erlang system can include the beam emulator and
almost all of the stdlib, sasl, kernel, inets and runtime_tools
libraries, provided the libraries are compiled without debugging
information and are compressed..."
Are there detailed directions anywhere on building such small
distributables?
This is a scrappy half-completed bash script I used to generate
a small Erlang release. It's something I hope can eventually grow
into a more general and stable tool for generating Erlang releases.
It does contain some useful things for reducing the size of an
Erlang release.
Also thanks to Adam Lindberg for helping out with it.
https://github.com/Gustav-Simonsson/Stripped-Erlang/blob/master/minimal_erlang.sh
Regards,
Gustav Simonsson
Sent from my PC
If you want to reduce the disk usage as much as possibly you can read on methods
in chapter 3.2 and results in chapter 5.1 in the following thesis:
http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-156435
> However, http://www.erlang.org/faq/implementations.html says
>
> "A 2 MB stripped Erlang system can include the beam emulator and
> almost all of the stdlib, sasl, kernel, inets and runtime_tools
> libraries, provided the libraries are compiled without debugging
> information and are compressed..."
>
> Are there detailed directions anywhere on building such small
> distributables?
That part of the FAQ was written about 10 years ago, when erts was
smaller than it is today. It's still possible to get below 3M without
pulling wild tricks, e.g. on an ARM system I have
# du
24 ./bin
1019 ./lib
1480 ./erts-5.8.4/bin
1480 ./erts-5.8.4
2523 .
Full list of files below.
The shrinking is done by judicious use of 'rm', plus this hack:
http://erlang.org/pipermail/erlang-questions/2011-June/059489.html
Matt
--------------------
# ls -lR
.:
drwxrwxr-x 2 root root 0 Dec 13 16:03 bin
drwxr-xr-x 3 root root 0 Dec 13 16:03 erts-5.8.4
drwxr-xr-x 2 root root 0 Dec 13 16:03 lib
./bin:
-rwxr-xr-x 1 root root 857 Dec 12 15:00 erl
lrwxrwxrwx 1 root root 25 Dec 13 16:03 run_erl -> ../erts-5.8.4/bin/run_erl
lrwxrwxrwx 1 root root 6 Dec 13 16:03 run_test -> ct_run
-rwxr-xr-x 1 root root 1159 Dec 12 15:00 start
-rw-r--r-- 1 root root 5372 Dec 12 15:00 start.boot
-rw-r--r-- 1 root root 6350 Dec 12 15:00 start.script
-rwxr-xr-x 1 root root 1259 Dec 12 15:00 start_erl
-rw-r--r-- 1 root root 6535 Dec 12 15:00 start_sasl.boot
lrwxrwxrwx 1 root root 24 Dec 13 16:03 to_erl -> ../erts-5.8.4/bin/to_erl
./erts-5.8.4:
drwxr-xr-x 2 root root 0 Dec 13 16:03 bin
./erts-5.8.4/bin:
-rwxr-xr-x 1 root root 1411656 Dec 12 15:00 beam
-rwxr-xr-x 1 root root 9304 Dec 12 15:00 child_setup
-rwxr-xr-x 1 root root 857 Dec 12 15:00 erl
-rwxr-xr-x 1 root root 35168 Dec 12 15:00 erlexec
-rwxr-xr-x 1 root root 32624 Dec 12 15:00 inet_gethost
-rwxr-xr-x 1 root root 16068 Dec 12 15:00 run_erl
-rwxr-xr-x 1 root root 7980 Dec 12 15:00 to_erl
./lib:
-rw-rw-r-- 1 root root 63577 Dec 12 15:00 erts-5.8.4.ez
-rw-rw-r-- 1 root root 311423 Dec 12 15:00 kernel-2.14.4.ez
-rw-rw-r-- 1 root root 39390 Dec 12 15:00 sasl-2.1.9.4.ez
-rw-rw-r-- 1 root root 628179 Dec 12 15:00 stdlib-1.17.4.ez