Installing 64-bit Erlang on a MacMini

A heads-up for those installing Erlang on an Intel MacMini…

Let’s start by supposing you have Mac OS X Snow Leopard happily installed and updated on an Intel MacMini:

$ uname -a
Darwin MacMini.local 10.5.0 Darwin Kernel Version 10.5.0:
Fri Nov  5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386

Further, you have a recent version of Xcode installed (say 3.2 or later).

You’ve downloaded the latest sources for Erlang (otp_src_R14B.tar.gz) and are ready to install.

$ tar xvzf otp_src_R14B.tar.gz
$ cd otp_src_R14B/
$ ./configure --enable-smp-support --enable-dynamic-ssl-lib
              --enable-kernel-poll --enable-darwin-64bit
$ make
$ sudo make install

You’re following the instructions shown on a ton of sites but, nonetheless, configuring fails with:

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works...
  configure: error: cannot run C compiled programs.

Wait, what?  The C compiler isn’t working?

$ gcc --version
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)

So what’s going on?

Well, the best I can tell is that even though Snow Leopard is a 64-bit OS, and even though Xcode shows up as 64-bit in the System Profiler, there’s something in the build path that is still 32-bit.  Either that or the hardware itself doesn’t want to be forced into 64-bit mode.  The following check doesn’t inspire too much confidence:

$ sysctl hw.cpu64bit_capable
hw.cpu64bit_capable: 0

Hmmm… interesting.  The CPU isn’t 64-bit capable?

The MacMini I’m using has the model identifier Macmini1,1 and reports itself as a 1.66 GHz Intel Core Duo in System Profiler.  A quick trip to EveryMac.com reveals:

  • The 1.66 GHz and 1.83 GHz Core Duo models are both identified as Macmini1,1 and have 32-bit architectures.
  • The 1.83 GHz and 2.0 GHz Core 2 Duo models are identified as Macmini2,1 and have 64-bit architectures (as do all later models).

Ok, that makes sense then—my test machine just happens to be one of the last 32-bit machines and that explains why the configuration failed with the –enable-darwin-64bit option turned on.

The actual date that the 32-bit MacMinis were discontinued (and the 64-bit ones were introduced) was 2007-08-07, just in case you’re curious.  If you bought one before that date, you’re not going to have any luck installing 64-bit Erlang I’m afraid.  If you bought one soon after that date, launch your System Profiler, click Hardware and then check your Model Identifier.  If it is Macmini1,1 (which it will be for all Intel Core Solo and Intel Core Duo processors) or PowerMac10,1/2 (which it will be for all G4 processors) then you’re also out of luck.

The silver lining:  32-bit Erlang installs just fine with a straight:

$ ./configure

If you really need 64-bit mode, just grab a Core 2 Duo of some sort.

Advertisements
This entry was posted in Stuff and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s