lh3 / ropebwt2

Incremental construction of FM-index for DNA sequences
MIT License
68 stars 5 forks source link

Fixes compilation error (gcc 10.0.1) #4

Closed ldenti closed 3 years ago

ldenti commented 4 years ago

Hi, ropebwt2 failed to compile on my system with gcc 10.0.1. Here's the compilation error (here the full log):

gcc -g -Wall -O2   rle.o rope.o mrope.o rld0.o crlf.o main.o -o ropebwt2 -lz -lpthread
/usr/bin/ld: rope.o:/home/luca/Software/ropebwt2/rle.h:33: multiple definition of `rle_auxtab'; rle.o:/home/luca/Software/ropebwt2/rle.h:33: first defined here
/usr/bin/ld: main.o:/home/luca/Software/ropebwt2/rle.h:33: multiple definition of `rle_auxtab'; rle.o:/home/luca/Software/ropebwt2/rle.h:33: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:16: ropebwt2] Error 1

The problem is that rle_auxtab is defined in rle.h which is included in multiple files. Making rle_auxtab extern seems to solve it.

pdimens commented 3 years ago

I just encountered this issue myself. Hopefully it gets merged. Thank you @ldenti for the fix!

lh3 commented 3 years ago

I knew gcc10 has raised the bar. Thanks for the fix.