Skip to content

HTTPS clone URL

Subversion checkout URL

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