Skip to content
Prev 4429 / 15075 Next

tools for compiling R from source on Leopard

Michael,

the instructions you are referring to (gcc-4.2-based) are for  
experimental R builds using cutting-edge unreleased tools, so you're  
pretty much on your own there. So let me first address "offical" way  
as documented in the FAQ:
The gfortran compiler the FAQ refers to is on CRAN (http://cran.r-project.org/bin/macosx/tools 
) - it is also the first download on the R for Mac Tools page. That is  
all you need (Xcode + the above Fortran) and both the FAQ and the  
tools page specifically say so.

Now to your quest for experimental, unsupported tools (see also  
comments inline below). The only reason to use gcc-4.2 is if you want  
to play with OpenMP. Note that the gcc-4.2 is known to have bugs, so  
tread with care.
That is not true (and I'm not sure why concluded it). Only the major  
version (3.x vs 4.x) has to match (as the FAQ tells you), so gcc 4.0.1  
+ gfortran 4.2.1 are just fine.
ADC: http://connect.apple.com/
Login, click on Downloads -> Developer Tools -> GCC 4.2 Developer  
Preview 1
If it's not there, please let me know.
Try typing
gcc-4.2
Which is expected - try enabling the installer log (Window->Installer  
Log) if you're interested in the details. If you're more comfortable  
with command-line tools and want to learn more about packages on OS X,  
have a look at "man pkgutil" and "man installer". For old-style  
packages (which are bundles) see also "man pax" and "man lsbom".
Yes, gcc is a link to gcc-4.0, not to gcc-4.2.
There is no problem, really ;).
No, that is wrong (see above). If you followed the instructions you'd  
use gcc 4.0.1 from Apple and gfortran 4.2.1 from CRAN. This is how the  
release is built.

FWIW: Although it is a nice exercise, I'm not quite sure why you want  
to build R from sources unless you want to modify it - note that your  
result is likely to be incompatible with the packages we create  
(unless you build the full multi-arch universal build).

One more side-note on the tools: now that you have installed several  
tools in your system (gcc 4.0, 4.2, two different gfortrans etc.), you  
should be aware that although you can use any combination of them, the  
library lookup is common to all, so unless you de-install the gfortran  
from /usr/local/bin (the CRAN verison) [via /usr/local/bin/gfortran- 
uninstall], even the binaries compiled with the Leopard gfotran (/usr/ 
bin/gfortran-4.2] will be linked to the /usr/local/lib/libgfortran  
dynamic library, because it has higher precedence than the static  
library that the system gfortran supplies. This is not really a  
problem as long as you are aware of it, but it that reduces the  
portability of your binaries a bit (you'll have to ship the gfortran  
shared library with your binaries if they use Fortran). If you don't  
understand what I'm saying, don't worry too much :) it doesn't affect  
anything as long as you stay on the same machine.

Cheers,
Simon