64-bit R for Mac OS X

All binaries on this page are strictly experimental. For licenses see individual projects (basically covered by GPL). All downloads are subject to acceptance of the disclaimer below. Feedback is welcome, but please don't use R-bugs as this is not an official release!

NOTE: This page is now deprecated. Quad-arch builds (including 64-bit) for Mac OS X 10.5 (Leopard) are now available from the nightly builds pages.

R for Intel 64-bit (Mac Pro) on Mac OS X 10.4 (Tiger)

R works fine as 64-bit application on Mac Pro machines. The same limitations apply as with PowerPC 64 (G5) 64-bit R, i.e. no Cocoa (R GUI, Quartz) support (because Tiger doesn't support it, but it works in Leopard). Compilation of R for the x86_64 architecture (codename for 64-bit Intel Mac binaries) is rather straight-forward, use CC='gcc -arch x86_64' and corresponding CXX, FC and F77 flags in configure. Use Apple compilers and some gfortran compiler capable of building x86_64.

You can download an experimental build of R 2.5.0 for all four architectures here:
R-25-br-quad.tar.gz (ca. 39MB)
Just unpack to root (e.g. tar fvxz R-25-br-quad.tar.gz -C /), it is a framework that goes to /Library/Frameworks and the 64-bit version is run by R64 instead of R.

Due to high demand here is a step-by-step guide:

  • Install Apple Xcode 2.4.1 (or higher) - either download it from Apple or find it on the DVD supplied with your Mac (Xcode 2.3.x or older does NOT work!).
     
  • Install GNU Fortran, for example this one: gfortran-4.2.1.dmg (ca. 28MB)
    (I do not recommend Fortran from HPC anymore becasue it is not universal and doesn't support universal builds, see Tools section for details)
     
  • Configure R for 64-bit, for example:
    ./configure CC='gcc -arch x86_64' CXX='g++ -arch x86_64' \
    F77='gfortran -arch x86_64' FC='gfortran -arch x86_64' \
    r_arch=x86_64 \
    --with-blas='-framework vecLib' --with-lapack --without-x \
    --with-system-zlib --build=x86_64-apple-darwin8.8.1 \
    --without-readline
    
    Remove the last line if you have 64-bit GNU readline. You don't need the r_arch if you don't plan to use a fat framerwork. Then just make ; make install as usual.
Note (2007-08-29): There are reportedly some issues with memory allocation on 64-bit Intel Mac OS X 10.4 (Tiger) under heavy memory load leading to memory corruption. The issue manifests itself in infinite loops and/or crashes (see R-SIG-Mac for details). This issue doesn't occur in Mac OS X 10.5 (Leopard), so you may want to switch to Leopard if you want to do some serious 64-bit computing (and you can run the R GUI in 64-bit as well).

R for PowerPC 64-bit (G5) on Mac OS X 10.4 (Tiger)

R is capable of using the 64-bit capabilities of Mac OS X 10.4 (Tiger) on G5 machines. The main difference is that 64-bit build can use more than 4GB of main (and virtual) memory thus making a bit larger computations feasible.
> gc()
             used    (Mb) gc trigger    (Mb)   max used    (Mb)
Ncells     168879     9.1     350000    18.7     350000    18.7
Vcells 1500073079 11444.7 1500425385 11447.4 1500073103 11444.7
As you can see using over 11GB of memory is not a big deal with 64-bit ;).

This build is unlike other OS X builds not a framework in order to co-exist with the CRAN binary framework.The following file contains 64-bit build of R 2.3.1 (patched as of 2006/06/27) and it lives in /usr/local/lib64/R with a convenience softlink R64 in /usr/local/bin. It features readline, jpeg and X11 support (if you plan to use the latter you will also need to download the Xorg X11 client below). It passed make check.

Download: R-2.3.1-ppc64.tar.gz (ca. 17MB)
To download and install, run in Terminal:
curl -O http://r.research.att.com/exp/R-2.3.1-ppc64.tar.gz
sudo tar fvxz R-2.3.1-ppc64.tar.gz -C /
sudo ln -sf /usr/local/lib64/R/bin/R /usr/local/bin/R64

In order to compile packages from sources, you will need gcc 4.0.3 which comes with R 2.3.1 full install or is obtainable separately from the tools section.

Older version: R-2.2.1-ppc64.tar.gz (ca. 16MB)

X11 64-bit client

Mac OS X commes with X11 libraries only in 32-bit, but we need 64-bit. The following tar-ball contains 64-bit version of Xorg X11 client (cvs as of 2006/01/03) that can be used in conjunction with the above 64-bit R. It lives in /usr/local/lib64/X11. You still need a 32-bit server for display as well, such as the one supplied from Apple.

Download: X11-64.tar.gz (ca. 41MB)
Install: sudo tar fvxz X11-64.tar.gz -C /

Monster package of 64-bit R

The following tar-ball includes R 2.3.1 + X11 client + binaries of all CRAN packages that build cleanly + binaries of default Bioconducductor packages that build cleanly. Packages that require external libraries that are not part of Tiger are not included.
Download R-2.3.1-ppc64-monster.tar.gz (ca. 530MB!!)

How to build 64-bit R

In order to build 64-bit version of R yourself, you will need Apple's Xcode 2.4.1 or higher, a Fortran with Darwin driver (e.g. HPC fortran with Darwin driver on Intel Macs - see the top of the page - or the tools supplied with R for ppc64). The compiler should be universal and compile C/C++ and Fortran for for the targets you desire (ppc, ppc64, i386 and x86_64 are the four architectures).

In the next step it is recommended to install the 64-bit X11 client (for ppc64 available above - more recent Xorg-based client for both ppc64 and x86_64 will follow soon), such that you will be able to create plots in R. Make sure the client's binaries are first on the PATH, e.g.:

export PATH=/usr/local/lib64/X11/bin:$PATH
Also it is a good idea to install GNU readline, because Apple's libedit is 32-bit only. You can download a fat version (containing ppc, ppc64 and i386 architectures) of GNU here, it installs to /usr/local:
GNU readline 5.2 patch 1 (quad arch, w/headers): readline-5.2-1-quad.tar.gz
(Updated 2007/3/27 to 5.2-1 and added x86_64 architecture)
To install, type sudo tar fvxz readline-5.2-1-quad.tar.gz -C /

Other useful libraries inlcude libpng and libjpeg. There are the corresponding quad-arch binaries:

libpng 1.2.15 + jpeg6b: jpegpng-quad.tar.gz

Armed with gcc, X11 and readline, you can go ahead and get R sources. Apple is kind enough to supply 64-bit vecLib (and it's fast!), so you don't need any other BLAS library. These are the configure flags that were used to build the above experimental binary:

./configure --host=powerpc64-apple-darwin8.7.0 --build=powerpc64-apple-darwin8.7.0 \
--prefix=/usr/local/lib64 'CC=gcc -arch ppc64' 'CXX=g++ -arch ppc64' \
'FC=gfortran -arch ppc64' 'F77=gfortran -arch ppc64' \
'CFLAGS=-g -O3 -mtune=G5 -mcpu=G5' 'FFLAGS=-g -O3 -mtune=G5 -mcpu=G5' \
'LDFLAGS=-arch ppc64 -m64 -L/usr/local/lib' 'CXXFLAGS=-g -O3 -mtune=G5 -mcpu=G5' \
'FCFLAGS=-g -O3 -mtune=G5 -mcpu=G5' --disable-R-framework --enable-R-shlib \
'--with-blas=-framework vecLib' --with-lapack
As of R 2.3.0 you can omit --prefix, --disable-R-framework, --enable-R-shlib and build a framework instead. If you are thinking of building a really fat framework (ppc+ppc64+i386), you can do it, just remove the three flags and add r_arch=ppc64. The only reason that the experimental binary above doesn't use it is that we want to keep everything separate and don't want to mess with the CRAN framework binary.

You can also replace --host and --build with whatever Darwin version you use (see uname -r). The reason for not using config.guess for the platform identification is to force powerpc64 identifier such that it is different from the 32-bit R.

R 2.2.1 for Intel Mac

This section is now obsolete - as of R 2.3.0 there is a universal binary available from CRAN.

Disclaimer

All software is provided "as is" and any express or implied warranties, including, but but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall AT&T, the publisher, copyright owner or contributors be liable for any direct, indirect, incidental,special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.