You can install different Erlang versions in a simple manner with the kerl script. This is probably the easiest way to install Erlang from source on a system, and typically only requires a few commands to do so. Install kerl by running the following command:
curl -O https://raw.github.com/spawngrid/kerl/master/kerl; chmod a+x kerl
To compile Erlang as 64-bit on Mac OS X, you need to instruct kerl to pass the correct flags to the configure command. The easiest way to do this is by creating a ~/.kerlrc file with the following contents:
KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads
--enable-kernel-poll --enable-darwin-64bit"
Note that when building Erlang on a FreeBSD/Solaris system (including SmartOS), HIPE should be disabled on these platforms as well with the above --disable-hipe option.
Building with kerl on GNU/Linux has the same prerequisites that building from source does.
Building the Erlang release of your choice is one command; You can install R16B02 like this:
./kerl build R16B02 r16b02
This builds the Erlang distribution, and does all the steps required to manually install Erlang for you.
When successfully built you can install the build using:
./kerl install r16b02 ~/erlang/r16b02
. ~/erlang/r16b02/activate
The last line activates the Erlang build that was just installed into ~/erlang/r16b02. See the kerl readme for more details on the available commands.