Sophie

Sophie

distrib > Fedora > 17 > i386 > media > updates > by-pkgid > 675c8c8167236dfcf8d66da674f931e8 > files > 75

erlang-doc-R15B-03.3.fc17.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns:fn="http://www.w3.org/2005/02/xpath-functions">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../otp_doc.css" type="text/css">
<title>Erlang -- Building and Installing Erlang/OTP</title>
</head>
<body bgcolor="white" text="#000000" link="#0000ff" vlink="#ff00ff" alink="#ff0000"><div id="container">
<script id="js" type="text/javascript" language="JavaScript" src="../js/flipmenu/flipmenu.js"></script><script id="js2" type="text/javascript" src="../js/erlresolvelinks.js"></script><script language="JavaScript" type="text/javascript">
            <!--
              function getWinHeight() {
                var myHeight = 0;
                if( typeof( window.innerHeight ) == 'number' ) {
                  //Non-IE
                  myHeight = window.innerHeight;
                } else if( document.documentElement && ( document.documentElement.clientWidth ||
                                                         document.documentElement.clientHeight ) ) {
                  //IE 6+ in 'standards compliant mode'
                  myHeight = document.documentElement.clientHeight;
                } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                  //IE 4 compatible
                  myHeight = document.body.clientHeight;
                }
                return myHeight;
              }

              function setscrollpos() {
                var objf=document.getElementById('loadscrollpos');
                 document.getElementById("leftnav").scrollTop = objf.offsetTop - getWinHeight()/2;
              }

              function addEvent(obj, evType, fn){
                if (obj.addEventListener){
                obj.addEventListener(evType, fn, true);
                return true;
              } else if (obj.attachEvent){
                var r = obj.attachEvent("on"+evType, fn);
                return r;
              } else {
                return false;
              }
             }

             addEvent(window, 'load', setscrollpos);

             //--></script><div id="leftnav"><div class="innertube">
<img alt="Erlang logo" src="../erlang-logo.png"><br><small><a href="users_guide.html">User's Guide</a><br><a href="../pdf/otp-system-documentation-5.9.3.1.pdf">PDF</a><br><a href="../index.html">Top</a></small><p><strong>Installation Guide</strong><br><strong>User's Guide</strong><br><small>Version 5.9.3.1</small></p>
<br><a href="javascript:openAllFlips()">Expand All</a><br><a href="javascript:closeAllFlips()">Contract All</a><p><small><strong>Chapters</strong></small></p>
<ul class="flipMenu" imagepath="../js/flipmenu">
<li id="no" title="Installing the Binary Release" expanded="false">Installing the Binary Release<ul>
<li><a href="install-binary.html">
              Top of chapter
            </a></li>
<li title="UNIX"><a href="install-binary.html#id60773">UNIX</a></li>
<li title="Windows"><a href="install-binary.html#id61148">Windows</a></li>
</ul>
</li>
<li id="no" title="Installation Verification" expanded="false">Installation Verification<ul>
<li><a href="verification.html">
              Top of chapter
            </a></li>
<li title="UNIX"><a href="verification.html#id56990">UNIX</a></li>
<li title="Windows"><a href="verification.html#id63124">Windows</a></li>
</ul>
</li>
<li id="loadscrollpos" title="Building and Installing Erlang/OTP" expanded="true">Building and Installing Erlang/OTP<ul>
<li><a href="INSTALL.html">
              Top of chapter
            </a></li>
<li title="Introduction"><a href="INSTALL.html#id69303">Introduction</a></li>
<li title="Daily Build and Test"><a href="INSTALL.html#id69396">Daily Build and Test</a></li>
<li title="Versions Known NOT to Work"><a href="INSTALL.html#id61560">Versions Known NOT to Work</a></li>
<li title="Required Utilities"><a href="INSTALL.html#id62849">Required Utilities</a></li>
<li title="How to Build and Install Erlang/OTP"><a href="INSTALL.html#id57371">How to Build and Install Erlang/OTP</a></li>
<li title="The Erlang/OTP Documentation"><a href="INSTALL.html#id62172">The Erlang/OTP Documentation</a></li>
<li title="Support for SMP (Symmetric Multi Processing)"><a href="INSTALL.html#id62469">Support for SMP (Symmetric Multi Processing)</a></li>
<li title="GS (Graphic System)"><a href="INSTALL.html#id71231">GS (Graphic System)</a></li>
<li title="Using HiPE"><a href="INSTALL.html#id71248">Using HiPE</a></li>
<li title="Mac OS X (Darwin)"><a href="INSTALL.html#id71477">Mac OS X (Darwin)</a></li>
<li title="Building universal binaries on Mac OS X (obsolete information)"><a href="INSTALL.html#id71532">Building universal binaries on Mac OS X (obsolete information)</a></li>
<li title="Building a fast Erlang VM on Mac OS Lion"><a href="INSTALL.html#id71611">Building a fast Erlang VM on Mac OS Lion</a></li>
<li title="How to Build a Debug Enabled Erlang RunTime System"><a href="INSTALL.html#id71820">How to Build a Debug Enabled Erlang RunTime System</a></li>
<li title="Authors"><a href="INSTALL.html#id71932">Authors</a></li>
<li title="Copyright and License"><a href="INSTALL.html#id71959">Copyright and License</a></li>
<li title="More Information"><a href="INSTALL.html#id71987">More Information</a></li>
<li title="Modifying This Document"><a href="INSTALL.html#id72009">Modifying This Document</a></li>
</ul>
</li>
<li id="no" title="Cross Compiling Erlang/OTP" expanded="false">Cross Compiling Erlang/OTP<ul>
<li><a href="INSTALL-CROSS.html">
              Top of chapter
            </a></li>
<li title="Introduction"><a href="INSTALL-CROSS.html#id72357">Introduction</a></li>
<li title="Build and Install Procedure"><a href="INSTALL-CROSS.html#id72668">Build and Install Procedure</a></li>
<li title="Testing the cross compiled system"><a href="INSTALL-CROSS.html#id73393">Testing the cross compiled system</a></li>
<li title="Currently Used Configuration Variables"><a href="INSTALL-CROSS.html#id73477">Currently Used Configuration Variables</a></li>
<li title="Copyright and License"><a href="INSTALL-CROSS.html#id74530">Copyright and License</a></li>
<li title="Modifying This Document"><a href="INSTALL-CROSS.html#id74558">Modifying This Document</a></li>
</ul>
</li>
<li id="no" title="How to Build Erlang/OTP on Windows" expanded="false">How to Build Erlang/OTP on Windows<ul>
<li><a href="INSTALL-WIN32.html">
              Top of chapter
            </a></li>
<li title="Introduction"><a href="INSTALL-WIN32.html#id74741">Introduction</a></li>
<li title="Frequently Asked Questions"><a href="INSTALL-WIN32.html#id74848">Frequently Asked Questions</a></li>
<li title="Tools you Need and Their Environment"><a href="INSTALL-WIN32.html#id75221">Tools you Need and Their Environment</a></li>
<li title="The Shell Environment"><a href="INSTALL-WIN32.html#id75978">The Shell Environment</a></li>
<li title="Building and Installing"><a href="INSTALL-WIN32.html#id76124">Building and Installing</a></li>
<li title="Development"><a href="INSTALL-WIN32.html#id76424">Development</a></li>
<li title="Using GIT"><a href="INSTALL-WIN32.html#id76667">Using GIT</a></li>
<li title="Final Words"><a href="INSTALL-WIN32.html#id76701">Final Words</a></li>
<li title="Copyright and License"><a href="INSTALL-WIN32.html#id76738">Copyright and License</a></li>
<li title="Modifying This Document"><a href="INSTALL-WIN32.html#id76766">Modifying This Document</a></li>
</ul>
</li>
</ul>
</div></div>
<div id="content">
<div class="innertube">
<h1>3 Building and Installing Erlang/OTP</h1>

