Nextomics / NextPolish

Fast and accurately polish the genome generated by long reads.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation failure with multiple definition of 'rle_auxtab'

tatsu1207 opened this issue · comments

Hello,

I'd like to install NextPolish on my Ubuntu 22.04 (server) and I downloaded the source file with this command:
wget https://github.com/Nextomics/NextPolish/releases/latest/download/NextPolish.tgz

then unarchived the tar ball, then executed 'make' as instructed.
The installation stoped in the middle. The second 'make' execution showed below error. Please help me fix this.

Thank you,
Tatsu

make -C util;
make[1]: Entering directory '/home/unnot/install/NextPolish/util'
make[2]: Entering directory '/home/unnot/install/NextPolish/util/bwa'
gcc -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS bwashm.o bwase.o bwaseqio.o bwtgap.o bwtaln.o bamlite.o bwape.o kopen.o pemerge.o maxk.o bwtsw2_core.o bwtsw2_main.o bwtsw2_aux.o bwt_lite.o bwtsw2_chain.o fastmap.o bwtsw2_pair.o main.o -o bwa -L. -lbwa -lm -lz -lpthread -lrt
/usr/bin/ld: ./libbwa.a(rope.o):/home/unnot/install/NextPolish/util/bwa/rle.h:33: multiple definition of rle_auxtab'; ./libbwa.a(bwtindex.o):/home/unnot/install/NextPolish/util/bwa/rle.h:33: first defined here /usr/bin/ld: ./libbwa.a(rle.o):/home/unnot/install/NextPolish/util/bwa/rle.h:33: multiple definition of rle_auxtab'; ./libbwa.a(bwtindex.o):/home/unnot/install/NextPolish/util/bwa/rle.h:33: first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:30: bwa] Error 1
make[2]: Leaving directory '/home/unnot/install/NextPolish/util/bwa'
make[1]: *** [Makefile:19: bwa_] Error 2
make[1]: Leaving directory '/home/unnot/install/NextPolish/util'
make: *** [Makefile:18: all] Error 2

Hi, if your system has already installed bwa and samtools, You can also use your own alignment pipeline see here, to avoid these installation problems.

I also encountered the same error and found a solution. This seems to be due to a version issue with GCC. You need to replace "const uint8_t rle_auxtab[8];" in line 33 of the rle.h file in the bwa directory with "extern const uint8_t rle_auxtab[8];".
This solution was inspired by this link: lh3/bwa@2a1ae7b

"GCC 10 defaults to -fno-common, which makes C behave more like C++ in that you can only ever have one definition of an object per executable."

I also encountered the same error and found a solution. This seems to be due to a version issue with GCC. You need to replace "const uint8_t rle_auxtab[8];" in line 33 of the rle.h file in the bwa directory with "extern const uint8_t rle_auxtab[8];". This solution was inspired by this link: lh3/bwa@2a1ae7b

"GCC 10 defaults to -fno-common, which makes C behave more like C++ in that you can only ever have one definition of an object per executable."

Your fix works for me too. Thanks a lot for sharing your solution.