cd /usr/X11/lib sudo bash # enter your password mv libGL.dylib libGL.dylib.apple ln -s /System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib .
Bulidng of R itself does not require any special flags (other than the above). A simple configure && make && make install is known to work. However, for a proper 64-bit support, read on.
r_arch=x86_64 \ CC="gcc -arch x86_64 -std=gnu99" \ CXX="g++ -arch x86_64" \ OBJC="gcc -arch x86_64" \ F77="gfortran -arch x86_64" \ FC="gfortran -arch x86_64"Replace x86_64 with i386, ppc or ppc64 to build the other architectures. Each make install will merge the current architecture with the others. On an Intel-based Mac, it is possible to build all but the ppc64 architecture.
PATH=/usr/X11/bin:/usr/local/bin:$PATH export PATH LANG=C export LANG svn co https://svn.r-project.org/R/trunk R-devel # you may have to accept a certificate here cd R-devel tools/rsync-recommended cd .. # got the sources, on to building 64-bit R mkdir rd64 cd rd64 ../R-devel/configure SHELL='/bin/bash' \ r_arch=x86_64 \ CC="gcc -arch x86_64 -std=gnu99" \ CXX="g++ -arch x86_64" \ OBJC="gcc -arch x86_64" \ F77="gfortran -arch x86_64" \ FC="gfortran -arch x86_64" \ --with-system-zlib \ --with-blas='-framework vecLib' --with-lapack && \ make -j4 && \ make check && \ make install cd .. # if you want a 32-bit build as well, continue here mkdir rd32 cd rd32 ../R-devel/configure SHELL='/bin/bash' \ r_arch=i386 \ CC="gcc-4.0 -arch i386 -std=gnu99" \ CXX="g++-4.0 -arch i386" \ OBJC="gcc-4.0 -arch i386" \ F77="gfortran-4.0 -arch i386" \ FC="gfortran-4.0 -arch i386" \ --with-system-zlib \ --with-blas='-framework vecLib' --with-lapack && \ make -j4 && \ make check && \ make install cd .. # done - you should have 32-bit and 64-bit R # set r_arch on the command line to start the corresponding RNote that your binary will require you to install all packages from sources. Also you will be missing some of the functionality that requires additional libraries (Cairo etc.) unless you have installed them previously (they are also available from the CRAN Mac Tools page).