<p><strong>Table of Contents</strong></p>
  <ul>
<li>
      <span class="bold_code"><a href="#Introduction">Introduction</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Daily-Build-and-Test">Daily Build and Test</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Versions-Known-NOT-to-Work">Versions Known NOT to Work</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Required-Utilities">Required Utilities</a></span>
    <ul>
<li>
        <span class="bold_code"><a href="#Required-Utilities_Unpacking">Unpacking</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#Required-Utilities_Building">Building</a></span>
      <ul>
<li>
          <span class="bold_code"><a href="#Required-Utilities_Building_Building-Documentation">Building Documentation</a></span>
        </li>
<li>
          <span class="bold_code"><a href="#Required-Utilities_Building_Building-in-Git">Building in Git</a></span>
      </li>
</ul>
      </li>
<li>
        <span class="bold_code"><a href="#Required-Utilities_Installing">Installing</a></span>
    </li>
</ul>
    </li>
<li>
      <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP">How to Build and Install Erlang/OTP</a></span>
    <ul>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Unpacking">Unpacking</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Configuring">Configuring</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Building">Building</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Installing">Installing</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps">A Closer Look at the individual Steps</a></span>
      <ul>
<li>
          <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Configuring">Configuring</a></span>
        </li>
<li>
          <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Building">Building</a></span>
        </li>
<li>
          <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Installing">Installing</a></span>
        <ul><li>
            <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Installing_Alternative-Installation-Procedures">Alternative Installation Procedures</a></span>
        </li></ul>
      </li>
</ul>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Symbolic-Links-in-bindir">Symbolic Links in --bindir</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release">Pre-built Source Release</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Building-in-Git">Building in Git</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_make-and-ERLTOP">make and $ERL_TOP</a></span>
    </li>
</ul>
    </li>
<li>
      <span class="bold_code"><a href="#The-ErlangOTP-Documentation">The Erlang/OTP Documentation</a></span>
    <ul>
<li>
        <span class="bold_code"><a href="#The-ErlangOTP-Documentation_How-to-Build-the-Documentation">How to Build the Documentation</a></span>
      <ul><li>
          <span class="bold_code"><a href="#The-ErlangOTP-Documentation_How-to-Build-the-Documentation_Build-Issues">Build Issues</a></span>
      </li></ul>
      </li>
<li>
        <span class="bold_code"><a href="#The-ErlangOTP-Documentation_How-to-Install-the-Preformatted-Documentation">How to Install the Pre-formatted Documentation</a></span>
    </li>
</ul>
    </li>
<li>
      <span class="bold_code"><a href="#Support-for-SMP-Symmetric-Multi-Processing">Support for SMP (Symmetric Multi Processing)</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#GS-Graphic-System">GS (Graphic System)</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Using-HiPE">Using HiPE</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Mac-OS-X-Darwin">Mac OS X (Darwin)</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Building-universal-binaries-on-Mac-OS-X-obsolete-information">Building universal binaries on Mac OS X (obsolete information)</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Building-a-fast-Erlang-VM-on-Mac-OS-Lion">Building a fast Erlang VM on Mac OS Lion</a></span>
    <ul>
<li>
        <span class="bold_code"><a href="#Building-a-fast-Erlang-VM-on-Mac-OS-Lion_Building-with-wxErlang">Building with wxErlang</a></span>
      </li>
<li>
        <span class="bold_code"><a href="#Building-a-fast-Erlang-VM-on-Mac-OS-Lion_Finish-up">Finish up</a></span>
    </li>
</ul>
    </li>
<li>
      <span class="bold_code"><a href="#How-to-Build-a-Debug-Enabled-Erlang-RunTime-System">How to Build a Debug Enabled Erlang RunTime System</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Authors">Authors</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Copyright-and-License">Copyright and License</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#More-Information">More Information</a></span>
    </li>
<li>
      <span class="bold_code"><a href="#Modifying-This-Document">Modifying This Document</a></span>
  </li>
</ul>

<a name="Introduction"></a>
<h3><a name="id69303">3.1 
        Introduction</a></h3>


<p>
This document describes how to build and install Erlang/OTP-R15B03. You
are advised to read the whole document before attempting to build and install
Erlang/OTP. You can find more information about Open Source Erlang/OTP at:
</p>

<p>
   <span class="bold_code"><a href="http://www.erlang.org/">http://www.erlang.org/</a></span>
</p>

<p>
The source code for Erlang/OTP can also be found in a Git repository:
</p>

<p>
   <span class="bold_code"><a href="http://github.com/erlang/otp">http://github.com/erlang/otp</a></span>
</p>

<p>
Erlang/OTP should be possible to build from source on any Unix system,
including Mac OS X. This document describes how to native compile Erlang/OTP
on Unix. For detailed instructions on how to
</p>

<ul>
<li>
<p>cross compile Erlang/OTP, see the <span class="bold_code"><a href="INSTALL-CROSS.html">$ERL_TOP/INSTALL-CROSS.md</a></span>
document.
</p>

</li>
<li>
<p>build Erlang/OTP on Windows, see the <span class="bold_code"><a href="INSTALL-WIN32.html">$ERL_TOP/INSTALL-WIN32.md</a></span>
document.
</p>

<p>Binary releases for Windows can be found at
<span class="bold_code"><a href="http://www.erlang.org/download.html">http://www.erlang.org/download.html</a></span>.
</p>
</li>
</ul>
<p>
Before reading the above mentioned documents you are in any case advised to
read this document first, since it covers building Erlang/OTP in general as
well as other important information.
</p>



<a name="Daily-Build-and-Test"></a>
<h3><a name="id69396">3.2 
        Daily Build and Test</a></h3>

At Ericsson we have a "Daily Build and Test" that runs on:

<ul>
<li>
Solaris 8, 9

<ul>
<li>
Sparc32

</li>
<li>
Sparc64

</li>
</ul>
</li>
<li>
Solaris 10

<ul>
<li>
Sparc32

</li>
<li>
Sparc64

</li>
<li>
x86

</li>
</ul>
</li>
<li>
SuSE Linux/GNU 9.4, 10.1

<ul><li>
x86

</li></ul>
</li>
<li>
SuSE Linux/GNU 10.0, 10.1, 11.0

<ul>
<li>
x86

</li>
<li>
x86_64

</li>
</ul>
</li>
<li>
openSuSE 11.4 (Celadon)

<ul><li>
x86_64 (valgrind)

</li></ul>
</li>
<li>
Fedora 7

<ul><li>
PowerPC

</li></ul>
</li>
<li>
Fedora 14

<ul><li>
x86_64

</li></ul>
</li>
<li>
Gentoo Linux/GNU 1.12.11.1

<ul><li>
x86

