dpryan79 / SE-MEI

Tools for finding mobile element insertions from single-end datasets
GNU General Public License v2.0
23 stars 16 forks source link

Failed to compile extractSoftclipped.c #3

Open xiaoli0 opened 6 years ago

xiaoli0 commented 6 years ago

Compile failed with error message like this:

htslib/libhts.a(cram_io.o): In function `lzma_mem_deflate':
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:673: undefined reference to `lzma_stream_buffer_bound'
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:679: undefined reference to `lzma_easy_buffer_encode'
htslib/libhts.a(cram_io.o): In function `cram_compress_by_method':
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:1035: undefined reference to `BZ2_bzBuffToBuffCompress'
htslib/libhts.a(cram_io.o): In function `cram_uncompress_block':
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:961: undefined reference to `BZ2_bzBuffToBuffDecompress'
htslib/libhts.a(cram_io.o): In function `lzma_mem_inflate':
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:695: undefined reference to `lzma_easy_decoder_memusage'
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:695: undefined reference to `lzma_stream_decoder'
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:710: undefined reference to `lzma_code'
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:723: undefined reference to `lzma_code'
/home/xiaolicbs/bin/SE-MEI/htslib/cram/cram_io.c:732: undefined reference to `lzma_end'

This can be resolved by linking those two libraries: -llzma -lbz2 when compiling extractSoftclipped.c in the makefile.

Fairenough commented 5 years ago

Hi Xiao. No idea about how to do the link in makefile. Is that simply adding -llzma -lbz2 to make line like this?: $(CC) $(OPTS) $(INCLUDES) -o compactRepeats compactRepeats.o htslib/libhts.a -lz -lpthread -llzma -lbz2 $(CC) $(OPTS) $(INCLUDES) -o extractSoftclipped extractSoftclipped.o htslib/libhts.a -lz -lpthread -llzma -lbz2

dpryan79 commented 5 years ago

Yes, that should work, you can simply add that to lines 21 and 24 of the make file.

Fairenough commented 5 years ago

Thank you, Ryan. I have also tested your code to retain the read ID and CIGAR string (from biostars), they work perfectly on my data.