- Download the Bowtie 2 source code. Extract the code to a location on your disk.
- Download the mingW64 compiler tools. These tools are much easier to use if they are downloaded as a package from this site: TDM Compiler Package. Be sure to select the TDM 64 bit version of the tools.
- Run the installer for the package. When prompted, select all of the available packages for installation.
- In explorer, navigate to where you unzipped the source code for bowtie. Find the file called Makefile and edit it. A great way to do this is to install the program notepad++. If notepad++ is installed, simply write click on the file and select “edit with notepad++”.
Edit the file so that it knows it is compiling on Ming and Windows. To do this, insert # marks in front of all the if/else statements, so that lines 35 to 53 of the file look like this:
# Detect Cygwin or MinGW #WINDOWS = 0 #CYGWIN = 0 #MINGW = 0 #ifneq (,$(findstring CYGWIN,$(shell uname))) #WINDOWS = 1 #CYGWIN = 1 # POSIX memory-mapped files not currently supported on Windows #BOWTIE_MM = 0 #BOWTIE_SHARED_MEM = 0 #else #ifneq (,$(findstring MINGW,$(shell uname))) WINDOWS = 1 MINGW = 1 # POSIX memory-mapped files not currently supported on Windows BOWTIE_MM = 0 BOWTIE_SHARED_MEM = 0 #endif #endif
Now edit the makefile so it points to a correct pthreads library. Edit line 76 so it reads as follows:
PTHREAD_LIB = -lpthread
- Edit the file so that it compiles as 64 bit, change lines 121-132 to the following
# Convert BITS=?? to a -m flag BITS=64 #ifeq (x86_64,$(shell uname -m)) BITS=64 #endif BITS_FLAG = #ifeq (32,$(BITS)) #BITS_FLAG = -m32 #endif #ifeq (64,$(BITS)) BITS_FLAG = -m64 #endif
- Go to start->All Programs->MingGW64->MingGW Command prompt
Navigate to the directory with the source code and make file by entering the cd command at the prompt, e.g.
- Type “make” and hit enter.
- All done! Edit: One person had a comment on this, if this doesn’t work you may have to use teh MinGW shell.
Edit: It has been pointed out that the BowTie2 team doesn’t use memory mapped files on windows. This might mean large genomes are less performant.