</li></ul>
</li>
<li>
Ubuntu Linux/GNU 7.04, 10.04, 10.10, 11.0

<ul><li>
x86_64

</li></ul>
</li>
<li>
MontaVista Linux/GNU 4.0.1

<ul><li>
PowerPC

</li></ul>
</li>
<li>
FreeBSD 8.2

<ul><li>
x86

</li></ul>
</li>
<li>
OpenBSD 5.0

<ul><li>
x86_64

</li></ul>
</li>
<li>
Mac OS X 10.5.8 (Leopard), 10.6.0 (Snow Leopard), 10.7.3 (Lion)

<ul><li>
x86

</li></ul>
</li>
<li>
Windows XP SP3, 2003, Vista, 7

<ul><li>
x86

</li></ul>
</li>
<li>
Windows 7

<ul><li>
x86_64

</li></ul>
</li>
</ul>
<p>
We also have the following "Daily Cross Builds":
</p>

<ul>
<li>
SuSE Linux/GNU 10.1 x86 -&gt; SuSE Linux/GNU 10.1 x86_64

</li>
<li>
SuSE Linux/GNU 10.1 x86_64 -&gt; Linux/GNU TILEPro64

</li>
</ul>
<p>
and the following "Daily Cross Build Tests":
</p>

<ul><li>
SuSE Linux/GNU 10.1 x86_64

</li></ul>


<a name="Versions-Known-NOT-to-Work"></a>
<h3><a name="id61560">3.3 
        Versions Known NOT to Work</a></h3>


<ul>
<li>
<p>Suse linux 9.1 is shipped with a patched GCC version 3.3.3, having the
rpm named <span class="code">gcc-3.3.3-41</span>. That version has a serious optimization bug
that makes it unusable for building the Erlang emulator. Please
upgrade GCC to a newer version before building on Suse 9.1. Suse Linux
Enterprise edition 9 (SLES9) has <span class="code">gcc-3.3.3-43</span> and is not affected.
</p>

</li>
<li>
<p><span class="code">gcc-4.3.0</span> has a serious optimizer bug. It produces an Erlang emulator
that will crash immediately. The bug is supposed to be fixed in
<span class="code">gcc-4.3.1</span>.
</p>

</li>
<li>
<p>FreeBSD had a bug which caused <span class="code">kqueue</span>/<span class="code">poll</span>/<span class="code">select</span> to fail to detect
that a <span class="code">writev()</span> on a pipe has been made. This bug should have been fixed
in FreeBSD 6.3 and FreeBSD 7.0. NetBSD and DragonFlyBSD probably have or
have had the same bug. More information can be found at:
</p>

<ul>
<li>
<span class="bold_code"><a href="http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c">http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c</a></span>

</li>
<li>
<span class="bold_code"><a href="http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html">http://lists.freebsd.org/pipermail/freebsd-arch/2007-September/006790.html</a></span>


</li>
</ul>
</li>
<li>
<p><span class="code">getcwd()</span> on Solaris 9 can cause an emulator crash. If you have
async-threads enabled you can increase the stack size of the
async-threads as a temporary workaround. See the <span class="code">+a</span> command-line
argument in the documentation of <span class="code">erl(1)</span>. Without async-threads the
emulator is not as vulnerable to this bug, but if you hit it without
async-threads the only workaround available is to enable async-threads
and increase the stack size of the async-threads. Sun has however
released patches that fixes the issue:
</p>


<p>Problem Description: 6448300 large mnttab can cause stack overrun
during Solaris 9 getcwd
</p>


<p>More information can be found at:
</p>

<ul>
<li>
<span class="bold_code"><a href="http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-40-1&amp;searchclause=6448300">http://sunsolve.sun.com/search/document.do?assetkey=1-21-112874-40-1&amp;searchclause=6448300</a></span>

</li>
<li>
<span class="bold_code"><a href="http://sunsolve.sun.com/search/document.do?assetkey=1-21-114432-29-1&amp;searchclause=6448300">http://sunsolve.sun.com/search/document.do?assetkey=1-21-114432-29-1&amp;searchclause=6448300</a></span>

</li>
</ul>
</li>
</ul>


<a name="Required-Utilities"></a>
<h3><a name="id62849">3.4 
        Required Utilities</a></h3>


<p>
These are the tools you will need in order to unpack and build Erlang/OTP.
</p>

<a name="Required-Utilities_Unpacking"></a>
<h4>Unpacking</h4>


<ul>
<li>
GNU unzip, or a modern uncompress.

</li>
<li>
A TAR program that understands the GNU TAR format for long filenames
(such as GNU TAR).

</li>
</ul>


<a name="Required-Utilities_Building"></a>
<h4>Building</h4>


<ul>
<li>
GNU <span class="code">make</span>

</li>
<li>
<span class="code">gcc</span> -- GNU C compiler

</li>
<li>
Perl 5

</li>
<li>
GNU <span class="code">m4</span> -- If HiPE (native code) support is enabled. HiPE can be
disabled using <span class="code">--disable-hipe</span>

</li>
<li>
<span class="code">ncurses</span>, <span class="code">termcap</span>, or <span class="code">termlib</span> -- The development headers and
libraries are needed, often known as <span class="code">ncurses-devel</span>. Use
<span class="code">--without-termcap</span> to build without any of these libraries. Note that
in this case only the old shell (without any line editing) can be used.

</li>
<li>
OpenSSL -- Optional, but needed for building the Erlang/OTP applications
<span class="code">ssl</span> and <span class="code">crypto</span>. You need the "development package" of OpenSSL, i.e.
including the header files. For building the application <span class="code">ssl</span> the OpenSSL
binary command program <span class="code">openssl</span> is also needed. At least version 0.9.8
of OpenSSL is required. Can be downloaded from <span class="bold_code"><a href="http://www.openssl.org">http://www.openssl.org</a></span>.

</li>
<li>
Sun Java jdk-1.5.0 or higher -- Optional but needed for building the
Erlang/OTP application <span class="code">jinterface</span> and parts of <span class="code">ic</span> and <span class="code">orber</span>. Can
be downloaded from <span class="bold_code"><a href="http://java.sun.com">http://java.sun.com</a></span>. We have also tested IBM's
JDK 1.5.0.

</li>
<li>
X Windows -- Optional, but development headers and libraries are needed
to build the Erlang/OTP application <span class="code">gs</span> on Unix/Linux.

</li>
<li>
<span class="code">sed</span> -- There seem to be some problems with some of the <span class="code">sed</span> version on
Solaris. Make sure <span class="code">/bin/sed</span> or <span class="code">/usr/bin/sed</span> is used on the Solaris
platform.

</li>
<li>
<span class="code">flex</span> -- Optional, headers and libraries are needed to build the <span class="code">flex</span>
scanner for the <span class="code">megaco</span> application on Unix/Linux.

</li>
</ul>
<a name="Required-Utilities_Building_Building-Documentation"></a>
<p><strong>Building Documentation</strong></p>

<ul>
<li>
<span class="code">xsltproc</span> -- XSLT processor. A tool for applying XSLT stylesheets
to XML documents. Can be downloaded from
<span class="bold_code"><a href="http://xmlsoft.org/XSLT/xsltproc2.html">http://xmlsoft.org/XSLT/xsltproc2.html</a></span>.

