Hi, I am having trouble compiling package gap http://www.hgmp.mrc.ac.uk/~jzhao/r-progs.htm on Tiger. I have installed XcodeTools 2.1. The binary version of gap currently available on CRAN has some bug and is fixed in the latest version. The message I get from R is below. Any help is greatly appreciated. best regards, Kenny Ye tar: Read 1536 bytes from - * Installing *source* package 'gap' ... ** libs gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c 2k.c -o 2k.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c 2ld.c -o 2ld.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c cline.c -o cline.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c gc.c -o gc.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c gcontrol.c -o gcontrol.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c gif.c -o gif.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c hap.c -o hap.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c hwe.hardy.c -o hwe.hardy.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c kin.morgan.c -o kin.morgan.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c makeped.c -o makeped.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c mia.c -o mia.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c muvar.c -o muvar.o g77 -fno-common -g -O2 -c pfc.f -o pfc.o g77 -fno-common -g -O2 -c pfc.sim.f -o pfc.sim.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c pgc.c -o pgc.o gcc-3.3 -no-cpp-precomp -I/Library/Frameworks/R.framework/Resources/include -I/usr/local/include -fno-common -g -O2 -c whscore.c -o whscore.o gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o gap.so 2k.o 2ld.o cline.o gc.o gcontrol.o gif.o hap.o hwe.hardy.o kin.morgan.o makeped.o mia.o muvar.o pfc.o pfc.sim.o pgc.o whscore.o -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -lg2c -lSystem -framework R ** Removing '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/gap' npackage installation failed ld: warning multiple definitions of symbol _i1mach_ pfc.sim.o definition of _i1mach_ in section (__TEXT,__text) /Library/Frameworks/R.framework/R(i1mach.lo) definition of _i1mach_ ld: 2ld.o has external relocation entries in non-writable section (__TEXT,__text) for symbols: restFP saveFP make: *** [gap.so] Error 1 ERROR: compilation failed for package 'gap' ** Restoring previous '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/gap' ** Removing '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/pathmix' ** Removing '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/pointer'
Isn't this the age-old story of the MacOS X Fortran compiler not fully supporting compilation for dynamic libraries? Looks like the same sort of problem it has with LAPACK code. You could try rewriting the code to avoid DATA statements. Asking MacOS-specific questions on the r-sig-mac is a better idea than using a general list. On Thu, 23 Jun 2005, Kenny Ye wrote:> Hi, I am having trouble compiling package gap > http://www.hgmp.mrc.ac.uk/~jzhao/r-progs.htm on Tiger. I have installed > XcodeTools 2.1. The binary version of gap currently available on CRAN > has some bug and is fixed in the latest version. > > The message I get from R is below. Any help is greatly appreciated. > > best regards, > > Kenny Ye > > tar: Read 1536 bytes from - > * Installing *source* package 'gap' ... > ** libs > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c 2k.c -o 2k.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c 2ld.c -o 2ld.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c cline.c -o cline.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c gc.c -o gc.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c gcontrol.c -o gcontrol.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c gif.c -o gif.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c hap.c -o hap.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c hwe.hardy.c -o hwe.hardy.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c kin.morgan.c -o kin.morgan.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c makeped.c -o makeped.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c mia.c -o mia.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c muvar.c -o muvar.o > g77 -fno-common -g -O2 -c pfc.f -o pfc.o > g77 -fno-common -g -O2 -c pfc.sim.f -o pfc.sim.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c pgc.c -o pgc.o > gcc-3.3 -no-cpp-precomp > -I/Library/Frameworks/R.framework/Resources/include > -I/usr/local/include -fno-common -g -O2 -c whscore.c -o whscore.o > gcc-3.3 -bundle -flat_namespace -undefined suppress -L/usr/local/lib -o > gap.so 2k.o 2ld.o cline.o gc.o gcontrol.o gif.o hap.o hwe.hardy.o > kin.morgan.o makeped.o mia.o muvar.o pfc.o pfc.sim.o pgc.o whscore.o > -L/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2 -lg2c -lSystem > -framework R > ** Removing > '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/gap' > npackage installation failed > ld: warning multiple definitions of symbol _i1mach_ > pfc.sim.o definition of _i1mach_ in section (__TEXT,__text) > /Library/Frameworks/R.framework/R(i1mach.lo) definition of _i1mach_ > ld: 2ld.o has external relocation entries in non-writable section > (__TEXT,__text) for symbols: > restFP > saveFP > make: *** [gap.so] Error 1 > ERROR: compilation failed for package 'gap' > ** Restoring previous > '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/gap' > ** Removing > '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/pathmix' > ** Removing > '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/pointer' > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 24/06/2005, at 8:00 PM, Kenny Ye wrote:> Hi, I am having trouble compiling package gap > http://www.hgmp.mrc.ac.uk/~jzhao/r-progs.htm on Tiger. I have > installed > XcodeTools 2.1. The binary version of gap currently available on CRAN > has some bug and is fixed in the latest version. > ........ > '/Library/Frameworks/R.framework/Versions/2.1.0/Resources/library/gap' > npackage installation failed > ld: warning multiple definitions of symbol _i1mach_ > pfc.sim.o definition of _i1mach_ in section (__TEXT,__text) > /Library/Frameworks/R.framework/R(i1mach.lo) definition of _i1mach_ > ld: 2ld.o has external relocation entries in non-writable section > (__TEXT,__text) for symbols: > restFP > saveFP > make: *** [gap.so] Error 1 > ERROR: compilation failed for package 'gap'This is caused by using a gcc Fortran compiler build from FSF code with a gcc C compiler built from Apple code. The Apple gcc library has the restFP, saveFP symbols and these are used by the Apple compiler. So if you try link Fortran code built with an FSF compiler, with an Apple C code library, it will fail because the FSF gcc library included in the link by the Fortran compiler does not have these symbols to satisfy the undefined symbols in the C library. For the full story see: http://www.astro.gla.ac.uk/users/norman/note/2004/restFP/ There are two possible fixes: 1. Use a gcc Fortran compiler built with Apple code such as the one available at www.swarm.org. You might also try recent builds from hpc.sourceforge.net. or 2. Include the Apple gcc library in the link. The standard way of doing this was via a symlink at /usr/lib/libcc_dynamic.a which linked to libgcc.a in the Apple compiler. Then -lcc_dynamic was included in the LDFLAGS. I think this link was dropped in recent versions of MacOS X, around the time they stopped shipping gcc 2.95. You can put in the symlink yourself if its not there, and add the ld flag to the R configuration. Bill Northcott