[R-SIG-Mac] Building R-2.4 on MacOS X

Bill Northcott w.northcott at unsw.edu.au
Mon Dec 4 10:42:49 CET 2006


I am helping Martyn Plummer to keep JAGS running on MacOS X.  For  
those who don't know, JAGS is an MCMC package which reproduces most  
of the functionality of BUGS.  It is written in C++ and uses the  
standalone libRmath.  The intention is that at some point it will  
become an R package.

As part of my effort to correct the build problems of JAGS when using  
R-2.4.0 I have been making universal builds of R-2.4.0 from source  
with MacOS X 10.4.8 and Xcode 2.4.1.  I am using the grfortran  
compiler included in the CRAN binary.  I have a number of questions  
from these.

1.  The CRAN binary contains a library libBlasVeclib.dylib.   
Following the build method in 'The MacOS X R FAQ' this library is not  
built.  What is the library for and would it be worth building?

2.  I am not happy putting the R compiler directory (/usr/local/ 
gcc4.0/bin) up the front of the path because it effectively replaces  
the default gcc and g++.  I have made the builds by setting F77=/usr/ 
local/gcc4.0/bin/gfortran and letting the Apple compilers do the C  
and C++ code.  The resulting binaries pass 'make check-all' on both  
ppc and i386 with no failures.  Is there any point using the R  
supplied gcc and g++?

3.  Building JAGS we often have problems at the linking stage with  
many multiply defined symbols.  These are due to libtool including  
libraries (libgcc_s and libSystem) which are already included by the  
system.  I submitted a patch suggestion to the autoconf maintainers  
to get rid of these problems by similar methods to that used for  
libcrt*.  These have been accepted and are in the autoconf cvs  
sources but not yet released.
m4/R.m4 line 826 includes an exclusion which implements the changes  
to exclude libcrt* which are now implemented in released versions of  
autoconf.  The upcoming changes to exclude libgcc* and libSystem can  
be implemented by adding '| -lgcc* | -lSystem' to the above  
referenced line.  ( of course one needs to run 'aclocal -I m4' and  
autoconf after the change)  My binary is built with this change and  
it works without problem.

Thanks for any help
Bill Northcott



More information about the R-SIG-Mac mailing list