Download the latest / required version of BWA:
http://sourceforge.net/projects/bio-bwa/files/bwa-0.7.12.tar.bz2/download
Unzip the downloaded file and navigate to the resulting directory:
- tar -xvf bwa-0.7.12.tar.bz2
- cd bwa-0.7.12
BWA doesn’t come with a ./configure file so we can just run
- make
Which should compile everything nicely and result in a executable bwa binary file in the bwa-0.7.12 directory. Once you have made this binary file all of the other files in the unzipped directory are no longer needed, they’re sole purpose in life was to make that binary…
From here you can either run the binary from the bwa-0.7.12 directory. e.g.:
…/bwa-0.7.12/bwa aln…
or move / copy the binary into /usr/bin/ if that’s your kind of thing.
11 responses to “BWA (Burrows-Wheeler Aligner) installation quickie”
Hi Graeme, thanks for this simple explanation.
Everything goes smoothly for me until I try to do the ‘make’ command when I get this:
gcc -c -g -Wall -Wno-unused-function -O2 -DHAVE_PTHREAD -DUSE_MALLOC_WRAPPERS utils.c -o utils.o
utils.c:29:19: fatal error: stdio.h: No such file or directory
#include
^
compilation terminated.
make: *** [utils.o] Error 1
Do you have any idea why this is/how to fix it? This is for bwa.0.7.12.
Thanks
Laura
Hey Laura,
I’m not in any way an expert but it looks like the error might have something to do with gcc, the C compiler that your computer is trying to use to make the BWA binary file.
If you are using a newer version of MacOSX you might be able to update / install the gcc libraries you need by running:
xcode-select –install
or installing XCode: development tools from the mac store.
If you are using another OS or if this doesn’t work let me know and I’ll have another think…
Cheers!
Graeme
Oh, and if you’re using Linux you could try:
sudo apt-get install build-essential
Let me know how you get along,
Cheers
Hi Graeme,
Thank you so much for your help.
I am on Linux, I vaguely read somewhere that compiling BWA requires zlib in order to compile which I think reflects what you have said. So I downloaded zlib 1.2.8 and can’t get that to ‘make’ either! But I executed the ‘sudo apt-get install build-essential’ command you said on zlib and I am not sure what it did but I think I selected to install it! I don’t know how to tell if this worked though.
So I went to bwa and tried to ‘make’ again just to see but it was wishful thinking and I got the same error.
Do you know if trying to get zlib is the right thing to do?
Thanks again
Laura
p.s. I also did ‘make’ for zlib and ‘make check’ which I think worked but when I do ‘make install’ there is an error.
Heya,
Hmm… Making sure that zlib is all there and accounted for sounds sensible…
Maybe try:
apt-get install zlib1g zlib1g-dev
and
apt-get install libc6-dev
for good measure…
If those don’t work we may be able to use a different C compiler… I’ll have a word with one of my sys admin friends…
G
Worked for me under Linux Mint!
Cheers!
Someone online also suggests:
sudo apt-get install g++
…
Hey Laura,
How did you get on installing BWA in the end? Hope you got it all working alright.
G
Hej MrGraeme,
I had the exact same error massage as Laura on my Mac OS X Yosemite. I tried “xcode-select –install” as you recommended and it worked. Thanks a lot! You saved my day 🙂
Hey Loreen,
That’s great to hear!
Enjoy
G
I am getting this error while installing BWA on Mac after running make command.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/mmintrin.h:525:12: error:
invalid conversion between vector type ‘__m64’ (vector of 1 ‘long long’
value) and integer type ‘int’ of different size
return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);
I have downloaded bwa-o.7.17. anyone can plz help me with this.