[R-SIG-Mac] [Rd] MacOS 10.4 gcc-4.0 and libcc_dynamic

Bill Northcott w.northcott at unsw.edu.au
Wed Jul 13 02:33:50 CEST 2005


On 12/07/2005, at 7:23 PM, stefano iacus wrote:
> g77 has never been recommended in connection with gcc 4.0 and I  
> think Simon as stated this several times in R-devel/R-Sig-Mac and  
> also on his wiki pages on R.
> stefano

This is the text from the 'R for Mac OS X FAQ' which is referenced  
from the main R installation instructions.

> 2.1.2 Fortran compiler (g77 3.3 or later)
>
> Unfortunately the Xcode tools don't include a Fortran compiler. You  
> need to install a version 3.3 or later of the Fortran compiler from  
> gcc which is built for Mac OS X. R 2.1.1 CRAN binary comes with GNU  
> Fortran 77 3.4.2 optional package. If you plan to install packages  
> from sources, select "custom install" during R installation and  
> enable the GNU Fortran compiler from the list of packages. The CRAN  
> binaries are configured to use gcc 3.3 and the supplied Fortran  
> compiler.
>
> Please note that it is important that the version of the Fortran  
> compiler matches the version of your C compiler! The build will  
> likely fail if that is not the case. It is also highly recommended  
> to use compiler with static supporting libraries. Especially for  
> gfortran 4.0 it is highly recommended to remove any dynamic  
> libraries such as libgfortran.dylib. Failing to do so will produce  
> binaries that fail all checks (see R-admin documentation for  
> details - this issue is not Mac-specific).
This is quite adequate for Panther, but is likely to lead people into  
problems with Tiger where gcc-4 is the default.

The current CRAN binary includes g77 from gcc-3.4.2.  This will not  
work on Tiger unless the user does a 'sudo gcc_select 3.3' to change  
the default compiler.  It would be good to document this.

> Please note that it is important that the version of the Fortran  
> compiler matches the version of your C compiler!
IMHO this is a tad confusing, given that the paragraph above says use  
g77 3.4.2 with gcc 3.3!  Do these match?  AFAIK it is only the major  
version numbers that need to match.  I think it would be much more  
helpful to be explicit and say use g77 3.x.x with Apple gcc 3.x.x  
and, only on Tiger, gfortran with gcc-4.x.x.  This is of course where  
I came in: the configure script should check this and provide an  
appropriate error message if there is a mismatch.

Finally the bit about removing dynamic libraries confuses me.  Martyn  
gave the same dire warnings about building JAGS, but they just don't  
seem to apply to my set ups.  I have all the dynamic libraries  
installed and the R I build from sources passes all the checks.  What  
is it that gives people problems?

Bill Northcott



More information about the R-SIG-Mac mailing list