aquaskyline / SOAPdenovo2

Next generation sequencing reads de novo assembler.
GNU General Public License v3.0
220 stars 78 forks source link

Make error with Ubuntu 18.04 LTS #58

Closed elvenwhite closed 5 years ago

elvenwhite commented 5 years ago

Under Ubuntu 18.04 LTS, the error persists even if with locally compiled libbam.a. (I haven't had any problem under Ubuntu 14.04 LTS though) Here's result with local libbam.a :

pregraph_sparse_63mer.v1.0.3 cleaning done.
pregraph_sparse_63mer.v1.0.3 objects generated.
SOAPdenovo-63mer cleaning done.
SOAPdenovo-63mer objects generated.
sparsePregraph/io_func.o: In function `read1seqbam(char*, char*, int, samfile_t*, int*) [clone .constprop.58]':
io_func.cpp:(.text+0x47): undefined reference to `samread'
io_func.cpp:(.text+0xe2): undefined reference to `bam_format1_core'
sparsePregraph/io_func.o: In function `read1seqbam(char*, char*, int, samfile_t*, int*)':
io_func.cpp:(.text+0x66a): undefined reference to `samread'
io_func.cpp:(.text+0x70a): undefined reference to `bam_format1_core'
standardPregraph/readseq1by1.o: In function `read1seqbam':
readseq1by1.c:(.text+0xac7): undefined reference to `samread'
readseq1by1.c:(.text+0xaec): undefined reference to `bam_format1_core'
./sparsePregraph/inc/libbam.a(sam.o): In function `samthreads':
/home/yisoo/samtools-1.9/sam.c:35: undefined reference to `hts_get_format'
/home/yisoo/samtools-1.9/sam.c:36: undefined reference to `bgzf_mt'
./sparsePregraph/inc/libbam.a(sam.o): In function `samopen':
/home/yisoo/samtools-1.9/sam.c:43: undefined reference to `hts_open'
/home/yisoo/samtools-1.9/sam.c:55: undefined reference to `hts_set_fai_filename'
/home/yisoo/samtools-1.9/sam.c:61: undefined reference to `sam_hdr_read'
/home/yisoo/samtools-1.9/sam.c:68: undefined reference to `hts_verbose'
/home/yisoo/samtools-1.9/sam.c:72: undefined reference to `hts_get_format'
/home/yisoo/samtools-1.9/sam.c:76: undefined reference to `sam_hdr_write'
/home/yisoo/samtools-1.9/sam.c:77: undefined reference to `hts_verbose'
/home/yisoo/samtools-1.9/sam.c:79: undefined reference to `hts_close'
/home/yisoo/samtools-1.9/sam.c:48: undefined reference to `hts_close'
./sparsePregraph/inc/libbam.a(sam.o): In function `samclose':
/home/yisoo/samtools-1.9/sam.c:92: undefined reference to `bam_hdr_destroy'
/home/yisoo/samtools-1.9/sam.c:93: undefined reference to `hts_close'
./sparsePregraph/inc/libbam.a(sam.o): In function `samfetch':
/home/yisoo/samtools-1.9/sam.c:100: undefined reference to `bam_init1'
/home/yisoo/samtools-1.9/sam.c:101: undefined reference to `sam_itr_queryi'
/home/yisoo/samtools-1.9/sam.c:103: undefined reference to `hts_itr_next'
/home/yisoo/samtools-1.9/sam.c:104: undefined reference to `hts_itr_destroy'
/home/yisoo/samtools-1.9/sam.c:105: undefined reference to `bam_destroy1'
./sparsePregraph/inc/libbam.a(sam.o): In function `sampileup':
/home/yisoo/samtools-1.9/sam.c:114: undefined reference to `bam_init1'
./sparsePregraph/inc/libbam.a(sam.o): In function `samread':
/home/yisoo/samtools-1.9/sam.h:95: undefined reference to `sam_read1'
./sparsePregraph/inc/libbam.a(sam.o): In function `sampileup':
/home/yisoo/samtools-1.9/sam.c:125: undefined reference to `bam_destroy1'
./sparsePregraph/inc/libbam.a(sam.o): In function `samfaipath':
/home/yisoo/samtools-1.9/sam.c:139: undefined reference to `hts_verbose'
/home/yisoo/samtools-1.9/sam.c:140: undefined reference to `fai_build'
./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function `bam_plbuf_init':
/home/yisoo/samtools-1.9/bam_plbuf.c:47: undefined reference to `bam_plp_init'
./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function `bam_plbuf_destroy':
/home/yisoo/samtools-1.9/bam_plbuf.c:55: undefined reference to `bam_plp_destroy'
./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function `bam_plbuf_push':
/home/yisoo/samtools-1.9/bam_plbuf.c:63: undefined reference to `bam_plp_push'
/home/yisoo/samtools-1.9/bam_plbuf.c:65: undefined reference to `bam_plp_next'
./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function `bam_plbuf_reset':
/home/yisoo/samtools-1.9/bam_plbuf.c:40: undefined reference to `bam_plp_reset'
collect2: error: ld returned 1 exit status
Makefile:56: recipe for target 'SOAPdenovo-63mer' failed
make: *** [SOAPdenovo-63mer] Error 1

and with shipped libbam.a :


pregraph_sparse_63mer.v1.0.3 objects generated.
SOAPdenovo-63mer cleaning done.
SOAPdenovo-63mer objects generated.
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_import.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_pileup.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(faidx.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(knetfile.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam_header.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bgzf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(kstring.o): relocation R_X86_64_32 against `.text' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_aux.o): relocation R_X86_64_32S against `.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ./sparsePregraph/inc/libbam.a(razf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:56: recipe for target 'SOAPdenovo-63mer' failed
make: *** [SOAPdenovo-63mer] Error 1```

_Originally posted by @elvenwhite in https://github.com/aquaskyline/SOAPdenovo2/issues/39#issuecomment-493906074_
aquaskyline commented 5 years ago

Please download the source code of samtools 0.1.19, compile and use the libbam.a so generated.

On Mon, May 20, 2019 at 5:42 PM elvenwhite notifications@github.com wrote:

Under Ubuntu 18.04 LTS, the error persists even if with locally compiled libbam.a. (I haven't had any problem under Ubuntu 14.04 LTS though) Here's result with local libbam.a :

pregraph_sparse_63mer.v1.0.3 cleaning done. pregraph_sparse_63mer.v1.0.3 objects generated. SOAPdenovo-63mer cleaning done. SOAPdenovo-63mer objects generated. sparsePregraph/io_func.o: In function read1seqbam(char*, char*, int, samfile_t*, int*) [clone .constprop.58]': io_func.cpp:(.text+0x47): undefined reference tosamread' io_func.cpp:(.text+0xe2): undefined reference to bam_format1_core' sparsePregraph/io_func.o: In functionread1seqbam(char, char, int, samfile_t, int)': io_func.cpp:(.text+0x66a): undefined reference to samread' io_func.cpp:(.text+0x70a): undefined reference tobam_format1_core' standardPregraph/readseq1by1.o: In function read1seqbam': readseq1by1.c:(.text+0xac7): undefined reference tosamread' readseq1by1.c:(.text+0xaec): undefined reference to bam_format1_core' ./sparsePregraph/inc/libbam.a(sam.o): In functionsamthreads': /home/yisoo/samtools-1.9/sam.c:35: undefined reference to hts_get_format' /home/yisoo/samtools-1.9/sam.c:36: undefined reference tobgzf_mt' ./sparsePregraph/inc/libbam.a(sam.o): In function samopen': /home/yisoo/samtools-1.9/sam.c:43: undefined reference tohts_open' /home/yisoo/samtools-1.9/sam.c:55: undefined reference to hts_set_fai_filename' /home/yisoo/samtools-1.9/sam.c:61: undefined reference tosam_hdr_read' /home/yisoo/samtools-1.9/sam.c:68: undefined reference to hts_verbose' /home/yisoo/samtools-1.9/sam.c:72: undefined reference tohts_get_format' /home/yisoo/samtools-1.9/sam.c:76: undefined reference to sam_hdr_write' /home/yisoo/samtools-1.9/sam.c:77: undefined reference tohts_verbose' /home/yisoo/samtools-1.9/sam.c:79: undefined reference to hts_close' /home/yisoo/samtools-1.9/sam.c:48: undefined reference tohts_close' ./sparsePregraph/inc/libbam.a(sam.o): In function samclose': /home/yisoo/samtools-1.9/sam.c:92: undefined reference tobam_hdr_destroy' /home/yisoo/samtools-1.9/sam.c:93: undefined reference to hts_close' ./sparsePregraph/inc/libbam.a(sam.o): In functionsamfetch': /home/yisoo/samtools-1.9/sam.c:100: undefined reference to bam_init1' /home/yisoo/samtools-1.9/sam.c:101: undefined reference tosam_itr_queryi' /home/yisoo/samtools-1.9/sam.c:103: undefined reference to hts_itr_next' /home/yisoo/samtools-1.9/sam.c:104: undefined reference tohts_itr_destroy' /home/yisoo/samtools-1.9/sam.c:105: undefined reference to bam_destroy1' ./sparsePregraph/inc/libbam.a(sam.o): In functionsampileup': /home/yisoo/samtools-1.9/sam.c:114: undefined reference to bam_init1' ./sparsePregraph/inc/libbam.a(sam.o): In functionsamread': /home/yisoo/samtools-1.9/sam.h:95: undefined reference to sam_read1' ./sparsePregraph/inc/libbam.a(sam.o): In functionsampileup': /home/yisoo/samtools-1.9/sam.c:125: undefined reference to bam_destroy1' ./sparsePregraph/inc/libbam.a(sam.o): In functionsamfaipath': /home/yisoo/samtools-1.9/sam.c:139: undefined reference to hts_verbose' /home/yisoo/samtools-1.9/sam.c:140: undefined reference tofai_build' ./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function bam_plbuf_init': /home/yisoo/samtools-1.9/bam_plbuf.c:47: undefined reference tobam_plp_init' ./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function bam_plbuf_destroy': /home/yisoo/samtools-1.9/bam_plbuf.c:55: undefined reference tobam_plp_destroy' ./sparsePregraph/inc/libbam.a(bam_plbuf.o): In function bam_plbuf_push': /home/yisoo/samtools-1.9/bam_plbuf.c:63: undefined reference tobam_plp_push' /home/yisoo/samtools-1.9/bam_plbuf.c:65: undefined reference to bam_plp_next' ./sparsePregraph/inc/libbam.a(bam_plbuf.o): In functionbam_plbuf_reset': /home/yisoo/samtools-1.9/bam_plbuf.c:40: undefined reference to `bam_plp_reset' collect2: error: ld returned 1 exit status Makefile:56: recipe for target 'SOAPdenovo-63mer' failed make: *** [SOAPdenovo-63mer] Error 1

and with shipped libbam.a :

pregraph_sparse_63mer.v1.0.3 objects generated. SOAPdenovo-63mer cleaning done. SOAPdenovo-63mer objects generated. /usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_import.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam.o): relocation R_X86_64_32 against .rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_pileup.o): relocation R_X86_64_32 against.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(faidx.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(knetfile.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(sam_header.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(bgzf.o): relocation R_X86_64_32 against.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(kstring.o): relocation R_X86_64_32 against .text' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(bam_aux.o): relocation R_X86_64_32S against.rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ./sparsePregraph/inc/libbam.a(razf.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status Makefile:56: recipe for target 'SOAPdenovo-63mer' failed make: *** [SOAPdenovo-63mer] Error 1```

Originally posted by @elvenwhite in https://github.com/aquaskyline/SOAPdenovo2/issues/39#issuecomment-493906074

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aquaskyline/SOAPdenovo2/issues/58?email_source=notifications&email_token=AAG2SONX2LTI4WD6ICW5LODPWJW65A5CNFSM4HOAG732YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4GUVW5JQ, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG2SOLW6PAPOQ2L7SWW4PDPWJW65ANCNFSM4HOAG73Q .

-- Laurent

elvenwhite commented 5 years ago

Thanks, I managed to build it. I had a mistake and kept trying to use samtools 1.9 instead of 0.1.19.