kbarbary / sep

Python and C library for source extraction and photometry
186 stars 58 forks source link

Duplicate symbol linker error on Mac #5

Closed cdeil closed 10 years ago

cdeil commented 10 years ago

On Mac OS X 10.9 I get this linker error

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2 -version-info 0:0:0  -o libsep.la -rpath /usr/local/lib analyse.lo aper.lo back.lo deblend.lo extract.lo lutz.lo util.lo  -lm -lc 
libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libsep.0.dylib  .libs/analyse.o .libs/aper.o .libs/back.o .libs/deblend.o .libs/extract.o .libs/lutz.o .libs/util.o   -lm -lc  -O2   -install_name  /usr/local/lib/libsep.0.dylib -compatibility_version 1 -current_version 1.0 -Wl,-single_module
duplicate symbol _sep_version_string in:
    .libs/analyse.o
    .libs/aper.o
...

Full log: https://gist.github.com/cdeil/30010fe6ab379c9252d3

I didn't look yet what the problem is, but I can tomorrow if it's not clear from the log.

kbarbary commented 10 years ago

Oops, I didn't mean to automatically close this. "hopefully fix" != "fix"

Anyway, I think the problem was a missing "extern" on that variable. Not sure why I didn't get any errors with gcc, even with -Wall

kbarbary commented 10 years ago

Thanks for testing, by the way!

kbarbary commented 10 years ago

My guess is that this is a difference between my recent version of gcc (4.8.2) and your apple version (probably 4.2)?

cdeil commented 10 years ago

Thanks for the fix ... it now works for me on Mac OS X 10.9 ... I tried with these compilers:

ChristophMacbook-2:sep deil$ gcc --version
gcc (MacPorts gcc48 4.8.2_2) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ChristophMacbook-2:sep deil$ clang --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.2.0
Thread model: posix