</li>
<li>
<span class="code">fop</span> -- Apache FOP print formatter (requires Java). Can be downloaded
from <span class="bold_code"><a href="http://xmlgraphics.apache.org/fop">http://xmlgraphics.apache.org/fop</a></span>.

</li>
</ul>
<a name="Required-Utilities_Building_Building-in-Git"></a>
<p><strong>Building in Git</strong></p>

<ul><li>
GNU <span class="code">autoconf</span> of at least version 2.59. Note that <span class="code">autoconf</span> is not
needed when building an unmodified version of the released source.

</li></ul>


<a name="Required-Utilities_Installing"></a>
<h4>Installing</h4>


<ul><li>
An <span class="code">install</span> program that can take multiple file names.

</li></ul>




<a name="How-to-Build-and-Install-ErlangOTP"></a>
<h3><a name="id57371">3.5 
        How to Build and Install Erlang/OTP</a></h3>


<p>
The following instructions are for building <span class="bold_code"><a href="http://www.erlang.org/download/otp_src_R15B03.tar.gz">the released source tar ball</a></span>.
</p>

<p>
The variable <span class="code">$ERL_TOP</span> will be mentioned a lot of times. It refers to
the top directory in the source tree. More information about <span class="code">$ERL_TOP</span>
can be found in the <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_make-and-ERLTOP">make and $ERL_TOP</a></span> section below. If you are
building in git you probably want to take a look at the <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Building-in-Git">Building in Git</a></span>
section below before proceeding.
</p>

<a name="How-to-Build-and-Install-ErlangOTP_Unpacking"></a>
<h4>Unpacking</h4>


<p>
Step 1: Start by unpacking the Erlang/OTP distribution file with your GNU
compatible TAR program.
</p>

<div class="example"><pre>
$ gunzip -c otp_src_R15B03.tar.gz | tar xf -
</pre></div>
<p>
alternatively:
</p>

<div class="example"><pre>
$ zcat otp_src_R15B03.tar.gz | tar xf -
</pre></div>
<p>
Step 2: Now cd into the base directory (<span class="code">$ERL_TOP</span>).
</p>

<div class="example"><pre>
$ cd otp_src_R15B03
</pre></div>


<a name="How-to-Build-and-Install-ErlangOTP_Configuring"></a>
<h4>Configuring</h4>


<p>
Step 3: On some platforms Perl may behave strangely if certain locales are
set, so optionally you may need to set the LANG variable:
</p>

<div class="example"><pre>
# Bourne shell
$ LANG=C; export LANG
</pre></div>
<p>
or
</p>

<div class="example"><pre>
# C-Shell
$ setenv LANG C
</pre></div>
<p>
Step 4: Run the following commands to configure the build:
</p>

<div class="example"><pre>
$ ./configure  [ options ]
</pre></div>
<p>
By default, Erlang/OTP will be installed in <span class="code">/usr/local/{bin,lib/erlang}</span>.
To instead install in <span class="code">&lt;BaseDir&gt;/{bin,lib/erlang}</span>, use the
<span class="code">--prefix=&lt;BaseDir&gt;</span> option.
</p>

<p>
If you upgraded the source with some patch you may need to clean up
from previous builds before the new build. Before doing a <span class="code">make clean</span>,
be sure to read the <span class="bold_code"><a href="#How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release">Pre-built Source Release</a></span> section below.
</p>



<a name="How-to-Build-and-Install-ErlangOTP_Building"></a>
<h4>Building</h4>


<p>
Step 5: Build the Erlang/OTP package.
</p>

<div class="example"><pre>
$ make
</pre></div>


<a name="How-to-Build-and-Install-ErlangOTP_Installing"></a>
<h4>Installing</h4>


<p>
Step 6: Install then Erlang/OTP package
</p>

<div class="example"><pre>
$ make install
</pre></div>


<a name="How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps"></a>
<h4>A Closer Look at the individual Steps</h4>


<p>
Let us go through them in some detail.
</p>

<a name="How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Configuring"></a>
<p><strong>Configuring</strong></p>

<p>
Step 4 runs a configuration script created by the GNU autoconf utility, which
checks for system specific features and then creates a number of makefiles.
</p>

<p>
The configure script allows you to customize a number of parameters;
type <span class="code">./configure --help</span> or <span class="code">./configure --help=recursive</span> for details.
<span class="code">./configure --help=recursive</span> will give help for all <span class="code">configure</span> scripts in
all applications.
</p>

<p>
One of the things you can specify is where Erlang/OTP should be installed. By
default Erlang/OTP will be installed in <span class="code">/usr/local/{bin,lib/erlang}</span>.
To keep the same structure but install in a different place, <span class="code">&lt;Dir&gt;</span> say,
use the <span class="code">--prefix</span> argument like this: <span class="code">./configure --prefix=&lt;Dir&gt;</span>.
</p>

<p>
Some of the available <span class="code">configure</span> options are:
</p>

<ul>
<li>
<span class="code">--prefix=PATH</span> - Specify installation prefix.

</li>
<li>
<span class="code">--{enable,disable}-threads</span> - Thread support (enabled by default if
possible)

</li>
<li>
<span class="code">--{enable,disable}-smp-support</span> - SMP support (enabled by default if
possible)

</li>
<li>
<span class="code">--{enable,disable}-kernel-poll</span> - Kernel poll support (enabled by
default if possible)

</li>
<li>
<span class="code">--{enable,disable}-hipe</span> - HiPE support (enabled by default on supported
platforms)

</li>
<li>
<span class="code">--enable-darwin-universal</span> - Build universal binaries on darwin i386.

</li>
<li>
<span class="code">--enable-darwin-64bit</span> - Build 64-bit binaries on darwin

</li>
<li>
<span class="code">--enable-m64-build</span> - Build 64-bit binaries using the <span class="code">-m64</span> flag to
<span class="code">(g)cc</span>

</li>
<li>
<span class="code">--enable-m32-build</span> - Build 32-bit binaries using the <span class="code">-m32</span> flag to
<span class="code">(g)cc</span>

</li>
<li>
<span class="code">--{with,without}-termcap</span> - termcap (without implies that only the old
Erlang shell can be used)

</li>
<li>
<span class="code">--with-javac=JAVAC</span> - Specify Java compiler to use

