shane-c-lawson / breseq

Automatically exported from code.google.com/p/breseq
Other
0 stars 0 forks source link

0.21+ fails to build on OS X 10.7 with clang 4.1 #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Attempt to build breseq-0.21 (or mercurial head) on OS X 10.7 using clang as 
the compiler
2. Get an error linking samtools

make[2]: Entering directory `/src/breseq-0.21/extern/samtools-0.1.15'
/bin/sh ../../libtool --tag=CC   --mode=link gcc -D_CURSES_LIB=1 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -g -O2 -static  
-L/sw/lib -o samtools samtools-bam_tview.o samtools-bam_maqcns.o 
samtools-sam_view.o samtools-bam_rmdup.o samtools-bam_rmdupse.o 
samtools-bam_mate.o samtools-bam_stat.o samtools-bam_color.o samtools-bamtk.o 
samtools-kaln.o samtools-errmod.o samtools-sample.o samtools-cut_target.o 
samtools-bam2depth.o samtools-bam_plcmd.o samtools-bam2bcf.o 
samtools-bam2bcf_indel.o samtools-phase.o libbam.la bcftools/libbcf.la -lz 
-lcurses 
libtool: link: gcc -D_CURSES_LIB=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE 
-D_USE_KNETFILE -g -O2 -o samtools samtools-bam_tview.o samtools-bam_maqcns.o 
samtools-sam_view.o samtools-bam_rmdup.o samtools-bam_rmdupse.o 
samtools-bam_mate.o samtools-bam_stat.o samtools-bam_color.o samtools-bamtk.o 
samtools-kaln.o samtools-errmod.o samtools-sample.o samtools-cut_target.o 
samtools-bam2depth.o samtools-bam_plcmd.o samtools-bam2bcf.o 
samtools-bam2bcf_indel.o samtools-phase.o  -L/sw/lib ./.libs/libbam.a 
bcftools/.libs/libbcf.a -lz -lcurses
Undefined symbols for architecture x86_64:
  "___ks_insertsort_heap", referenced from:
      _ks_combsort_heap in libbam.a(libbam_la-bam_sort.o)
      _ks_introsort_heap in libbam.a(libbam_la-bam_sort.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

$ clang -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)

Using llvm-gcc as the compiler allows breseq to fully build.  However, llvm-gcc 
will soon be removed from Apple's Xcode (gcc is now fully gone), so having 
breseq will eventually need to work with clang or any compiler that follows the 
C99 standard (or it will require an external build of gcc).

http://news.softpedia.com/news/Apple-Confirms-Deprecation-of-ATS-framework-in-Xc
ode-4-6-Developer-Preview-1-304229.shtml

I think the cause is related to inline functions (sorry, not a programmer): 
http://clang.llvm.org/compatibility.html#inline

And I think the culprit is line 144 of extern/samtools-0.1.15/ksort.h, where 
"inline void __ks_insertsort_##name" should be "static inline" instead.

Original issue reported on code.google.com by niederst...@gmail.com on 14 Nov 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Thank you for alerting us to this problem and the helpful links. This 
particular culprit is in the samtools code, so we will see if it persists when 
we update that and also check for incompatibilities in our own code.

Original comment by jeffrey....@gmail.com on 16 Nov 2012 at 3:00

GoogleCodeExporter commented 8 years ago
Fixed upstream: 
https://github.com/samtools/samtools/commit/64275b4bd65b94ae426ba94768b19d198dcb
7c97

Original comment by niederst...@gmail.com on 11 Dec 2012 at 11:43

GoogleCodeExporter commented 8 years ago
Thanks! The version of Samtools bundled with breseq has been updated to 0.18 
with your compilation patch, so that will make it into the 0.22 release  -- 
though I do not have the means to test compilation.

Original comment by jeffrey....@gmail.com on 21 Dec 2012 at 1:18

GoogleCodeExporter commented 8 years ago
Confirm that the samtools issue is fixed in breseq-hg on clang from OS X.

Testing for clang issues should be easy to do if your OS distribution includes 
a clang compiler package. CC and CXX envvars can be used to test different 
compilers.

Original comment by niederst...@gmail.com on 21 Dec 2012 at 3:28