{"id":12,"date":"2013-01-30T19:19:42","date_gmt":"2013-01-30T19:19:42","guid":{"rendered":"http:\/\/evolvedmicrobe.com\/blogs\/?p=12"},"modified":"2013-04-13T22:18:01","modified_gmt":"2013-04-13T22:18:01","slug":"compiling-bowtie2-on-windows-64-bit","status":"publish","type":"post","link":"http:\/\/evolvedmicrobe.com\/blogs\/?p=12","title":{"rendered":"Compile Bowtie2 on Windows 64 bit."},"content":{"rendered":"Bowtie 2 is a program that efficiently aligns next generation sequence data to a reference genome.  However, the version distributed by the authors only compiles on POSIX platforms.  These instructions will allow you to compile it on windows by downloading the Mingw64 tools and editing the make file before building the program.\r\n\r\n<strong>Instructions<\/strong>\r\n<ol>\r\n<li>\r\nDownload the Bowtie 2 <a href=\"http:\/\/sourceforge.net\/projects\/bowtie-bio\/files\/bowtie2\/\">source code<\/a>.  Extract the code to a location on your disk.\r\n<\/li>\r\n<li>\r\nDownload the mingW64 compiler tools.  These tools are much easier to use if they are downloaded as a package from this site: <a href=\"http:\/\/tdm-gcc.tdragon.net\/\" title=\"TDM Compiler Package\"> TDM Compiler Package<\/a>. Be sure to select the TDM 64 bit version of the tools.<\/li>\r\n<li>\r\nRun the installer for the package.  When prompted, select all of the available packages for installation.\r\n<\/li>\r\n<li>\r\nIn 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 <a href=\"http:\/\/notepad-plus-plus.org\/\" title=\"here\" target=\"_blank\">notepad++<\/a>.  If notepad++ is installed, simply write click on the file and select &#8220;edit with notepad++&#8221;.\r\n<\/li>\r\n<li>\r\nEdit 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:\r\n<pre class-\"brush: bash shell\">\r\n# Detect Cygwin or MinGW\r\n#WINDOWS = 0\r\n#CYGWIN = 0\r\n#MINGW = 0\r\n#ifneq (,$(findstring CYGWIN,$(shell uname)))\r\n#WINDOWS = 1 \r\n#CYGWIN = 1\r\n# POSIX memory-mapped files not currently supported on Windows\r\n#BOWTIE_MM = 0\r\n#BOWTIE_SHARED_MEM = 0\r\n#else\r\n#ifneq (,$(findstring MINGW,$(shell uname)))\r\nWINDOWS = 1\r\nMINGW = 1\r\n# POSIX memory-mapped files not currently supported on Windows\r\nBOWTIE_MM = 0\r\nBOWTIE_SHARED_MEM = 0\r\n#endif\r\n#endif\r\n<\/pre>\r\n<\/li>\r\n\r\n<li>\r\nNow edit the makefile so it points to a correct pthreads library.  Edit line 76 so it reads as follows:\r\n<pre class-\"brush: bash shell\">PTHREAD_LIB = -lpthread<\/pre>\r\n<\/li>\r\n<li>Edit the file so that it compiles as 64 bit, change lines 121-132 to the following\r\n<pre class-\"brush: bash shell\">\r\n# Convert BITS=?? to a -m flag\r\nBITS=64\r\n#ifeq (x86_64,$(shell uname -m))\r\nBITS=64\r\n#endif\r\nBITS_FLAG =\r\n#ifeq (32,$(BITS))\r\n#BITS_FLAG = -m32\r\n#endif\r\n#ifeq (64,$(BITS))\r\nBITS_FLAG = -m64\r\n#endif\r\n<\/pre>\r\n<\/li>\r\n<li>Go to start->All Programs->MingGW64->MingGW Command prompt<\/li>\r\n<li>\r\nNavigate to the directory with the source code and make file by entering the cd command at the prompt, e.g. \r\n<pre class-\"brush: bash shell\">cd C:\\Programs\\bowtie2-2.0.6-source\\bowtie2-2.0.6 <\/pre>\r\n<\/li>\r\n<li>\r\nType &#8220;make&#8221; and hit enter.\r\n<\/li>\r\n<li>All done!<\/li>\r\n\r\nEdit: One person had a comment on this, if this doesn&#8217;t work you may have to use teh MinGW shell. \r\n\n\t\t<style type=\"text\/css\">\n\t\t\t#gallery-1 {\n\t\t\t\tmargin: auto;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-item {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-top: 10px;\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 33%;\n\t\t\t}\n\t\t\t#gallery-1 img {\n\t\t\t\tborder: 2px solid #cfcfcf;\n\t\t\t}\n\t\t\t#gallery-1 .gallery-caption {\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\t\t\t\/* see gallery_shortcode() in wp-includes\/media.php *\/\n\t\t<\/style>\n\t\t<div data-carousel-extra='{\"blog_id\":1,\"permalink\":\"http:\\\/\\\/evolvedmicrobe.com\\\/blogs\\\/?p=12\"}' id='gallery-1' class='gallery galleryid-12 gallery-columns-3 gallery-size-thumbnail'><dl class='gallery-item'>\n\t\t\t<dt class='gallery-icon portrait'>\n\t\t\t\t<a href='http:\/\/evolvedmicrobe.com\/blogs\/?attachment_id=30'><img width=\"150\" height=\"150\" src=\"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/01\/Capture.png?resize=150%2C150\" class=\"attachment-thumbnail size-thumbnail\" alt=\"\" loading=\"lazy\" aria-describedby=\"gallery-1-30\" data-attachment-id=\"30\" data-permalink=\"http:\/\/evolvedmicrobe.com\/blogs\/?attachment_id=30\" data-orig-file=\"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/01\/Capture.png?fit=259%2C372\" data-orig-size=\"259,372\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"MinGW\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;If you can see this program, follow instructions in comments to compile&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/01\/Capture.png?fit=208%2C300\" data-large-file=\"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/01\/Capture.png?fit=259%2C372\" \/><\/a>\n\t\t\t<\/dt>\n\t\t\t\t<dd class='wp-caption-text gallery-caption' id='gallery-1-30'>\n\t\t\t\tIf you can see this program, follow instructions in comments to compile\n\t\t\t\t<\/dd><\/dl>\n\t\t\t<br style='clear: both' \/>\n\t\t<\/div>\n\r\n\r\nEdit: It has been pointed out that the BowTie2 team doesn&#8217;t use memory mapped files on windows.  This might mean large genomes are less performant.\r\n\r\n<ol>","protected":false},"excerpt":{"rendered":"Bowtie 2 is a program that efficiently aligns next generation sequence data to a reference genome. However, the version distributed by the authors only compiles on POSIX platforms. These instructions will allow you to compile it on windows by downloading the Mingw64 tools and editing the make file before building the program. Instructions Download the [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[3],"tags":[7,4,5,6],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":359,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=359","url_meta":{"origin":12,"position":0},"title":"Profiling Rcpp package code on Windows","date":"September 3, 2016","format":false,"excerpt":"Profiling Rcpp code on Unix\/Mac is easy, but is difficult on Windows because R uses a compilation toolchain (MinGW) that produces files that are not understood by common Windows profiling programs.\u00a0 Additionally, the R build process often removes\u00a0symbols which allow profilers to produce sensible interpretations of their data. The following\u2026","rel":"","context":"In \"Optimization\"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2016\/09\/assembly.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":299,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=299","url_meta":{"origin":12,"position":1},"title":"C# vs. Java, Xamarin vs. Oracle, Performance Comparison version 2.0","date":"June 14, 2014","format":false,"excerpt":"Today I noticed the SIMD implementation of the Mandelbrot set algorithm I blogged about last year was successfully submitted to the language shootout webpage. However, I was a bit disappointed to see the C# version was still slower than the Java version, despite my use of the special SIMD instructions\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":188,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=188","url_meta":{"origin":12,"position":2},"title":"The .NET Bio BAM Parser is Smoking Fast","date":"October 12, 2013","format":false,"excerpt":"The .NET Bio library has an improved version of it's BAM file\u00a0parser, which makes it significantly faster and easily competitive with the\u00a0current standard C coded SAMTools for obtaining\u00a0sequencing data and working with it. The chart below compares the time it\u00a0takes in seconds for the old version of the parser and\u2026","rel":"","context":"In &quot;.NET Bio&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/10\/img5.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":112,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=112","url_meta":{"origin":12,"position":3},"title":"Mono.Simd and the Mandlebrot Set.","date":"September 10, 2013","format":false,"excerpt":"C# and .NET are some of the fastest high level languages, but still cannot truly compete with C\/C++ for low level speed, and C# code can be anywhere from 20%-300% slower. This is despite the fact that the C# compiler often gets as much information about a method as the\u2026","rel":"","context":"In &quot;Algorithms&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/09\/img2_thumb.gif?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":376,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=376","url_meta":{"origin":12,"position":4},"title":"Why R Math Functions on Windows are Slow, and How to Fix It","date":"September 19, 2016","format":false,"excerpt":"R on windows has much slower versions of the log, sine and cosine functions than are available on other platforms, and this can be a serious performance bottleneck for programs which frequently call these math functions.\u00a0 The reason for this is that the library R uses to obtain the log\u2026","rel":"","context":"In \"R\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":53,"url":"http:\/\/evolvedmicrobe.com\/blogs\/?p=53","url_meta":{"origin":12,"position":5},"title":"How to remove the &ldquo;Trial Edition&rdquo; banner from the VisiFire open source chart kit","date":"April 13, 2013","format":false,"excerpt":"Visifire is a very good graphing component for making silverlight or WPF applications.\u00a0 The component was first released as an open source library on GoogleCode, but since then has been made a closed source proprietary and for profit project.\u00a0 The newer version contains several enhancements, but the open source version\u2026","rel":"","context":"In &quot;C#&quot;","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/evolvedmicrobe.com\/blogs\/wp-content\/uploads\/2013\/04\/image_thumb.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/12"}],"collection":[{"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":16,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"predecessor-version":[{"id":60,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions\/60"}],"wp:attachment":[{"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/evolvedmicrobe.com\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}