Skip to content

package compilation problems

3 messages · Brian Ripley, Szilard

#
Hi:

I've created a small package containing some C code. It checks and
installs on Linux, but on Mac I get the following error:

** arch - i386
gcc -arch i386 -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/i386
-I/usr/local/include    -fPIC  -g -O2 -c levenshtein.c -o levenshtein.o
gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names
-mmacosx-version-min=10.4 -undefined dynamic_lookup -single_module
-multiply_defined suppress -L/usr/local/lib -o drztools.so levenshtein.o
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
ld warning: duplicate dylib /usr/local/lib/libgcc_s.1.dylib
** arch - ppc
gcc -arch ppc -std=gnu99
-I/Library/Frameworks/R.framework/Resources/include
-I/Library/Frameworks/R.framework/Resources/include/ppc
-I/usr/local/include    -fPIC  -g -O2 -c levenshtein.c -o levenshtein.o
gcc -arch ppc -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names
-mmacosx-version-min=10.4 -undefined dynamic_lookup -single_module
-multiply_defined suppress -L/usr/local/lib -o drztools.so levenshtein.o
-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
-Wl,CoreFoundation
ld: in /usr/local/lib/libiconv.2.dylib, file is not of required architecture
collect2: ld returned 1 exit status

I have:
Mac OS 10.5
R version 2.9.1 i386-apple-darwin8.11.1 (from binary image)
Xcode 3.1.3 Developer Tools

It's the first time I'm trying to build/install a package from source on
 Mac.

(On the other hand R CMD SHLIB compiles the C code and calling it from R
also works on the Mac.)

Any help would be appreciated,
Szilard
#
Something has put /usr/local/lib/libiconv.2.dylib on your system, and 
it is not universal.  You should not need it: there is a system copy 
in /usr/lib.

You are going to need to investigate this for yourself -- it is not an 
R issue and I've no idea what might have put libiconv there.

Also note the R CMD INSTALL option

       --no-multiarch	build only the main architecture

which would have worked around this.
On Thu, 20 Aug 2009, Szilard wrote:

            

  
    
#
Thanks a lot, both suggestions helped!

(--no-multiarch helped immediately with installation, while cleaning up
/usr/local/lib/libiconv* fixed all the remaining problems).

Thanks a lot,
Szilard
Prof Brian Ripley wrote: