New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BWA compilation on musl-libc fails #73

lpryszcz opened this Issue Jun 16, 2016 · 2 comments


None yet
2 participants
Copy link

lpryszcz commented Jun 16, 2016

Do you plan supporting mucl-libc? Compilation of BWA on Alpine linux, failed, first at kthread.c.
I solved it by adding #include <stdint.h> to kthread.c.
But later I got an error I cannot work around:

gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  utils.c -o utils.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  kthread.c -o kthread.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  kstring.c -o kstring.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  ksw.c -o ksw.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwt.c -o bwt.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bntseq.c -o bntseq.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwa.c -o bwa.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwamem.c -o bwamem.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwamem_pair.c -o bwamem_pair.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwamem_extra.c -o bwamem_extra.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  malloc_wrap.c -o malloc_wrap.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  QSufSort.c -o QSufSort.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwt_gen.c -o bwt_gen.o
bwt_gen.c: In function 'BWTIncBuildRelativeRank':
bwt_gen.c:878:10: warning: variable 'oldInverseSa0RelativeRank' set but not used [-Wunused-but-set-variable]
  bgint_t oldInverseSa0RelativeRank = 0;
bwt_gen.c: In function 'BWTIncMergeBwt':
bwt_gen.c:952:15: warning: variable 'bitsInWordMinusBitPerChar' set but not used [-Wunused-but-set-variable]
  unsigned int bitsInWordMinusBitPerChar;
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  rope.c -o rope.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  rle.c -o rle.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  is.c -o is.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwtindex.c -o bwtindex.o
ar -csru libbwa.a utils.o kthread.o kstring.o ksw.o bwt.o bntseq.o bwa.o bwamem.o bwamem_pair.o bwamem_extra.o malloc_wrap.o QSufSort.o bwt_gen.o rope.o rle.o is.o bwtindex.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwashm.c -o bwashm.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwase.c -o bwase.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwaseqio.c -o bwaseqio.o
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  bwtgap.c -o bwtgap.o
In file included from bwtgap.c:4:0:
bwtgap.h:9:2: error: unknown type name 'u_int32_t'
  u_int32_t info; // score<<21 | i
bwtgap.h:10:2: error: unknown type name 'u_int32_t'
  u_int32_t n_mm:8, n_gapo:8, n_gape:8, state:2, n_seed_mm:6;
bwtgap.h:11:2: error: unknown type name 'u_int32_t'
  u_int32_t n_ins:16, n_del:16;
bwtgap.c: In function 'gap_push':
bwtgap.c:62:13: error: 'u_int32_t' undeclared (first use in this function)
  p->info = (u_int32_t)score<<21 | i; p->k = k; p->l = l;
bwtgap.c:62:13: note: each undeclared identifier is reported only once for each function it appears in
bwtgap.c:62:23: error: expected ';' before 'score'
  p->info = (u_int32_t)score<<21 | i; p->k = k; p->l = l;
Makefile:25: recipe for target 'bwtgap.o' failed


This comment has been minimized.

Copy link

mp15 commented Jun 16, 2016

Hmm uint32_t is the standard type, apparently u_int_32_t was defined internally by some weird implementations. I would suggest just replacing them with the proper c types.


This comment has been minimized.

Copy link

lpryszcz commented Jun 16, 2016

Thanks, adding #include <stdint.h> to kthread.c and replacing u_int32_t by uint32_t in all *.c and *.h files (sed -i[.bak] "s/u_int32_t/uint32_t/g" *.{c,h}) solved the problem.

@lpryszcz lpryszcz closed this Jun 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment