[erlang-questions] Making a minimal distributable program in Erlang.

József Bérces <>
Wed Sep 20 14:23:49 CEST 2017


Hi Joe,

Here is what I have bundled with a tool used mainly inside Ericsson:

erl
 |_ bin
 |   |_ beam.dll
 |   |_ beam.smp.dll
 |   |_ epmd.exe
 |   |_ erl.exe
 |   |_ erl.ini
 |   |_ erlexec.dll
 |   |_ erlsrv.exe
 |   |_ inet_gethost.exe
 |   |_ libeay32.dll
 |   |_ start.boot
 |_ lib
     |_ erts-8.1
         |_ ...
     |_ kernel-5.1
         |_ ...
     |_ ...

What libraries to include depends on the application's needs. You might also add MSVCR120.dll into the bin directory just in case your target users do not have it installed.

BR,
Jozsef

-----Original Message-----
From:  [mailto:] On Behalf Of Joe Armstrong
Sent: Wednesday, September 20, 2017 14:00
To: Sergej Jurečko <>
Cc: erlang-questions <>
Subject: Re: [erlang-questions] Making a minimal distributable program in Erlang.

Seems like I need to keep

  erl.exe
  start.boot
  beam.smp.dll
  erlexec.dll

And throw the rest away - seems to work (so far) - does anybody know If I've thrown  way too much

/Joe


On Wed, Sep 20, 2017 at 1:51 PM, Joe Armstrong <> wrote:
> On Wed, Sep 20, 2017 at 1:28 PM, Sergej Jurečko 
> <> wrote:
>> You can just delete the erl.ini file. That way the erl/werl will work 
>> no matter where you put the top level erlang folder.
>
> Yes - it worked - But how does erl.exe find the dll's ??
>
>
>
>> You can definitely also delete:
>> - all .pdb files
>> - all  *.debug.*.dll
>> - all .lib files
>> - all source (.c, .h, .erl, .hrl) files
>
> How much of the bin directories do I have to keep?
>
> I just want erlang with networking and a shell no distribution -
>
>
> /Joe
>>
>> A simple filelib:wildcard comprehension with delete across erl folder 
>> will achieve this quickly.
>>
>> Regards,
>> Sergek
>>
>>
>> On 20 Sep 2017, at 13:15, Vlad Dumitrescu <> wrote:
>>
>> Hi Joe,
>> I got it started by adding the erts-9.0/bin directory and editing the 
>> bin/erl.ini file with the right path. Am trying to trim more, but my 
>> PC is acting weird.
>> Regards,
>> Vlad
>>
>>
>> On 20 Sep 2017 12:22, "Joe Armstrong" <> wrote:
>>>
>>> Hello,
>>>
>>> I want to ship Erlang as a component inside a larger application to 
>>> run on Windows
>>>
>>> Assuming the larger application has reserved space for Erlang at 
>>> some destination directory $DEST then I need to copy a subset of the 
>>> files from a standard distribution into $DEST.
>>>
>>> On a Mac I have reduced the number of necessary files to 11 (could 
>>> be 10 if you remove start.script)
>>>
>>> ├── COPYRIGHT
>>> ├── bin
>>> │   ├── beam.smp
>>> │   ├── erl_child_setup
>>> │   ├── erlexec
>>> │   ├── start.boot
>>> │   └── start.script
>>> ├── erl
>>> └── lib
>>>     ├── compiler-7.0.2.ez
>>>     ├── kernel-5.1.ez
>>>     ├── sasl-3.0.1.ez
>>>     └── stdlib-3.1.ez
>>>
>>> I've thrown away all the libraries apart from compiler etc.
>>>
>>> I'm trying (unsuccessfully) to do the same thing on windows - does 
>>> anybody know how to make a minimal Erlang for windows? - which files 
>>> must be copied and which files must be patched????
>>>
>>> As an afterthought - it would be *very nice* to have a program which 
>>> makes a minimal distributable program for Windows/Mac/Linux.
>>>
>>> I was thinking along the lines of running the program twice - in run 
>>> one I'd trace all calls to discover which modules were actually 
>>> called, then from this information build a minimal distributable program.
>>>
>>> Cheers
>>>
>>> /Joe
>>> _______________________________________________
>>> erlang-questions mailing list
>>> 
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>> _______________________________________________
>> erlang-questions mailing list
>> 
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
_______________________________________________
erlang-questions mailing list

http://erlang.org/mailman/listinfo/erlang-questions


More information about the erlang-questions mailing list