Please bear with me, I'm just getting into using both virtual machines and linux.

I'm having trouble installing BWA (link) on my linux virtual machine. I've tried several methods, the most complete directions I've found are from from the medical department at Cornell, but I'm probably misunderstanding what they want me to do.

I downloaded the latest version 0.7.9a from sourceforge and moved it into a folder in my home directory. The path to the file is:


I then unzipped the file:

bunzip2 bwa-0.7.9a.tar.bz2  

and then un-tared the file:

tar xvf bwa-0.7.9a.tar

Then I went into the new directory I created:

cd bwa-0.7.9a

I then used the "make command"


This is where I get hung up:

The terminal prints this error:

jp@jp-VirtualBox:~/bwa$ cd bwa-0.7.9a
jp@jp-VirtualBox:~/bwa/bwa-0.7.9a$ dir
bamlite.c   bwase.c     bwtsw2_aux.c    kopen.c    NEWS.md
bamlite.h   bwase.h     bwtsw2_chain.c  kseq.h     pemerge.c
bntseq.c    bwaseqio.c  bwtsw2_core.c   ksort.h    QSufSort.c
bntseq.h    bwtaln.c    bwtsw2.h        kstring.c      QSufSort.h
bwa.1       bwtaln.h    bwtsw2_main.c   kstring.h      qualfa2fq.pl
bwa.c       bwt.c       bwtsw2_pair.c   ksw.c      README.md
bwa.h       bwtgap.c    ChangeLog       ksw.h      utils.c
bwa-helper.js   bwtgap.h    COPYING     kthread.c      utils.h
bwamem.c    bwt_gen.c   example.c       kvec.h     xa2multi.pl
bwamem_extra.c  bwt.h       fastmap.c       main.c
bwamem.h    bwtindex.c  is.c        Makefile
bwamem_pair.c   bwt_lite.c  kbtree.h        malloc_wrap.c
bwape.c     bwt_lite.h  khash.h     malloc_wrap.h
jp@jp-VirtualBox:~/bwa/bwa-0.7.9a$ make
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS  utils.c -o utils.o
utils.c:33:18: fatal error: zlib.h: No such file or directory
 #include <zlib.h>
compilation terminated.
make: *** [utils.o] Error 1

I'm not sure how to handle this error. Could you guys provide any insight as to what needs to be done?

A second question I have pertaining to the next steps in the instructions provided by the Cornell website. It reads,

"Add bwa to your PATH by editing ~/.bashrc and adding

export PATH=$PATH:/path/to/bwa-0.5.9"

I've located .bashrc in my home directory (I can view it by using ls -a in command line, or using ctrl+h in the explorer). I'm not sure how to go about editing the file to include the appropriate line of code, i.e. do I just paste it anywhere in that file?

I've interpreted their directions to mean I should add something along the lines of

export PATH=$PATH:/home/jp/bwa/bwa-0.7.9a  

But I'm not sure if that's correct.

I have installed a much earlier version (0.5) through the following command.

get-apt install bwa

but, I do not want to use an outdated version of this program.

Any help you guys would be able to give me would be greatly appreciated.


Host Machine OS: Windows 7 Home Premium (64 bit) (Service Pack 1)
Virtual Machine Software: Oracle VirtualBox Version 4.3.12
Guest Machine OS: Ubuntu 14.02 (32 bit (I couldn't get the 64 bit to work)


It looks like you are missing the ZLIB header files.


sudo apt-get install zlib1g-dev

Or maybe:

sudo apt-get install zlib-dev

The first should be the right one, but I don't have a Ubuntu machine to test it on.

Hope this fixes your problem!

Created a Ubuntu VM and verified that sudo apt-get install zlib1g-dev is the correct command.

  • This worked for me. I'm sorry I forgot to make this as answered! – jrp355 Dec 23 '15 at 16:06
  • @jrp355 Thanks for remembering! :) – BenjiWiebe Jan 2 '16 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.