Skip to content

Instantly share code, notes, and snippets.

@edwardw
Created August 21, 2012 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardw/3411110 to your computer and use it in GitHub Desktop.
Save edwardw/3411110 to your computer and use it in GitHub Desktop.
Build and install erlang on mountain lion

...with GNU stow. Also, Xcode is assumed already being installed here.

Yes, there is a much smaller command line version of Xcode. And it is officially supported. But an error arose when I tried to execute, say, brew install python --framework. Full version of Xcode has no such issue though.

Anyway:

$ brew install stow
$ mkdir -p /usr/local/stow
$ export STOW_DIR=/usr/local/stow

GNU sed is one of the few prerequisites. The system default sed fails ./otp_build autoconf:

$ brew install gnu-sed --default-names

Onto erlang itself:

$ git clone git://github.com/erlang/otp.git
$ git checkout OTP_R15B01
$ ./otp_build autoconf
$ otp_version=$(git describe)
$ CFLAGS=-O0 ./configure --prefix=${STOW_DIR}/${otp_version} --enable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit
$ make; make docs
$ make install install-docs

Enable newly install erlang:

$ cd /usr/local/stow && stow ${otp_version}

And now it's time to hack on some erlang!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment