Skip to content
Newer
Older
100644 768 lines (560 sloc) 28.8 KB
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
1 Building and Installing Erlang/OTP
2 ==================================
3
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
4 Introduction
5 ------------
6
7 This document describes how to build and install Erlang/OTP-%OTP-REL%. You
8 are advised to read the whole document before attempting to build and install
9 Erlang/OTP. You can find more information about Open Source Erlang/OTP at:
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
10
11 <http://www.erlang.org/>
12
13 The source code for Erlang/OTP can also be found in a Git repository:
14
15 <http://github.com/erlang/otp>
16
17 Erlang/OTP should be possible to build from source on any Unix system,
18 including Mac OS X. This document describes how to native compile Erlang/OTP
19 on Unix. For detailed instructions on how to
20
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
21 * cross compile Erlang/OTP, see the [$ERL_TOP/INSTALL-CROSS.md][]
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
22 document.
23
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
24 * build Erlang/OTP on Windows, see the [$ERL_TOP/INSTALL-WIN32.md][]
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
25 document.
26
27 Binary releases for Windows can be found at
28 <http://www.erlang.org/download.html>.
29
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
30 Before reading the above mensioned documents you are in any case advised to
31 read this document first, since it covers building Erlang/OTP in general as
32 well as other important information.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
33
34 Daily Build and Test
35 --------------------
36 At Ericsson we have a "Daily Build and Test" that runs on:
37
38 * Solaris 8, 9
39 * Sparc32
40 * Sparc64
41 * Solaris 10
42 * Sparc32
43 * Sparc64
44 * x86
45 * SuSE Linux/GNU 9.4, 10.1
46 * x86
47 * SuSE Linux/GNU 10.0, 10.1
48 * x86
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
49 * x86\_64
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
50 * SuSE Linux/GNU 11.0
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
51 * x86\_64
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
52 * Gentoo Linux/GNU 1.12.11.1
53 * x86
54 * MontaVista Linux/GNU 4.0.1
55 * PowerPC
56 * FreeBSD 7.1
57 * x86
58 * Mac OS X 10.4.11 (Tiger), 10.5.8 (Leopard), 10.6.0 (Snow Leopard)
59 * x86
60 * Windows XP SP3, 2003, Vista, 7
61 * x86
62
63 We also have the following "Daily Cross Builds":
64
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
65 * SuSE Linux/GNU 10.1 x86 -> SuSE Linux/GNU 10.1 x86\_64
66 * SuSE Linux/GNU 10.1 x86\_64 -> Linux/GNU TILEPro64
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
67
68 and the following "Daily Cross Build Tests":
69
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
70 * SuSE Linux/GNU 10.1 x86\_64
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
71
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
72 Versions Known NOT to Work
73 --------------------------
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
74
75 * Suse linux 9.1 is shipped with a patched GCC version 3.3.3, having the
76 rpm named `gcc-3.3.3-41`. That version has a serious optimization bug
77 that makes it unusable for building the Erlang emulator. Please
78 upgrade GCC to a newer version before building on Suse 9.1. Suse Linux
79 Enterprise edition 9 (SLES9) has `gcc-3.3.3-43` and is not affected.
80
81 * `gcc-4.3.0` has a serious optimizer bug. It produces an Erlang emulator
82 that will crash immediately. The bug is supposed to be fixed in
83 `gcc-4.3.1`.
84
85 * FreeBSD had a bug which caused `kqueue`/`poll`/`select` to fail to detect
86 that a `writev()` on a pipe has been made. This bug should have been fixed
87 in FreeBSD 6.3 and FreeBSD 7.0. NetBSD and DragonFlyBSD probably have or
88 have had the same bug. More information can be found at:
89
90 * <http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c>
91 * <http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html>
92
93 * `getcwd()` on Solaris 9 can cause an emulator crash. If you have
94 async-threads enabled you can increase the stack size of the
95 async-threads as a temporary workaround. See the `+a` command-line
96 argument in the documentation of `erl(1)`. Without async-threads the
97 emulator is not as vulnerable to this bug, but if you hit it without
98 async-threads the only workaround available is to enable async-threads
99 and increase the stack size of the async-threads. Sun has however
100 released patches that fixes the issue:
101
102 > Problem Description: 6448300 large mnttab can cause stack overrun
103 > during Solaris 9 getcwd
104
105 More information can be found at:
106
107 * <http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-40-1&searchclause=6448300>
108 * <http://sunsolve.sun.com/search/document.do?assetkey=1-21-114432-29-1&searchclause=6448300>
109
110 Required Utilities
111 ------------------
112
113 These are the tools you will need in order to unpack and build Erlang/OTP.
114
115 ### Unpacking ###
116
117 * GNU unzip, or a modern uncompress.
118 * A TAR program that understands the GNU TAR format for long filenames
119 (such as GNU TAR).
120
121 ### Building ###
122
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
123 * GNU `make`
124 * `gcc` -- GNU C compiler
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
125 * Perl 5
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
126 * GNU `m4` -- If HiPE (native code) support is enabled. HiPE can be
127 disabled using `--disable-hipe`
128 * `ncurses`, `termcap`, or `termlib` -- The development headers and
129 libraries are needed, often known as `ncurses-devel`. Use
130 `--without-termcap` to build without any of these libraries. Note that
131 in this case only the old shell (without any line editing) can be used.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
132 * OpenSSL -- Optional, but needed for building the Erlang/OTP applications
133 `ssl` and `crypto`. You need the "development package" of OpenSSL, i.e.
134 including the header files. For building the application `ssl` the OpenSSL
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
135 binary command program `openssl` is also needed. At least version 0.9.7
136 of OpenSSL is required. Can be downloaded from <http://www.openssl.org>.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
137 * Sun Java jdk-1.5.0 or higher -- Optional but needed for building the
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
138 Erlang/OTP application `jinterface` and parts of `ic` and `orber`. Can
139 be downloaded from <http://java.sun.com>. We have also tested IBM's
140 JDK 1.5.0.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
141 * X Windows -- Optional, but development headers and libraries are needed
142 to build the Erlang/OTP application `gs` on Unix/Linux.
143 * `sed` -- There seem to be some problems with some of the `sed` version on
144 Solaris. Make sure `/bin/sed` or `/usr/bin/sed` is used on the Solaris
145 platform.
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
146 * `flex` -- Optional, headers and libraries are needed to build the `flex`
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
147 scanner for the `megaco` application on Unix/Linux.
148
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
149 #### Building Documentation ####
150
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
151 * `xsltproc` -- XSLT processor. A tool for applying XSLT stylesheets
152 to XML documents. Can be downloaded from
153 <http://xmlsoft.org/XSLT/xsltproc2.html>.
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
154 * `fop` -- Apache FOP print formatter (requires Java). Can be downloaded
155 from <http://xmlgraphics.apache.org/fop>.
156
157 #### Building in Git ####
158
159 * GNU `autoconf` of at least version 2.59. Note that `autoconf` is not
160 needed when building an unmodified version of the released source.
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
161
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
162 ### Installing ###
163
164 * An `install` program that can take multiple file names.
165
166 How to Build and Install Erlang/OTP
167 -----------------------------------
168
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
169 The following instructions are for building [the released source tar ball][].
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
170
171 The variable `$ERL_TOP` will be mentioned a lot of times. It refers to
172 the top directory in the source tree. More information about `$ERL_TOP`
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
173 can be found in the [make and $ERL_TOP][] section below. If you are
174 building in git you probably want to take a look at the [Building in Git][]
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
175 section below before proceeding.
176
177 ### Unpacking ###
178
179 Step 1: Start by unpacking the Erlang/OTP distribution file with your GNU
180 compatible TAR program.
181
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
182 $ gunzip -c otp_src_%OTP-REL%.tar.gz | tar xf -
183
184 alternatively:
185
186 $ zcat otp_src_%OTP-REL%.tar.gz | tar xf -
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
187
188
189 Step 2: Now cd into the base directory (`$ERL_TOP`).
190
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
191 $ cd otp_src_%OTP-REL%
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
192
193 ### Configuring ###
194
195 Step 3: On some platforms Perl may behave strangely if certain locales are
196 set, so optionally you may need to set the LANG variable:
197
198 # Bourne shell
199 $ LANG=C; export LANG
200
201 or
202
203 # C-Shell
204 $ setenv LANG C
205
206 Step 4: Run the following commands to configure the build:
207
208 $ ./configure [ options ]
209
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
210 By default, Erlang/OTP will be installed in `/usr/local/{bin,lib/erlang}`.
211 To instead install in `<BaseDir>/{bin,lib/erlang}`, use the
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
212 `--prefix=<BaseDir>` option.
213
214 If you upgraded the source with some patch you may need to clean up
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
215 from previous builds before the new build. Before doing a `make clean`,
216 be sure to read the [Pre-built Source Release][] section below.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
217
218 ### Building ###
219
220 Step 5: Build the Erlang/OTP package.
221
222 $ make
223
224 ### Installing ###
225
226 Step 6: Install then Erlang/OTP package
227
228 $ make install
229
230 ### A Closer Look at the individual Steps ###
231
232 Let us go through them in some detail.
233
234 #### Configuring ####
235
236 Step 4 runs a configuration script created by the GNU autoconf utility, which
237 checks for system specific features and then creates a number of makefiles.
238
239 The configure script allows you to customize a number of parameters;
240 type `./configure --help` or `./configure --help=recursive` for details.
241 `./configure --help=recursive` will give help for all `configure` scripts in
242 all applications.
243
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
244 One of the things you can specify is where Erlang/OTP should be installed. By
245 default Erlang/OTP will be installed in `/usr/local/{bin,lib/erlang}`.
246 To keep the same structure but install in a different place, `<Dir>` say,
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
247 use the `--prefix` argument like this: `./configure --prefix=<Dir>`.
248
249 Some of the available `configure` options are:
250
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
251 * `--prefix=PATH` - Specify installation prefix.
252 * `--{enable,disable}-threads` - Thread support (enabled by default if
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
253 possible)
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
254 * `--{enable,disable}-smp-support` - SMP support (enabled by default if
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
255 possible)
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
256 * `--{enable,disable}-kernel-poll` - Kernel poll support (enabled by
257 default if possible)
258 * `--{enable,disable}-hipe` - HiPE support (enabled by default on supported
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
259 platforms)
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
260 * `--enable-darwin-universal` - Build universal binaries on darwin i386.
261 * `--enable-darwin-64bit` - Build 64-bit binaries on darwin
262 * `--enable-m64-build` - Build 64-bit binaries using the `-m64` flag to
263 `(g)cc`
264 * `--enable-m32-build` - Build 32-bit binaries using the `-m32` flag to
265 `(g)cc`
266 * `--{with,without}-termcap` - termcap (without implies that only the old
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
267 Erlang shell can be used)
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
268 * `--with-javac=JAVAC` - Specify Java compiler to use
269 * `--{with,without}-javac` - Java compiler (without implies that the
270 `jinterface` application won't be built)
271 * `--{enable,disable}-dynamic-ssl-lib` - Dynamic OpenSSL libraries
272 * `--{enable,disable}-shared-zlib` - Shared zlib library
273 * `--with-ssl=PATH` - Specify location of OpenSSL include and lib
274 * `--{with,without}-ssl` - OpenSSL (without implies that the `crypto`,
275 `ssh`, and `ssl` won't be built)
300b419 @rickard-green Rewrite ethread library
rickard-green authored Jun 17, 2010
276 * `--enable-ethread-pre-pentium4-compatibility` - Enable compatibility with
277 x86 processors before pentium 4 (back to 486) in the ethread library. If
278 not passed the ethread library (part of the runtime system) will use
279 instructions that first appeared on the pentium 4 processor when building
3af1a24 @rickard-green Add pre pentium 4 compatibilty configure test
rickard-green authored Sep 21, 2010
280 for x86. This option will be automatically enabled if required on the
281 build machine.
300b419 @rickard-green Rewrite ethread library
rickard-green authored Jun 17, 2010
282 * `--with-libatomic_ops=PATH` - Use the `libatomic_ops` library for atomic
283 memory accesses. If `configure` should inform you about no native atomic
284 implementation available, you typically want to try using the
285 `libatomic_ops` library. It can be downloaded from
286 <http://www.hpl.hp.com/research/linux/atomic_ops/>.
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
287
288 If you or your system has special requirements please read the `Makefile` for
289 additional configuration information.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
290
291 #### Building ####
292
293 Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
294 5 minutes. After completion of this step, you should have a working
295 Erlang/OTP system which you can try by typing `bin/erl`. This should start
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
296 up Erlang/OTP and give you a prompt:
297
298 $ bin/erl
299 Erlang %OTP-REL% (erts-%ERTS-VSN%) [source] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]
300
301 Eshell V%ERTS-VSN% (abort with ^G)
302 1> _
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
303
304 #### Installing ####
305
306 Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
307 change your mind about where you wish to install you can rerun step 4,
308 without having to do step 5 again).
309
310 ##### Alternative Installation Procedures #####
311
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
312 * Staged install using [DESTDIR][]. You can perform the install
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
313 phase in a temporary directory and later move the installation into
314 its correct location by use of the `DESTDIR` variable:
315
316 $ make DESTDIR=<tmp install dir> install
317
318 The installation will be created in a location prefixed by `$DESTDIR`.
319 It can, however, not be run from there. It needs to be moved into the
320 correct location before it can be run. If `DESTDIR` have not been set
321 but `INSTALL_PREFIX` has been set, `DESTDIR` will be set to
322 `INSTALL_PREFIX`. Note that `INSTALL_PREFIX` in pre R13B04 was buggy
323 and behaved as `EXTRA_PREFIX` (see below). There are lots of areas of
324 use for an installation procedure using `DESTDIR`, e.g. when creating
325 a package, cross compiling, etc. Here is an example where the
326 installation should be located under `/opt/local`:
327
328 $ ./configure --prefix=/opt/local
329 $ make
330 $ make DESTDIR=/tmp/erlang-build install
331 $ cd /tmp/erlang-build/opt/local
332 $ # gnu-tar is used in this example
333 $ tar -zcf /home/me/my-erlang-build.tgz *
334 $ su -
335 Password: *****
336 $ cd /opt/local
337 $ tar -zxf /home/me/my-erlang-build.tgz
338
339 * Install using the `release` target. Instead of doing `make install` you
340 can create the installation in whatever directory you like using the
341 `release` target and run the `Install` script yourself. `RELEASE_ROOT`
342 is used for specifying the directory where the installation should be
343 created. This is what by default ends up under `/usr/local/lib/erlang`
344 if you do the install using `make install`. All installation paths
345 provided in the `configure` phase are ignored, as well as `DESTDIR`,
346 and `INSTALL_PREFIX`. If you want links from a specific `bin` directory
347 to the installation you have to set those up yourself. An example where
348 Erlang/OTP should be located at `/home/me/OTP`:
349
350 $ ./configure
351 $ make
352 $ make RELEASE_ROOT=/home/me/OTP release
353 $ cd /home/me/OTP
354 $ ./Install -minimal /home/me/OTP
355 $ mkdir -p /home/me/bin
356 $ cd /home/me/bin
357 $ ln -s /home/me/OTP/bin/erl erl
358 $ ln -s /home/me/OTP/bin/erlc erlc
359 $ ln -s /home/me/OTP/bin/escript escript
360 ...
361
362 The `Install` script should currently be invoked as follows in the
363 directory where it resides (the top directory):
364
365 $ ./Install [-cross] [-minimal|-sasl] <ERL_ROOT>
366
367 where:
368
369 * `-minimal` Creates an installation that starts up a minimal amount
370 of applications, i.e., only `kernel` and `stdlib` are started. The
371 minimal system is normally enough, and is what `make install` uses.
372 * `-sasl` Creates an installation that also starts up the `sasl`
373 application.
374 * `-cross` For cross compilation. Informs the install script that it
375 is run on the build machine.
376 * `<ERL_ROOT>` - The absolute path to the Erlang installation to use
377 at run time. This is often the same as the current working directory,
378 but does not have to be. It can follow any other path through the
379 file system to the same directory.
380
381 If neither `-minimal`, nor `-sasl` is passed as argument you will be
382 prompted.
383
384 * Test install using `EXTRA_PREFIX`. The content of the `EXTRA_PREFIX`
385 variable will prefix all installation paths when doing `make install`.
386 Note that `EXTRA_PREFIX` is similar to `DESTDIR`, but it does *not* have
387 the same effect as `DESTDIR`. The installation can and have to be run
388 from the location specified by `EXTRA_PREFIX`. That is, it can be useful
389 if you want to try the system out, running test suites, etc, before doing
390 the real install without `EXTRA_PREFIX`.
391
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
392 ### Symbolic Links in --bindir ###
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
393
394 When doing `make install` and the default installation prefix is used,
395 relative symbolic links will be created from `/usr/local/bin` to all public
396 Erlang/OTP executables in `/usr/local/lib/erlang/bin`. The installation phase
397 will try to create relative symbolic links as long as `--bindir` and the
398 Erlang bin directory, located under `--libdir`, both have `--exec-prefix` as
399 prefix. Where `--exec-prefix` defaults to `--prefix`. `--prefix`,
400 `--exec-prefix`, `--bindir`, and `--libdir` are all arguments that can be
401 passed to `configure`. One can force relative, or absolute links by passing
402 `BINDIR_SYMLINKS=relative|absolute` as arguments to `make` during the install
403 phase. Note that such a request might cause a failure if the request cannot
404 be satisfied.
405
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
406 ### Pre-built Source Release ###
407
408 The source release is delivered with a lot of platform independent
409 build results already pre-built. If you want to remove these pre-built
410 files, invoke `./otp_build remove_prebuilt_files` from the `$ERL_TOP`
411 directory. After you have done this, you can build exactly the same way
412 as before, but the build process will take a much longer time.
413
414 > *WARNING*: Doing `make clean` in an arbitrary directory of the source
415 > tree, may remove files needed for bootstrapping the build.
416 >
417 > Doing `./otp_build save_bootstrap` from the `$ERL_TOP` directory before
418 > doing `make clean` will ensure that it will be possible to build after
419 > doing `make clean`. `./otp_build save_bootstrap` will be invoked
420 > automatically when `make` is invoked from `$ERL_TOP` with either the
421 > `clean` target, or the default target. It is also automatically invoked
422 > if `./otp_build remove_prebuilt_files` is invoked.
423
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
424 ### Building in Git ###
425
426 When building in a Git working directory you also have to have a GNU `autoconf`
e011c1a @roques Trivial documentation fixes
roques authored Aug 8, 2011
427 of at least version 2.59 on your system, because you need to generate the
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
428 `configure` scripts before you can start building.
429
430 The `configure` scripts are generated by invoking `./otp_build autoconf` in
431 the `$ERL_TOP` directory. The `configure` scripts also have to be regenerated
432 when a `configure.in` or `aclocal.m4` file has been modified. Note that when
433 checking out a branch a `configure.in` or `aclocal.m4` file may change
434 content, and you may therefore have to regenerate the `configure` scripts
435 when checking out a branch. Regenerated `configure` scripts imply that you
436 have to run `configure` and build again.
437
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
438 > *NOTE*: Running `./otp_build autoconf` is **not** needed when building
e011c1a @roques Trivial documentation fixes
roques authored Aug 8, 2011
439 > an unmodified version of the released source.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
440
441 Other useful information can be found at our github wiki:
442 <http://wiki.github.com/erlang/otp>
443
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
444 ### make and $ERL\_TOP ###
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
445
446 All the makefiles in the entire directory tree use the environment
447 variable `ERL_TOP` to find the absolute path of the installation. The
448 `configure` script will figure this out and set it in the top level
449 Makefile (which, when building, it will pass on). However, when
450 developing it is sometimes convenient to be able to run make in a
451 subdirectory. To do this you must set the `ERL_TOP` variable
452 before you run make.
453
454 For example, assume your GNU make program is called `make` and you
455 want to rebuild the application `STDLIB`, then you could do:
456
457 $ cd lib/stdlib; env ERL_TOP=<Dir> make
458
459 where `<Dir>` would be what you find `ERL_TOP` is set to in the top level
460 Makefile.
461
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
462 The Erlang/OTP Documentation
463 ----------------------------
464
465 ### How to Build the Documentation ###
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
466
467 $ cd $ERL_TOP
468
469 If you have just built Erlang/OTP in the current source tree, you have
470 already ran `configure` and do not need to do this again; otherwise, run
471 `configure`.
472
473 $ ./configure [Configure Args]
474
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
475 When building the documentation you need a full Erlang/OTP-%OTP-REL% system in
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
476 the `$PATH`.
477
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
478 $ export PATH=<Erlang/OTP-%OTP-REL% bin dir>:$PATH # Assuming bash/sh
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
479
480 Build the documentation.
481
482 $ make docs
483
484 The documentation can be installed either using the `install-docs` target,
485 or using the `release_docs` target.
486
487 * If you have installed Erlang/OTP using the `install` target, install
488 the documentation using the `install-docs` target. Install locations
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
489 determined by `configure` will be used. `$DESTDIR` can be used the
490 same way as when doing `make install`.
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
491
492 $ make install-docs
493
494 * If you have installed Erlang/OTP using the `release` target, install
495 the documentation using the `release_docs` target. You typically want
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
496 to use the same `RELEASE_ROOT` as when invoking `make release`.
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
497
498 $ make release_docs RELEASE_ROOT=<release dir>
499
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
500 #### Build Issues ####
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
501
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
502 We have sometimes experienced problems with Sun's `java` running out of
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
503 memory when running `fop`. Increasing the amount of memory available
504 as follows has in our case solved the problem.
505
506 $ export FOP_OPTS="-Xmx<Installed amount of RAM in MB>m"
507
508 More information can be found at
509 <http://xmlgraphics.apache.org/fop/0.95/running.html#memory>.
510
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
511 ### How to Install the Pre-formatted Documentation ###
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
512
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
513 Pre-formatted [html documentation][] and [man pages][] can be downloaded at
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
514 <http://www.erlang.org/download.html>.
515
516 For some graphical tools to find the on-line help you have to install
517 the HTML documentation on top of the installed OTP applications, i.e.
518
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
519 $ cd <ReleaseDir>
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
520 $ gunzip -c otp_html_%OTP-REL%.tar.gz | tar xf -
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
521
522 For `erl -man <page>` to work the Unix manual pages have to be
523 installed in the same way, i.e.
524
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
525 $ cd <ReleaseDir>
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
526 $ gunzip -c otp_man_%OTP-REL%.tar.gz | tar xf -
4085125 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
527
3fdc76b @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 18, 2010
528 Where `<ReleaseDir>` is
529
530 * `<PrefixDir>/lib/erlang` if you have installed Erlang/OTP using
531 `make install`.
532 * `$DESTDIR<PrefixDir>/lib/erlang` if you have installed Erlang/OTP
533 using `make install DESTDIR=<TmpInstallDir>`.
534 * `RELEASE_ROOT` if you have installed using
535 `make release RELEASE_ROOT=<ReleaseDir>`.
536
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
537 Support for SMP (Symmetric Multi Processing)
538 --------------------------------------------
539
540 An emulator with SMP support will be built by default on most platforms
541 if a usable POSIX thread library or native Windows threads is found.
542
543 You can force building of an SMP emulator, by using
544 `./configure --enable-smp-support`. However, if configure does not
545 automatically enable SMP support, the build is very likely to fail.
546
547 Use `./configure --disable-smp-support` if you for some reason do not
548 want to have the emulator with SMP support built.
549
550 If SMP support is enabled, support for threaded I/O will also be turned on
551 (also in the emulator without SMP support).
552
553 The `erl` command will automatically start the SMP emulator if the
554 computer has more than one logical processor. You can force a start
555 of the emulator with SMP support by passing `-smp enable` as
556 command line arguments to erl, and you can force a start of the
557 emulator without SMP support by passing `-smp disable`.
558
559 GS (Graphic System)
560 -------------------
561
562 GS now Tcl/Tk 8.4. It will be searched for when starting GS.
563
564 Using HiPE
565 ----------
566
567 HiPE supports the following system configurations:
568
569 * x86: All 32-bit and 64-bit mode processors should work.
570
571 * Linux: Fedora Core is supported. Both 32-bit and 64-bit modes are
572 supported.
573
574 NPTL glibc is strongly preferred, or a LinuxThreads
575 glibc configured for "floating stacks". Old non-floating
576 stacks glibcs have a fundamental problem that makes HiPE
577 support and threads support mutually exclusive.
578
579 * Solaris: Solaris 10 (32-bit and 64-bit) and 9 (32-bit) are supported.
580 The build requires a version of the GNU C compiler (gcc)
581 that has been configured to use the GNU assembler (gas).
582 Sun's x86 assembler is emphatically **not** supported.
583
584 * FreeBSD: FreeBSD 6.1 and 6.2 in 32-bit and 64-bit modes should work.
585
586 * MacOSX/Darwin: Darwin 9.8.0 in 32-bit mode should work.
587
588 * PowerPC: All 32-bit 6xx/7xx(G3)/74xx(G4) processors should work. 32-bit
589 mode on 970 (G5) and POWER5 processors should work.
590
591 * Linux (Yellow Dog) and Mac OSX 10.4 are supported.
592
593 * SPARC: All UltraSPARC processors running 32-bit user code should work.
594
595 * Solaris 9 is supported. The build requires a `gcc` that has been
596 configured to use Sun's assembler and linker. Using the GNU assembler
597 but Sun's linker has been known to cause problems.
598
599 * Linux (Aurora) is supported.
600
601 * ARM: ARMv5TE (i.e. XScale) processors should work. Both big-endian and
602 little-endian modes are supported.
603
604 * Linux is supported.
605
606 HiPE is automatically enabled on the following systems:
607
608 * x86 in 32-bit mode: Linux, Solaris, FreeBSD
609 * x86 in 64-bit mode: Linux, Solaris, FreeBSD
610 * PowerPC: Linux, MacOSX
611 * SPARC: Linux
612 * ARM: Linux
613
614 On other supported systems you need to `./configure --enable-hipe`.
615
616 If you are running on a platform supporting HiPE and if you have not disabled
617 HiPE, you can compile a module into native code like this from the Erlang
618 shell:
619
620 1> c(Module, native).
621
622 or
623
624 1> c(Module, [native|OtherOptions]).
625
626 Using the erlc program, write like this:
627
628 $ erlc +native Module.erl
629
630 The native code will be placed into the beam file and automatically loaded
631 when the beam file is loaded.
632
633 To add hipe options, write like this from the Erlang shell:
634
635 1> c(Module, [native,{hipe,HipeOptions}|MoreOptions]).
636
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
637 Use `hipe:help_options/0` to print out the available options.
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
638
639 1> hipe:help_options().
640
641 Mac OS X (Darwin)
642 -----------------
643
644 We test Mac OS X 10.4.11 (Tiger) and Mac OS X 10.5.x (Leopard) in our daily
645 builds (but only on Intel processors).
646
647 Make sure that the command `hostname` returns a valid fully qualified host
648 name (this is configured in `/etc/hostconfig`).
649
650 If you develop linked-in drivers (shared library) you need to link using
651 `gcc` and the flags `-bundle -flat_namespace -undefined suppress`. You also
652 include `-fno-common` in `CFLAGS` when compiling. Use `.so` as the library
653 suffix.
654
655 Universal 32bit binaries can be built on an Intel Mac using the
656 `--enable-darwin-universal` configure option. There still may occur
657 problems with certain applications using this option, but the base
658 system should run smoothly.
659
660 When building universal binaries on a PowerPC Mac (at least on Tiger),
661 you must point out a suitable SDK that contains universal binaries.
662 For instance, to build universal binaries for Tiger (10.4):
663
664 $ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
665 LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
666 ./configure --enable-darwin-universal
667
668 Also, if you run Leopard, but want to build for Tiger, you must do by
669 setting the `MACOSX_DEPLOYMENT_TARGET` environmental variable.
670
671 $ export MACOSX_DEPLOYMENT_TARGET=10.4
672
673 Experimental support for 64bit x86 darwin binaries can be enabled
674 using the `--enable-darwin-64bit` configure flag. The 64bit binaries are
675 best built and run on Leopard, but most of the system also works on
676 Tiger (Tiger's 64bit libraries are, however, limited; therefore e.g. `odbc`,
677 `crypto`, `ssl` etc. are not supported in Tiger). 64bit PPC binaries are not
678 supported and we have no plans to add such support (no machines to
679 test on).
680
681 Universal binaries and 64bit binaries are mutually exclusive options.
682
683 How to Build a Debug Enabled Erlang RunTime System
684 --------------------------------------------------
685
686 After completing all the normal building steps described above a debug
687 enabled runtime system can be built. To do this you have to change
688 directory to `$ERL_TOP/erts/emulator`.
689
690 In this directory execute:
691
692 $ make debug FLAVOR=$FLAVOR
693
694 where `$FLAVOR` is either `plain` or `smp`. The flavor options will
695 produce a beam.debug and beam.smp.debug executable respectively. The
696 files are installed along side with the normal (opt) versions `beam.smp`
697 and `beam`.
698
699 To start the debug enabled runtime system execute:
700
701 $ $ERL_TOP/bin/cerl -debug
702
703 The debug enabled runtime system features lock violation checking,
704 assert checking and various sanity checks to help a developer ensure
705 correctness. Some of these features can be enabled on a normal beam
706 using appropriate configure options.
707
708 There are other types of runtime systems that can be built as well
709 using the similar steps just described.
710
711 $ make $TYPE FLAVOR=$FLAVOR
712
713 where `$TYPE` is `opt`, `gcov`, `gprof`, `debug`, `valgrind`, or `lcnt`.
714 These different beam types are useful for debugging and profiling
715 purposes.
716
717 Authors
718 -------
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
719
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
720 Authors are mostly listed in the application's `AUTHORS` files,
721 that is `$ERL_TOP/lib/*/AUTHORS` and `$ERL_TOP/erts/AUTHORS`,
722 not in the individual source files.
723
724 Copyright and License
725 ---------------------
726
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
727 %CopyrightBegin%
728
729 Copyright Ericsson AB 1998-2010. All Rights Reserved.
730
731 The contents of this file are subject to the Erlang Public License,
732 Version 1.1, (the "License"); you may not use this file except in
733 compliance with the License. You should have received a copy of the
734 Erlang Public License along with this software. If not, it can be
735 retrieved online at http://www.erlang.org/.
736
737 Software distributed under the License is distributed on an "AS IS"
738 basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
739 the License for the specific language governing rights and limitations
740 under the License.
741
742 %CopyrightEnd%
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
743
744 More Information
745 ----------------
746
747 More information can be found at <http://www.erlang.org>.
748
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
749 Modifying This Document
750 -----------------------
751
752 Before modifying this document you need to have a look at the
753 `$ERL_TOP/README.md.txt` document.
754
755
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
756
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
757 [$ERL_TOP/INSTALL-CROSS.md]: INSTALL-CROSS
758 [$ERL_TOP/INSTALL-WIN32.md]: INSTALL-WIN32
759 [DESTDIR]: http://www.gnu.org/prep/standards/html_node/DESTDIR.html
760 [Building in Git]: #How-to-Build-and-Install-ErlangOTP_Building-in-Git
761 [Pre-built Source Release]: #How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release
762 [make and $ERL_TOP]: #How-to-Build-and-Install-ErlangOTP_make-and-ERLTOP
763 [html documentation]: http://www.erlang.org/download/otp_doc_html_%OTP-REL%.tar.gz
764 [man pages]: http://www.erlang.org/download/otp_doc_man_%OTP-REL%.tar.gz
765 [the released source tar ball]: http://www.erlang.org/download/otp_src_%OTP-REL%.tar.gz
7aa2cb2 @rickard-green OTP-8449 Documentation improvements.
rickard-green authored Feb 16, 2010
766
d041cab @rickard-green OTP-8512 Add Erlangish MarkDown to Erlangish XML support
rickard-green authored Mar 22, 2010
767 [?TOC]: true
Something went wrong with that request. Please try again.