</li>
<li>
<span class="code">--{with,without}-javac</span> - Java compiler (without implies that the
<span class="code">jinterface</span> application won't be built)

</li>
<li>
<span class="code">--{enable,disable}-dynamic-ssl-lib</span> - Dynamic OpenSSL libraries

</li>
<li>
<span class="code">--{enable,disable}-shared-zlib</span> - Shared zlib library

</li>
<li>
<span class="code">--with-ssl=PATH</span> - Specify location of OpenSSL include and lib

</li>
<li>
<span class="code">--{with,without}-ssl</span> - OpenSSL (without implies that the <span class="code">crypto</span>,
<span class="code">ssh</span>, and <span class="code">ssl</span> won't be built)

</li>
<li>
<span class="code">--with-libatomic_ops=PATH</span> - Use the <span class="code">libatomic_ops</span> library for atomic
memory accesses. If <span class="code">configure</span> should inform you about no native atomic
implementation available, you typically want to try using the
<span class="code">libatomic_ops</span> library. It can be downloaded from
<span class="bold_code"><a href="http://www.hpl.hp.com/research/linux/atomic_ops/">http://www.hpl.hp.com/research/linux/atomic_ops/</a></span>.

</li>
</ul>
<p>
If you or your system has special requirements please read the <span class="code">Makefile</span> for
additional configuration information.
</p>

<a name="How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Building"></a>
<p><strong>Building</strong></p>

<p>
Step 5 builds the Erlang/OTP system. On a fast computer, this will take about
5 minutes. After completion of this step, you should have a working
Erlang/OTP system which you can try by typing <span class="code">bin/erl</span>. This should start
up Erlang/OTP and give you a prompt:
</p>

<div class="example"><pre>
$ bin/erl
Erlang R15B03 (erts-5.9.3.1) [source] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:false]

Eshell V5.9.3.1  (abort with ^G)
1&gt; _
</pre></div>
<a name="How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Installing"></a>
<p><strong>Installing</strong></p>

<p>
Step 6 is optional. It installs Erlang/OTP at a standardized location (if you
change your mind about where you wish to install you can rerun step 4,
without having to do step 5 again).
</p>

<a name="How-to-Build-and-Install-ErlangOTP_A-Closer-Look-at-the-individual-Steps_Installing_Alternative-Installation-Procedures"></a>
<p><strong>Alternative Installation Procedures</strong></p>

<ul>
<li>
<p>Staged install using <span class="bold_code"><a href="http://www.gnu.org/prep/standards/html_node/DESTDIR.html">DESTDIR</a></span>. You can perform the install
phase in a temporary directory and later move the installation into
its correct location by use of the <span class="code">DESTDIR</span> variable:
</p>

<div class="example"><pre>
$ make DESTDIR=&lt;tmp install dir&gt; install
</pre></div>
<p>The installation will be created in a location prefixed by <span class="code">$DESTDIR</span>.
It can, however, not be run from there. It needs to be moved into the
correct location before it can be run. If <span class="code">DESTDIR</span> have not been set
but <span class="code">INSTALL_PREFIX</span> has been set, <span class="code">DESTDIR</span> will be set to
<span class="code">INSTALL_PREFIX</span>. Note that <span class="code">INSTALL_PREFIX</span> in pre R13B04 was buggy
and behaved as <span class="code">EXTRA_PREFIX</span> (see below). There are lots of areas of
use for an installation procedure using <span class="code">DESTDIR</span>, e.g. when creating
a package, cross compiling, etc. Here is an example where the
installation should be located under <span class="code">/opt/local</span>:
</p>

<div class="example"><pre>
$ ./configure --prefix=/opt/local
$ make
$ make DESTDIR=/tmp/erlang-build install
$ cd /tmp/erlang-build/opt/local
$     # gnu-tar is used in this example
$ tar -zcf /home/me/my-erlang-build.tgz *
$ su -
Password: *****
$ cd /opt/local
$ tar -zxf /home/me/my-erlang-build.tgz
</pre></div>
</li>
<li>
<p>Install using the <span class="code">release</span> target. Instead of doing <span class="code">make install</span> you
can create the installation in whatever directory you like using the
<span class="code">release</span> target and run the <span class="code">Install</span> script yourself. <span class="code">RELEASE_ROOT</span>
is used for specifying the directory where the installation should be
created. This is what by default ends up under <span class="code">/usr/local/lib/erlang</span>
if you do the install using <span class="code">make install</span>. All installation paths
provided in the <span class="code">configure</span> phase are ignored, as well as <span class="code">DESTDIR</span>,
and <span class="code">INSTALL_PREFIX</span>. If you want links from a specific <span class="code">bin</span> directory
to the installation you have to set those up yourself. An example where
Erlang/OTP should be located at <span class="code">/home/me/OTP</span>:
</p>

<div class="example"><pre>
$ ./configure
$ make
$ make RELEASE_ROOT=/home/me/OTP release
$ cd /home/me/OTP
$ ./Install -minimal /home/me/OTP
$ mkdir -p /home/me/bin
$ cd /home/me/bin
$ ln -s /home/me/OTP/bin/erl erl
$ ln -s /home/me/OTP/bin/erlc erlc
$ ln -s /home/me/OTP/bin/escript escript
...
</pre></div>
<p>The <span class="code">Install</span> script should currently be invoked as follows in the
directory where it resides (the top directory):
</p>

<div class="example"><pre>
$ ./Install [-cross] [-minimal|-sasl] &lt;ERL_ROOT&gt;
</pre></div>
<p>where:
</p>

<ul>
<li>
<span class="code">-minimal</span> Creates an installation that starts up a minimal amount
of applications, i.e., only <span class="code">kernel</span> and <span class="code">stdlib</span> are started. The
minimal system is normally enough, and is what <span class="code">make install</span> uses.

</li>
<li>
<span class="code">-sasl</span> Creates an installation that also starts up the <span class="code">sasl</span>
application.

</li>
<li>
<span class="code">-cross</span> For cross compilation. Informs the install script that it
is run on the build machine.

</li>
<li>
<span class="code">&lt;ERL_ROOT&gt;</span> - The absolute path to the Erlang installation to use
at run time. This is often the same as the current working directory,
but does not have to be. It can follow any other path through the
file system to the same directory.


</li>
</ul>
<p>If neither <span class="code">-minimal</span>, nor <span class="code">-sasl</span> is passed as argument you will be
prompted.
</p>

</li>
<li>
<p>Test install using <span class="code">EXTRA_PREFIX</span>. The content of the <span class="code">EXTRA_PREFIX</span>
variable will prefix all installation paths when doing <span class="code">make install</span>.
Note that <span class="code">EXTRA_PREFIX</span> is similar to <span class="code">DESTDIR</span>, but it does <strong>not</strong> have
the same effect as <span class="code">DESTDIR</span>. The installation can and have to be run
from the location specified by <span class="code">EXTRA_PREFIX</span>. That is, it can be useful
if you want to try the system out, running test suites, etc, before doing
the real install without <span class="code">EXTRA_PREFIX</span>.
</p>
</li>
</ul>


<a name="How-to-Build-and-Install-ErlangOTP_Symbolic-Links-in-bindir"></a>
<h4>Symbolic Links in --bindir</h4>


<p>
When doing <span class="code">make install</span> and the default installation prefix is used,
relative symbolic links will be created from <span class="code">/usr/local/bin</span> to all public
Erlang/OTP executables in <span class="code">/usr/local/lib/erlang/bin</span>. The installation phase
will try to create relative symbolic links as long as <span class="code">--bindir</span> and the
Erlang bin directory, located under <span class="code">--libdir</span>, both have <span class="code">--exec-prefix</span> as
prefix. Where <span class="code">--exec-prefix</span> defaults to <span class="code">--prefix</span>. <span class="code">--prefix</span>,
<span class="code">--exec-prefix</span>, <span class="code">--bindir</span>, and <span class="code">--libdir</span> are all arguments that can be
passed to <span class="code">configure</span>. One can force relative, or absolute links by passing
<span class="code">BINDIR_SYMLINKS=relative|absolute</span> as arguments to <span class="code">make</span> during the install
phase. Note that such a request might cause a failure if the request cannot
be satisfied.
</p>



<a name="How-to-Build-and-Install-ErlangOTP_Prebuilt-Source-Release"></a>
<h4>Pre-built Source Release</h4>


<p>
The source release is delivered with a lot of platform independent
build results already pre-built. If you want to remove these pre-built
files, invoke <span class="code">./otp_build remove_prebuilt_files</span> from the <span class="code">$ERL_TOP</span>
directory. After you have done this, you can build exactly the same way
as before, but the build process will take a much longer time.
</p>

<div class="warning">
<div class="label">Warning</div>
<div class="content"><p>
<p>
Doing <span class="code">make clean</span> in an arbitrary directory of the source
 tree, may remove files needed for bootstrapping the build.
</p>

<p>
 Doing <span class="code">./otp_build save_bootstrap</span> from the <span class="code">$ERL_TOP</span> directory before
 doing <span class="code">make clean</span> will ensure that it will be possible to build after
 doing <span class="code">make clean</span>. <span class="code">./otp_build save_bootstrap</span> will be invoked
 automatically when <span class="code">make</span> is invoked from <span class="code">$ERL_TOP</span> with either the
 <span class="code">clean</span> target, or the default target. It is also automatically invoked
 if <span class="code">./otp_build remove_prebuilt_files</span> is invoked.
</p>
</p></div>
</div>



<a name="How-to-Build-and-Install-ErlangOTP_Building-in-Git"></a>
<h4>Building in Git</h4>


<p>
When building in a Git working directory you also have to have a GNU <span class="code">autoconf</span>
of at least version 2.59 on your system, because you need to generate the
<span class="code">configure</span> scripts before you can start building.
</p>

<p>
The <span class="code">configure</span> scripts are generated by invoking <span class="code">./otp_build autoconf</span> in
the <span class="code">$ERL_TOP</span> directory. The <span class="code">configure</span> scripts also have to be regenerated
when a <span class="code">configure.in</span> or <span class="code">aclocal.m4</span> file has been modified. Note that when
checking out a branch a <span class="code">configure.in</span> or <span class="code">aclocal.m4</span> file may change
content, and you may therefore have to regenerate the <span class="code">configure</span> scripts
when checking out a branch. Regenerated <span class="code">configure</span> scripts imply that you
have to run <span class="code">configure</span> and build again.
</p>

<div class="note">
<div class="label">Note</div>
<div class="content"><p>
<p>
Running <span class="code">./otp_build autoconf</span> is <strong>not</strong> needed when building
 an unmodified version of the released source.
</p>
</p></div>
</div>

<p>
Other useful information can be found at our github wiki:
<span class="bold_code"><a href="http://wiki.github.com/erlang/otp">http://wiki.github.com/erlang/otp</a></span>
</p>



<a name="How-to-Build-and-Install-ErlangOTP_make-and-ERLTOP"></a>
<h4>make and $ERL_TOP</h4>


<p>
All the makefiles in the entire directory tree use the environment
variable <span class="code">ERL_TOP</span> to find the absolute path of the installation. The
<span class="code">configure</span> script will figure this out and set it in the top level
Makefile (which, when building, it will pass on). However, when
developing it is sometimes convenient to be able to run make in a
subdirectory. To do this you must set the <span class="code">ERL_TOP</span> variable
before you run make.
</p>

<p>
For example, assume your GNU make program is called <span class="code">make</span> and you
want to rebuild the application <span class="code">STDLIB</span>, then you could do:
</p>

<div class="example"><pre>
$ cd lib/stdlib; env ERL_TOP=&lt;Dir&gt; make
</pre></div>
<p>
where <span class="code">&lt;Dir&gt;</span> would be what you find <span class="code">ERL_TOP</span> is set to in the top level
Makefile.
</p>





<a name="The-ErlangOTP-Documentation"></a>
<h3><a name="id62172">3.6 
        The Erlang/OTP Documentation</a></h3>


<a name="The-ErlangOTP-Documentation_How-to-Build-the-Documentation"></a>
<h4>How to Build the Documentation</h4>


<div class="example"><pre>
$ cd $ERL_TOP
</pre></div>
<p>
If you have just built Erlang/OTP in the current source tree, you have
already ran <span class="code">configure</span> and do not need to do this again; otherwise, run
<span class="code">configure</span>.
</p>

<div class="example"><pre>
$ ./configure [Configure Args]
</pre></div>
<p>
When building the documentation you need a full Erlang/OTP-R15B03 system in
the <span class="code">$PATH</span>.
</p>

<div class="example"><pre>
$ export PATH=&lt;Erlang/OTP-R15B03 bin dir&gt;:$PATH     # Assuming bash/sh
</pre></div>
<p>
Build the documentation.
</p>

<div class="example"><pre>
$ make docs
</pre></div>
<p>
The documentation can be installed either using the <span class="code">install-docs</span> target,
or using the <span class="code">release_docs</span> target.
</p>

<ul>
<li>
<p>If you have installed Erlang/OTP using the <span class="code">install</span> target, install
the documentation using the <span class="code">install-docs</span> target. Install locations
determined by <span class="code">configure</span> will be used. <span class="code">$DESTDIR</span> can be used the
same way as when doing <span class="code">make install</span>.
</p>

<div class="example"><pre>
$ make install-docs
</pre></div>
</li>
<li>
<p>If you have installed Erlang/OTP using the <span class="code">release</span> target, install
the documentation using the <span class="code">release_docs</span> target. You typically want
to use the same <span class="code">RELEASE_ROOT</span> as when invoking <span class="code">make release</span>.
</p>

<div class="example"><pre>
$ make release_docs RELEASE_ROOT=&lt;release dir&gt;
</pre></div>
</li>
</ul>
<a name="The-ErlangOTP-Documentation_How-to-Build-the-Documentation_Build-Issues"></a>
<p><strong>Build Issues</strong></p>

<p>
We have sometimes experienced problems with Sun's <span class="code">java</span> running out of
memory when running <span class="code">fop</span>. Increasing the amount of memory available
as follows has in our case solved the problem.
</p>

<div class="example"><pre>
$ export FOP_OPTS="-Xmx&lt;Installed amount of RAM in MB&gt;m"
</pre></div>
<p>
More information can be found at
<span class="bold_code"><a href="http://xmlgraphics.apache.org/fop/0.95/running.html#memory">http://xmlgraphics.apache.org/fop/0.95/running.html#memory</a></span>.
</p>



<a name="The-ErlangOTP-Documentation_How-to-Install-the-Preformatted-Documentation"></a>
<h4>How to Install the Pre-formatted Documentation</h4>


<p>
Pre-formatted <span class="bold_code"><a href="http://www.erlang.org/download/otp_doc_html_R15B03.tar.gz">html documentation</a></span> and <span class="bold_code"><a href="http://www.erlang.org/download/otp_doc_man_R15B03.tar.gz">man pages</a></span> can be downloaded at
<span class="bold_code"><a href="http://www.erlang.org/download.html">http://www.erlang.org/download.html</a></span>.
</p>

<p>
For some graphical tools to find the on-line help you have to install
the HTML documentation on top of the installed OTP applications, i.e.
</p>

<div class="example"><pre>
$ cd &lt;ReleaseDir&gt;
$ gunzip -c otp_html_R15B03.tar.gz | tar xf -
</pre></div>
<p>
For <span class="code">erl -man &lt;page&gt;</span> to work the Unix manual pages have to be
installed in the same way, i.e.
</p>

<div class="example"><pre>
$ cd &lt;ReleaseDir&gt;
$ gunzip -c otp_man_R15B03.tar.gz | tar xf -
</pre></div>
<p>
Where <span class="code">&lt;ReleaseDir&gt;</span> is
</p>

<ul>
<li>
<span class="code">&lt;PrefixDir&gt;/lib/erlang</span> if you have installed Erlang/OTP using
<span class="code">make install</span>.

</li>
<li>
<span class="code">$DESTDIR&lt;PrefixDir&gt;/lib/erlang</span> if you have installed Erlang/OTP
using <span class="code">make install DESTDIR=&lt;TmpInstallDir&gt;</span>.

</li>
<li>
<span class="code">RELEASE_ROOT</span> if you have installed using
<span class="code">make release RELEASE_ROOT=&lt;ReleaseDir&gt;</span>.

</li>
</ul>




<a name="Support-for-SMP-Symmetric-Multi-Processing"></a>
<h3><a name="id62469">3.7 
        Support for SMP (Symmetric Multi Processing)</a></h3>


<p>
An emulator with SMP support will be built by default on most platforms
if a usable POSIX thread library or native Windows threads is found.
</p>

<p>
You can force building of an SMP emulator, by using
<span class="code">./configure --enable-smp-support</span>. However, if configure does not
automatically enable SMP support, the build is very likely to fail.
</p>

<p>
Use <span class="code">./configure --disable-smp-support</span> if you for some reason do not
want to have the emulator with SMP support built.
</p>

<p>
If SMP support is enabled, support for threaded I/O will also be turned on
(also in the emulator without SMP support).
</p>

<p>
The <span class="code">erl</span> command will automatically start the SMP emulator if the
computer has more than one logical processor. You can force a start
of the emulator with SMP support by passing <span class="code">-smp enable</span> as
command line arguments to erl, and you can force a start of the
emulator without SMP support by passing <span class="code">-smp disable</span>.
</p>



<a name="GS-Graphic-System"></a>
<h3><a name="id71231">3.8 
        GS (Graphic System)</a></h3>


<p>
GS now Tcl/Tk 8.4. It will be searched for when starting GS.
</p>



<a name="Using-HiPE"></a>
<h3><a name="id71248">3.9 
        Using HiPE</a></h3>


<p>
HiPE supports the following system configurations:
</p>

<ul>
<li>
<p>x86: All 32-bit and 64-bit mode processors should work.
</p>

<ul>
<li>
<p>Linux: Fedora Core is supported. Both 32-bit and 64-bit modes are
supported.
</p>

<p>NPTL glibc is strongly preferred, or a LinuxThreads
glibc configured for "floating stacks". Old non-floating
stacks glibcs have a fundamental problem that makes HiPE
support and threads support mutually exclusive.
</p>

</li>
<li>
<p>Solaris: Solaris 10 (32-bit and 64-bit) and 9 (32-bit) are supported.
The build requires a version of the GNU C compiler (gcc)
that has been configured to use the GNU assembler (gas).
Sun's x86 assembler is emphatically <strong>not</strong> supported.
</p>

</li>
<li>
<p>FreeBSD: FreeBSD 6.1 and 6.2 in 32-bit and 64-bit modes should work.
</p>

</li>
<li>
<p>MacOSX/Darwin: Darwin 9.8.0 in 32-bit mode should work.
</p>

</li>
</ul>
</li>
<li>
<p>PowerPC: All 32-bit 6xx/7xx(G3)/74xx(G4) processors should work. 32-bit
mode on 970 (G5) and POWER5 processors should work.
</p>

<ul><li>
Linux (Yellow Dog) and Mac OSX 10.4 are supported.


</li></ul>
</li>
<li>
<p>SPARC: All UltraSPARC processors running 32-bit user code should work.
</p>

<ul>
<li>
<p>Solaris 9 is supported. The build requires a <span class="code">gcc</span> that has been
configured to use Sun's assembler and linker. Using the GNU assembler
but Sun's linker has been known to cause problems.
</p>

</li>
<li>
<p>Linux (Aurora) is supported.
</p>

</li>
</ul>
</li>
<li>
<p>ARM: ARMv5TE (i.e. XScale) processors should work. Both big-endian and
little-endian modes are supported.
</p>

<ul><li>
Linux is supported.

</li></ul>
</li>
</ul>
<p>
HiPE is automatically enabled on the following systems:
</p>

<ul>
<li>
x86 in 32-bit mode: Linux, Solaris, FreeBSD

</li>
<li>
x86 in 64-bit mode: Linux, Solaris, FreeBSD

</li>
<li>
PowerPC: Linux, MacOSX

</li>
<li>
SPARC: Linux

</li>
<li>
ARM: Linux

</li>
</ul>
<p>
On other supported systems you need to <span class="code">./configure --enable-hipe</span>.
</p>

<p>
If you are running on a platform supporting HiPE and if you have not disabled
HiPE, you can compile a module into native code like this from the Erlang
shell:
</p>

<div class="example"><pre>
1&gt; c(Module, native).
</pre></div>
<p>
or
</p>

<div class="example"><pre>
1&gt; c(Module, [native|OtherOptions]).
</pre></div>
<p>
Using the erlc program, write like this:
</p>

<div class="example"><pre>
$ erlc +native Module.erl
</pre></div>
<p>
The native code will be placed into the beam file and automatically loaded
when the beam file is loaded.
</p>

<p>
To add hipe options, write like this from the Erlang shell:
</p>

<div class="example"><pre>
1&gt; c(Module, [native,{hipe,HipeOptions}|MoreOptions]).
</pre></div>
<p>
Use <span class="code">hipe:help_options/0</span> to print out the available options.
</p>

<div class="example"><pre>
1&gt; hipe:help_options().
</pre></div>


<a name="Mac-OS-X-Darwin"></a>
<h3><a name="id71477">3.10 
        Mac OS X (Darwin)</a></h3>


<p>
Make sure that the command <span class="code">hostname</span> returns a valid fully qualified host
name (this is configured in <span class="code">/etc/hostconfig</span>).
</p>

<p>
If you develop linked-in drivers (shared library) you need to link using
<span class="code">gcc</span> and the flags <span class="code">-bundle -flat_namespace -undefined suppress</span>. You also
include <span class="code">-fno-common</span> in <span class="code">CFLAGS</span> when compiling. Use <span class="code">.so</span> as the library
suffix.
</p>

<p>
Use the <span class="code">--enable-darwin-64bit</span> configure flag to build a 64-bit
binaries on Mac OS X.
</p>



<a name="Building-universal-binaries-on-Mac-OS-X-obsolete-information"></a>
<h3><a name="id71532">3.11 
        Building universal binaries on Mac OS X (obsolete information)</a></h3>


<p>
(This information was written when Mac OS X Leopard was the current
release. It may no longer work.)
</p>

<p>
Universal 32bit binaries can be built on an Intel Mac using the
<span class="code">--enable-darwin-universal</span> configure option. There still may occur
problems with certain applications using this option, but the base
system should run smoothly.
</p>

<p>
When building universal binaries on a PowerPC Mac (at least on Tiger),
you must point out a suitable SDK that contains universal binaries.
For instance, to build universal binaries for Tiger (10.4):
</p>

<div class="example"><pre>
$ CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk" \
./configure --enable-darwin-universal
</pre></div>
<p>
Also, if you run Leopard, but want to build for Tiger, you must do by
setting the <span class="code">MACOSX_DEPLOYMENT_TARGET</span> environmental variable.
</p>

<div class="example"><pre>
$ export MACOSX_DEPLOYMENT_TARGET=10.4
</pre></div>
<p>
Experimental support for 64bit x86 darwin binaries can be enabled
using the <span class="code">--enable-darwin-64bit</span> configure flag. The 64bit binaries are
best built and run on Leopard, but most of the system also works on
Tiger (Tiger's 64bit libraries are, however, limited; therefore e.g. <span class="code">odbc</span>,
<span class="code">crypto</span>, <span class="code">ssl</span> etc. are not supported in Tiger). 64bit PPC binaries are not
supported and we have no plans to add such support (no machines to
test on).
</p>

<p>
Universal binaries and 64bit binaries are mutually exclusive options.
</p>



<a name="Building-a-fast-Erlang-VM-on-Mac-OS-Lion"></a>
<h3><a name="id71611">3.12 
        Building a fast Erlang VM on Mac OS Lion</a></h3>


<p>
Starting with Xcode 4.2, Apple no longer includes a "real" <span class="code">gcc</span>
compiler (not based on the LLVM).  Building with <span class="code">llvm-gcc</span> or <span class="code">clang</span>
will work, but the performance of the Erlang run-time system will not
be the best possible.
</p>

<p>
Note that if you have <span class="code">gcc-4.2</span> installed and included in <span class="code">PATH</span>
(from a previous version of Xcode), <span class="code">configure</span> will automatically
make sure that <span class="code">gcc-4.2</span> will be used to compile <span class="code">beam_emu.c</span>
(the source file most in need of <span class="code">gcc</span>).
</p>

<p>
If you don't have <span class="code">gcc-4.2.</span> and want to build a run-time system with
the best possible performance, do like this:
</p>

<p>
Install Xcode from the AppStore if it is not already installed.
</p>

<p>
If you have Xcode 4.3, or later, you will also need to download 
"Command Line Tools" via the Downloads preference pane in Xcode.
</p>

<p>
Some tools may still be lacking or out-of-date, we recommend using
<span class="bold_code"><a href="https://github.com/mxcl/homebrew/wiki/installation">Homebrew</a></span> or
Macports to update those tools.
</p>

<p>
Install MacPorts (<span class="bold_code"><a href="http://www.macports.org/">http://www.macports.org/</a></span>). Then:
</p>

<div class="example"><pre>
$ sudo port selfupdate
$ sudo port install gcc45 +universal
</pre></div>
<a name="Building-a-fast-Erlang-VM-on-Mac-OS-Lion_Building-with-wxErlang"></a>
<h4>Building with wxErlang</h4>


<p>
If you want to build the <span class="code">wx</span> application, you will need to get wxMac-2.8.12
(<span class="code">wxMac-2.8.12.tar.gz</span> from
<span class="bold_code"><a href="http://sourceforge.net/projects/wxwindows/files/2.8.12/">http://sourceforge.net/projects/wxwindows/files/2.8.12/</a></span>) and install it.
</p>

<p>
Export the path for MacOSX10.6.sdk:
</p>

<div class="example"><pre>
$ export SDK=/Developer/SDKs/MacOSX10.6.sdk
</pre></div>
<p>
In Xcode 4.3 the path has changed so use the following instead,
</p>

<div class="example"><pre>
$ export SDK=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk
</pre></div>
<p>
Then configure and build wxMac:
</p>

<div class="example"><pre>
$ 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
$ make
$ sudo make install
</pre></div>
<p>
To link wx properly you will also need to build and install <span class="code">wxStyledTextCtrl</span>:
</p>

<div class="example"><pre>
$ cd contrib/src/stc
$ make
$ sudo make install
</pre></div>


<a name="Building-a-fast-Erlang-VM-on-Mac-OS-Lion_Finish-up"></a>
<h4>Finish up</h4>


<p>
Build Erlang with the MacPorts GCC as the main compiler (using <span class="code">clang</span>
for the Objective-C Cocoa code in the <span class="code">wx</span> application):
</p>

<div class="example"><pre>
$ 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
$ sudo make install
</pre></div>




<a name="How-to-Build-a-Debug-Enabled-Erlang-RunTime-System"></a>
<h3><a name="id71820">3.13 
        How to Build a Debug Enabled Erlang RunTime System</a></h3>


<p>
After completing all the normal building steps described above a debug
enabled runtime system can be built. To do this you have to change
directory to <span class="code">$ERL_TOP/erts/emulator</span>.
</p>

<p>
In this directory execute:
</p>

<div class="example"><pre>
$ make debug FLAVOR=$FLAVOR
</pre></div>
<p>
where <span class="code">$FLAVOR</span> is either <span class="code">plain</span> or <span class="code">smp</span>. The flavor options will
produce a beam.debug and beam.smp.debug executable respectively. The
files are installed along side with the normal (opt) versions <span class="code">beam.smp</span>
and <span class="code">beam</span>.
</p>

<p>
To start the debug enabled runtime system execute:
</p>

<div class="example"><pre>
$ $ERL_TOP/bin/cerl -debug
</pre></div>
<p>
The debug enabled runtime system features lock violation checking,
assert checking and various sanity checks to help a developer ensure
correctness. Some of these features can be enabled on a normal beam
using appropriate configure options.
</p>

<p>
There are other types of runtime systems that can be built as well
using the similar steps just described.
</p>

<div class="example"><pre>
$ make $TYPE FLAVOR=$FLAVOR
</pre></div>
<p>
where <span class="code">$TYPE</span> is <span class="code">opt</span>, <span class="code">gcov</span>, <span class="code">gprof</span>, <span class="code">debug</span>, <span class="code">valgrind</span>, or <span class="code">lcnt</span>.
These different beam types are useful for debugging and profiling
purposes.
</p>



<a name="Authors"></a>
<h3><a name="id71932">3.14 
        Authors</a></h3>


<p>
Authors are mostly listed in the application's <span class="code">AUTHORS</span> files,
that is <span class="code">$ERL_TOP/lib/*/AUTHORS</span> and <span class="code">$ERL_TOP/erts/AUTHORS</span>,
not in the individual source files.
</p>



<a name="Copyright-and-License"></a>
<h3><a name="id71959">3.15 
        Copyright and License</a></h3>


<p>
Copyright Ericsson AB 1998-2012. All Rights Reserved.
</p>

<p>
The contents of this file are subject to the Erlang Public License,
Version 1.1, (the "License"); you may not use this file except in
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at http://www.erlang.org/.
</p>

<p>
Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
</p>



<a name="More-Information"></a>
<h3><a name="id71987">3.16 
        More Information</a></h3>


<p>
More information can be found at <span class="bold_code"><a href="http://www.erlang.org">http://www.erlang.org</a></span>.
</p>



<a name="Modifying-This-Document"></a>
<h3><a name="id72009">3.17 
        Modifying This Document</a></h3>


<p>
Before modifying this document you need to have a look at the
<span class="code">$ERL_TOP/README.md.txt</span> document.
</p>




</div>
<div class="footer">
<hr>
<p>Copyright © 1997-2012 Ericsson AB. All Rights Reserved.</p>
</div>
</div>
</div></body>
</html>