bioinformatics-centre / kaiju

Fast taxonomic classification of metagenomic sequencing reads using a protein reference database
http://kaiju.binf.ku.dk
GNU General Public License v3.0
260 stars 68 forks source link

Compiling error (tried using gcc version 5.1.1 and 5.4.0): #21

Closed gisleDK closed 7 years ago

gisleDK commented 7 years ago

Hi tried updating the compiler to 5.4.0 but still same error. This link suggests that the problem could be that -lpthread is included several times although I fail to see where.

make
make -C bwt/
make[1]: Entering directory `/project/genomics/Gisle/Bin/Programs/kaiju-master/src/bwt'
gcc -O3 -g -Wno-unused-result   -c -o mkbwt.o mkbwt.c
gcc -O3 -g -Wno-unused-result   -c -o readFasta.o readFasta.c
gcc -O3 -g -Wno-unused-result   -c -o suffixArray.o suffixArray.c
gcc -O3 -g -Wno-unused-result   -c -o multikeyqsort.o multikeyqsort.c
gcc -O3 -g -Wno-unused-result   -c -o sequence.o sequence.c
gcc   mkbwt.o readFasta.o suffixArray.o multikeyqsort.o sequence.o  -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lm -o mkbwt
/usr/lib64/libpthread_nonshared.a(pthread_atfork.oS): In function `__pthread_atfork':
/usr/src/packages/BUILD/glibc-2.11.3/nptl/pthread_atfork.c:57: multiple definition of `__pthread_atfork'
/usr/lib64/libpthread_nonshared.a(pthread_atfork.oS):/usr/src/packages/BUILD/glibc-2.11.3/nptl/pthread_atfork.c:57: first defined here
/usr/lib64/libpthread_nonshared.a(pthread_atfork.oS): In function `__pthread_atfork':
/usr/src/packages/BUILD/glibc-2.11.3/nptl/pthread_atfork.c:57: multiple definition of `pthread_atfork'
/usr/lib64/libpthread_nonshared.a(pthread_atfork.oS):/usr/src/packages/BUILD/glibc-2.11.3/nptl/pthread_atfork.c:57: first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [mkbwt] Error 1
make[1]: Leaving directory `/project/genomics/Gisle/Bin/Programs/kaiju-master/src/bwt'
make: *** [bwt/mkbwt] Error 2
gisleDK commented 7 years ago

Problem solved by changing static: LDFLAGS = -static to LDFLAGS = -static in both makefile and bwt/Makefile

pmenzel commented 7 years ago

Great that it works now. Your change should be the same as just doing make static.

Maybe something isn't right in your glibc library setup, so that the normal build does not work and the static build works. I also have gcc 5.4.0 on Ubuntu here and it compiles fine.

gisleDK commented 7 years ago

Probably one of the joys of having several compilers installed locally. Thanks for the suggestion!