[R-SIG-Mac] Problems compiling R-2.2.0 from source on macos 10.4.2

Bill Northcott w.northcott at internode.on.net
Wed Oct 12 01:10:56 CEST 2005


On 11/10/2005, at 8:00 PM, Sean Davis  wrote:
> I am trying to install R from source on macos 10.4.2.  Any  
> suggestions as to
> what the compile error below means and what I can do to fix it?

> stuff removed

> ld: common symbols not allowed with MH_DYLIB output format with the
> -multi_module option
> /usr/local/gfortran/lib/libgfortran.a(lock.o) definition of common
> __gfortran_ioparm (size 248)
> /usr/local/gfortran/lib/libgfortran.a(compile_options.o) definition of
> common __gfortrani_compile_options (size 8)
> /usr/local/gfortran/lib/libgfortran.a(environ.o) definition of common
> __gfortrani_options (size 92)
> /usr/local/gfortran/lib/libgfortran.a(lock.o) private external  
> definition of
> common __gfortrani_g (size 824)
> /usr/local/gfortran/lib/libgfortran.a(lock.o) private external  
> definition of
> common __gfortrani_ionml (size 4)

This is your problem.  Common symbols are not allowed in dylibs.

All your compile commands during the build should contain the '-fno- 
common' flag.  There must be some which are wrong.  Have a search of  
the build log and send a few of the compile lines which don't have  
the flag.  That might enable us to see where it breaks.

Also you may well have compiler compatibility issues as Jan  
suggests.  I would be fairly sure that the 4.1.x version of gfortran  
has issues with the gcc-4.0.x as a driver.   You are using a well out  
of date version of Apple's gcc-4.  The current shipping Xcode 2.1/2.2  
is 5026.

>
> Thanks for pointing that out.  I have found gcc in CVS, but I don't  
> see
> gfortran in apple CVS.  What am I missing?

If you want gcc code get it from the main gcc cvs (soon to be  
Subversion) repository.  See instructions at gcc.gnu.org.
To get Apple compiler code use a tag like apple-gcc-5026, which will  
get you the source for the current release Apple compiler.  Current  
experimental code has tags like apple-gcc-52XX.

These sources include the source for gfortran.  The code is in the  
gcc/fortran and libgfortran directories. To build it you add 'f95' to  
the enable-compilers option around line 102 of the build gcc script.   
You will also need the GMP library and if you need to use a G5 for  
the build unless you want to patch the configure script.  Finally  
when the build completes, you need to get the run time libraries in  
the right place.

You can find a ready built Apple gcc 5026 with gfortran at  
www.swarm.org.  I hope to update that in the near future to use the  
4.0.2 release gfortran which fixes a big heap of bugs.

Bill Northcott



More information about the R-SIG-Mac mailing list