{"id":302,"date":"2012-05-29T10:41:37","date_gmt":"2012-05-29T08:41:37","guid":{"rendered":"https:\/\/www.npcglib.org\/~stathis\/blog\/?p=302"},"modified":"2013-11-15T15:59:42","modified_gmt":"2013-11-15T13:59:42","slug":"windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit","status":"publish","type":"post","link":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/","title":{"rendered":"windows task: Build the Boost libraries with Python and Localization support for 32-bit and 64-bit"},"content":{"rendered":"<div style=\"padding:10px; border: 1px solid gray;\">\n<b>UPDATE [15 Nov 2013]<\/b>: For the latest binaries visit my <a href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/precompiled-boost\/\" title=\"Precompiled Boost\">Precompiled Boost libraries dedicated page<\/a>. Build scripts and instructions are also included.\n<\/div>\n<p><\/p>\n<p>These are my notes for building Boost with <a href=\"http:\/\/www.boost.org\/doc\/libs\/release\/libs\/python\/\" title=\"Boost.Python\" target=\"_blank\">Boost.Python<\/a> and <a href=\"http:\/\/www.boost.org\/doc\/libs\/release\/libs\/locale\/\" title=\"Boost.Locale\" target=\"_blank\">Boost.Locale<\/a> support for both Win32 and Win64 using MSVC 2010 Ultimate.<\/p>\n<p>If you just want to use the pre-built libraries with Boost.Python (Python) and localization (ICU) support, but without spending hours compiling them yourself, you can just download them from the <a href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/binaries\/\" title=\"binaries\">pre-built binaries page<\/a>.<\/p>\n<p><\/p>\n<h2>Preparation<\/h2>\n<p><\/p>\n<h3>The ICU Library (for Boost.Locale)<\/h3>\n<p>Download the latest source code of the <a href=\"http:\/\/site.icu-project.org\/download\" title=\"ICU library download\" target=\"_blank\">ICU library<\/a>.<br \/>\nThe prebuilt binaries contain no Debug symbols. If you want to build them yourself, you will need the Source Code:<\/p>\n<ul>\n<li><a href=\"http:\/\/download.icu-project.org\/files\/icu4c\/49.1.2\/icu4c-49_1_2-src.zip\">icu4c-49_1_2-src.zip<\/a> <span style=\"font-size:80%;\">[19.2MB]<\/span><\/li>\n<\/ul>\n<p>I use Cygwin\/MSVC to build the ICU Library in all variants (debug\/release) with static\/shared linking. Find my prebuilt ICU Libraries and a how to DIY on my other post here.<br \/>\n<\/p>\n<h3>Python (for Boost.Python)<\/h3>\n<p>Download the latest 2.x release of <a href=\"http:\/\/www.python.org\/getit\/\" target=\"_blank\">Python<\/a>. Currently v2.7.6 is the latest version and can be found at:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.python.org\/ftp\/python\/2.7.6\/python-2.7.6.msi\">Python 2.7.6 Windows Installer<\/a><\/li>\n<li><a href=\"http:\/\/www.python.org\/ftp\/python\/2.7.6\/python-2.7.6.amd64.msi\">Python 2.7.6 Windows X86-64 Installer<\/a><\/li>\n<\/ul>\n<p>You can extract the two files into convenient directories from the command line:<\/p>\n<pre>\r\nmsiexec \/a python-2.7.6.msi \/qb TARGETDIR=I:\\dev\\python\r\nmsiexec \/a python-2.7.6.amd64.msi \/qb TARGETDIR=I:\\dev\\python64\r\n<\/pre>\n<p><\/p>\n<hr\/>\n<p><\/p>\n<h2>Building Boost<\/h2>\n<p>Download <a href=\"http:\/\/www.boost.org\/users\/download\/\" target=\"_blank\">Boost<\/a>. I used release v1.49.0.<br \/>\nI now assume that you have the following layout (you should adjust your paths in the commands further below as appropriate):<\/p>\n<pre>\r\n         Bouse Sources in I:\\tmp\\boost-src\r\nICU (shared 32\/64-bit) in I:\\dev\\icu-shared\r\nICU (static 32\/64-bit) in I:\\dev\\icu-static\r\n       Python (32-bit) in I:\\dev\\python\r\n       Python (64-bit) in I:\\dev\\python64\r\n<\/pre>\n<p>I will be building Boost in the intermediate directory <code>I:\\tmp\\boost-build<\/code>, and I will install the resulting Boost libraries in <code>I:\\dev\\boost<\/code> for the 32-bit library, and <code>I:\\dev\\boost64<\/code> for the 64-bit library. I prefer to have two separate boost directories, as this makes it easier to use with CMake. Remember to delete the build-dir (I:\\tmp\\boost-build) after you are done. It should save around 5GB for each of the 32- and 64-bit builds. Note also that I have a quad core CPU and therefore I will enable it (<code>-j4<\/code>) to build Boost faster, change this or remove it to reflect the capabilities of your CPU. <\/p>\n<p><\/p>\n<h2>Building 32-bit Boost Libraries<\/h2>\n<p>Create a Boost Jam user configuration file: <code>I:\\tmp\\boost-src\\user-config.jam<\/code> and add:<\/p>\n<pre>\r\nusing python : 2.7 : I:\\\\dev\\\\python\\\\python.exe\r\n  : I:\\\\dev\\\\python\\\\include\r\n  : I:\\\\dev\\\\python\\\\libs\r\n  : &lt;address-model&gt;32 ;\r\n<\/pre>\n<p>Open a 32-bit Visual Studio Command Prompt (2010):<\/p>\n<pre>\r\n%comspec% \/k \"\"D:\\dev\\msvc2010\\VC\\vcvarsall.bat\"\" x86\r\n<\/pre>\n<p>To build Boost invoke the command:<\/p>\n<pre>\r\nbootstrap.bat\r\nb2 -j4 -sICU_PATH=I:\\dev\\icu-static link=static ^\r\n       --user-config=I:\\tmp\\boost-src\\user-config.jam ^\r\n       --prefix=I:\\dev\\boost ^\r\n       --build-dir=I:\\tmp\\boost-build ^\r\n       --toolset=msvc-10.0 ^\r\n       --without-mpi ^\r\n       --build-type=complete install ^\r\n       --debug-configuration\r\n<\/pre>\n<p>If everything goes well you should see in the building output of boost:<\/p>\n<pre>\r\n...\r\n    - has_icu builds           : yes\r\n...\r\n    - icu                      : yes\r\n...\r\n<\/pre>\n<p>The above will build Boost static libraries. You can tweak the parameters e.g. <code>-sICU_PATH=I:\\dev\\icu-shared link=shared<\/code> to build Boost shared. These commands will build all libraries, except from Boost.Python. To built, you need to run the command again, with the very same options, expect replace <code>--without-mpi<\/code>, with <code>--with-python<\/code>, for example:<\/p>\n<pre>\r\nb2 -j4 -sICU_PATH=I:\\dev\\icu-static link=static ^\r\n       --user-config=I:\\tmp\\boost-src\\user-config.jam ^\r\n       --prefix=I:\\dev\\boost ^\r\n       --build-dir=I:\\tmp\\boost-build ^\r\n       --toolset=msvc-10.0 address-model=32 ^\r\n       --with-python ^\r\n       --build-type=complete install ^\r\n       --debug-configuration\r\n<\/pre>\n<p><\/p>\n<h2>Building 64-bit Boost Libraries<\/h2>\n<p>Edit the file: <code>I:\\tmp\\boost-src\\user-config64.jam<\/code> and add:<\/p>\n<pre>\r\nusing python : 2.7 : I:\\\\dev\\\\python64\\\\python.exe\r\n  : I:\\\\dev\\\\python64\\\\include\r\n  : I:\\\\dev\\\\python64\\\\libs\r\n  : &lt;address-model&gt;64 ;\r\n<\/pre>\n<p>Open a 64-bit Visual Studio Command Prompt (2010):<\/p>\n<pre>\r\n%comspec% \/k \"\"D:\\dev\\msvc2010\\VC\\vcvarsall.bat\"\" x64\r\n<\/pre>\n<p>To build Boost invoke the command:<\/p>\n<pre>\r\nbootstrap.bat\r\nb2 -j4 -sICU_PATH=I:\\dev\\icu-static link=static ^\r\n       --user-config=I:\\tmp\\boost-src\\user-config.jam ^\r\n       --prefix=I:\\dev\\boost64 ^\r\n       --build-dir=I:\\tmp\\boost-build ^\r\n       --toolset=msvc-10.0 address-model=64 ^\r\n       --without-mpi ^\r\n       --build-type=complete install ^\r\n       --debug-configuration\r\n<\/pre>\n<p>Again, if everything goes well you should see in the building output of boost:<\/p>\n<pre>\r\n...\r\n    - has_icu builds           : yes\r\n...\r\n    - icu (lib64)              : yes\r\n...\r\n<\/pre>\n<p>Again, the above will build the 64-bit Boost static libraries. You can tweak the parameters e.g. <code>-sICU_PATH=I:\\dev\\icu-shared link=shared<\/code> to build Boost shared. These commands will build all libraries, except from Boost.Python. To built, you need to run the command again, with the very same options, expect replace <code>--without-mpi<\/code>, with <code>--with-python<\/code>, for example:<\/p>\n<pre>\r\nb2 -j4 -sICU_PATH=I:\\dev\\icu-static link=static ^\r\n       --user-config=I:\\tmp\\boost-src\\user-config64.jam ^\r\n       --prefix=I:\\dev\\boost64 ^\r\n       --build-dir=I:\\tmp\\boost-build ^\r\n       --toolset=msvc-10.0 address-model=64 ^\r\n       --with-python ^\r\n       --build-type=complete install ^\r\n       --debug-configuration\r\n<\/pre>\n<p><\/p>\n<hr\/>\n<p>\nDownload the produced binaries from the <a href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/binaries\/\" title=\"binaries\">pre-built binaries page<\/a>.<\/p>\n<p>Note: I have not extensively tested the libraries and therefore if you are having trouble using them, please feel free to leave a comment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UPDATE [15 Nov 2013]: For the latest binaries visit my Precompiled Boost libraries dedicated page. Build scripts and instructions are also included. These are my notes for building Boost with Boost.Python and Boost.Locale support for both Win32 and Win64 using MSVC 2010 Ultimate. If you just want to use the pre-built libraries with Boost.Python (Python) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[18,17,16],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"Instructions on how to build Boost Libraries with Python and ICU support.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"stathis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\",\"name\":\"sigmoid\",\"description\":\"..oo..oo..oo..oo..oo..oo..\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#webpage\",\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/\",\"name\":\"windows task: Build the Boost libraries with Python and Localization support for 32-bit and 64-bit - sigmoid\",\"isPartOf\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#website\"},\"datePublished\":\"2012-05-29T08:41:37+00:00\",\"dateModified\":\"2013-11-15T13:59:42+00:00\",\"author\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\"},\"description\":\"Instructions on how to build Boost Libraries with Python and ICU support.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"windows task: Build the Boost libraries with Python and Localization support for 32-bit and 64-bit\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41\",\"name\":\"stathis\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g\",\"caption\":\"stathis\"},\"url\":\"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"description":"Instructions on how to build Boost Libraries with Python and ICU support.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/","twitter_misc":{"Written by":"stathis","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/","name":"sigmoid","description":"..oo..oo..oo..oo..oo..oo..","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.npcglib.org\/~stathis\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#webpage","url":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/","name":"windows task: Build the Boost libraries with Python and Localization support for 32-bit and 64-bit - sigmoid","isPartOf":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#website"},"datePublished":"2012-05-29T08:41:37+00:00","dateModified":"2013-11-15T13:59:42+00:00","author":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41"},"description":"Instructions on how to build Boost Libraries with Python and ICU support.","breadcrumb":{"@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/2012\/05\/29\/windows-task-build-the-boost-libraries-with-python-and-localization-support-for-32-bit-and-64-bit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.npcglib.org\/~stathis\/blog\/"},{"@type":"ListItem","position":2,"name":"windows task: Build the Boost libraries with Python and Localization support for 32-bit and 64-bit"}]},{"@type":"Person","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#\/schema\/person\/508363c4ebd1fd6066edf00c94e37e41","name":"stathis","image":{"@type":"ImageObject","@id":"https:\/\/www.npcglib.org\/~stathis\/blog\/#personlogo","inLanguage":"en-US","url":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/214f29f604ec7d8d2f1345c5fa617c09?s=96&d=mm&r=g","caption":"stathis"},"url":"https:\/\/www.npcglib.org\/~stathis\/blog\/author\/stathis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/302"}],"collection":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/comments?post=302"}],"version-history":[{"count":85,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions"}],"predecessor-version":[{"id":1290,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/posts\/302\/revisions\/1290"}],"wp:attachment":[{"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/media?parent=302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/categories?post=302"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.npcglib.org\/~stathis\/blog\/wp-json\/wp\/v2\/tags?post=302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}