[R-SIG-Mac] Build error in gfortran compiler packaged in binary

Bill Northcott w.northcott at unsw.edu.au
Wed Feb 14 07:08:44 CET 2007


I have been trying to build a ppc64 version of R from source using  
the gfortran compiler included in the CRAN binary distribution.

My build is failing thus:
make[5]: `Makedeps' is up to date.
Error in dyn.load(x, as.logical(local), as.logical(now)) :
         unable to load shared library '/Users/Shared/Public/R/ 
R-2.4.1/build-ppc64/library/tools/libs/ppc64/tools.so':
   dlopen(/Users/Shared/Public/R/R-2.4.1/build-ppc64/library/tools/ 
libs/ppc64/tools.so, 6): Symbol not found: ___mulsc3
   Referenced from: /usr/local/gcc4.0/lib/libgfortran.0.dylib
   Expected in: flat namespace
Execution halted

At this point libR.dylib, libRBlas.dylib etc have been built.

The missing symbol __mulsc3 is supplied by libgcc_s.1.dylib.

The following shows what seems to be the cause of the problem:

[PM-G5BN:R/R-2.4.1/build-ppc64] billn% otool64 -L -arch ppc64 /usr/ 
local/gcc4.0/lib/libgfortran.0.dylib
/usr/local/gcc4.0/lib/libgfortran.0.dylib:
         /usr/local/gcc4.0/lib/libgfortran.0.dylib (compatibility  
version 1.0.0, current version 1.0.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.1.5)
         /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current  
version 92.0.0)
[PM-G5BN:R/R-2.4.1/build-ppc64] billn% otool -L -arch ppc /usr/local/ 
gcc4.0/lib/libgfortran.0.dylib
/usr/local/gcc4.0/lib/libgfortran.0.dylib:
         /usr/local/gcc4.0/lib/libgfortran.0.dylib (compatibility  
version 1.0.0, current version 1.0.0)
         /usr/lib/libSystem.B.dylib (compatibility version 1.0.0,  
current version 88.1.5)
         /usr/local/gcc4.0/lib/libgcc_s.1.0.dylib (compatibility  
version 1.0.0, current version 1.0.0)
         /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current  
version 92.0.0)


that is: within libgfortran.dylib the ppc (and i386) version is  
linked to libgcc_s but for some reason the ppc64 version is not.    
Possibly the compiler was built on an Intel Mac which did not have a  
ppc64 libgcc_s.

Cheers
Bill Northcott

PS  This confuses me completely.

The G5 machine on which I am working has distinct ppc and ppc64  
libraries (libgcc_s.1.dylib and libgcc_s_ppc64.1.dylib).  There seems  
to be second (?identical) versions libgcc_s.1.0.dylib and  
libgcc_s_ppc64.1.0.dylib.  The compiler in the R binary has only one  
library (libgcc_s.1.0.dylib) which is 3 way (i386, ppc, ppc64) fat.

The MacOSX10.4u SDK included in the developer tools has only libgcc_s. 
1.dylib which is 4 way fat and symlinked as libgcc_s_ppc64.1.dylib  
and libgcc_s_x86_64.1.dylib.  Both the installed OS and the SDK have  
libgcc_s.10.4.dylib and libgcc_s.10.5.dylib which are both 4 way  
fat!  My MacBook Pro seems to have the same arrangement installed as  
in the SDK.

If I build a recent Apple compiler from source I get an arrangement  
like the installed one.

Is this stuff documented somewhere?



More information about the R-SIG-Mac mailing list