blob: 84211bdbf12b07e647c49ed0fa17491968b270fc [file] [log] [blame]
Christopher Piro094823a2007-07-18 00:26:12 +00001Much more information on these topics can be found at www.erlware.org
2
3
4Building the tree
5=================
6
7To build, type make, it should all work from there.
8
9NOTE** if your system has erlang installed in a directory other than /usr/local/lib/erlang
10then you must set the environment variable ERL_RUN_TOP to that directory. For example
11if you have erlang installed in /home/jdoe/erlang then you should
12export ERL_RUN_TOP=/home/jdoe/erlang
13
14
15Creating a new application
16==========================
17
18A new application can be created by using the appgen utility in otp/tools/utilities.
19This utility will create a basic OTP app framework under the otp/lib directory and
20an OTP release under the otp/release directory.
21
22usage: appgen <appname> <prefix>
23
24Appname is the name of the application that you would like to create. The prefix is
25usually the first letter of each word in the appname. This prefix is to avoid name
26clashes between applications included in a release (Erlang does not have packages).
27
28example usage: appgen my_app ma
29
30which results in
31
32otp/lib/my_app & otp/release/my_app_rel
33
34Running a release
35=================
36
37Your release should contain all that you need to run your application. If your application
38depends on any applications that are supplied outside of this build tree or OTP itself then
39they may be added to the <appname>_rel.rel.src file. If the extra applications are present
40in this build tree then they will be found by the make process and included in the final
41release.
42
43To run a release there are two options: "local" and installed. The local version can be found
44in the otp/release/<appname>_rel/local directory which is added by the make process. This
45should be used during development to run your release interactively via an Erlang shell.
46To run a release in local mode cd into the "local" directory and run <appname>_rel.sh.
47
48The second way to run a release is to install it and run it as a daemon. This is used for
49applications in a production setting. To do this you need to first run make & make install
50from the <appname>_rel directory. This will place a complete production ready versioned
51release in the /usr/local/lib/ directory under <appname>_rel. To run an installed release
52cd to /usr/local/lib/<appname>_rel/release/<rel_vsn> and run <appname>_rel.sh.
53
54In the case where you want to create a production ready release on one machine and then deploy it
55on multiple identical machines you may create a production tar archive. To do this run
56make & make tar from the otp/release/<appname>_rel/ directory. This will create a tar file conataining
57the release name and version number in the file name. This tar can be shipped to its destination and
58untarred. Within the untarred directory there is a shell script entitled install.sh. Running this
59script will install the release by default in /usr/local/lib/<appname>_rel. An optional argument
60can be provided that will direct the installation to a different directory.
61
62Example install.sh /opt/lib
63
64This will install the release in /opt/lib/<appname>_rel
65
66
67
68