{"id":494,"date":"2011-01-14T16:30:08","date_gmt":"2011-01-14T22:30:08","guid":{"rendered":"http:\/\/www.gergltd.com\/home\/?p=494"},"modified":"2011-01-14T20:10:50","modified_gmt":"2011-01-15T02:10:50","slug":"getting-boost-to-compile-correctly-with-visual-studio-10-cuda-on-a-64-bit-machine","status":"publish","type":"post","link":"https:\/\/www.gergltd.com\/home\/getting-boost-to-compile-correctly-with-visual-studio-10-cuda-on-a-64-bit-machine\/","title":{"rendered":"Getting Boost to Compile Correctly with Visual Studio 10 &#038; CUDA on a 64-bit Machine"},"content":{"rendered":"<p>Sexy title, I know!<\/p>\n<p>Anyways, I&#8217;m developing using Visual Studio 10 (not my choice).\u00a0 I have a project which involves the use of CUDA and Boost. The newest version of CUDA (at the time of this writing) won&#8217;t work out of the box with the\u00a0 vs100 compiler that comes with Visual Studio 10.\u00a0 CUDA can use nothing newer than the vs90 compiler.\u00a0 So, I\u00a0 install visual studio 9 and 10 and select v90 as my compiler for my Visual Studio 10 project.<\/p>\n<p>Yesterday, I needed the Boost C++ libraries and began to install them.<\/p>\n<p>The Boost installation is pretty good.\u00a0 Its fairly automated which is nice.\u00a0 You essentially call bootstrap and then bjam; they take care of all the configuring and building of the .libs.\u00a0 However,\u00a0 Boost&#8217;s scripts see that I have Visual Studio 10 installed and compile everything with the vs100 compiler.\u00a0 This breaks my project in\u00a0 Visual\u00a0\u00a0 Studio (I get all linking errors related to Boost) as I&#8217;m in\u00a0 Visual Studio 10, but using the v90 compiler because of CUDA.<\/p>\n<p>So, I figured out how to override Boost&#8217;s configuration to compile with the vn90 compiler instead of the vc100 compiler.\u00a0 Here is how I fixed the problem.<\/p>\n<pre> cd to BOOST_ROOT\r\n boostrap\r\n \"C:\\Program Files (x86)\\Microsoft Visual Studio 9.0\\VC\\bin\\vcvars64.bat\"    \/\/ This invokes the vc90 environment variable set.\r\n bjam --toolset=msvc-9.0 --build-type=complete architecture=x86 address-model=64  \/\/ Makes Boost!\r\n<\/pre>\n<p>If you don&#8217;t run the 3rd line (vsvars64.bat), you will see tons of &#8220;cl&#8221; errors when running\u00a0 bjam.\u00a0 Essentially, Boost tries to call the vc90 compiler (cl.exe), but because the environment is hosed, it cant find it and bombs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sexy title, I know! Anyways, I&#8217;m developing using Visual Studio 10 (not my choice).\u00a0 I have a project which involves the use of CUDA and Boost. The newest version of CUDA (at the time of this writing) won&#8217;t work out of the box with the\u00a0 vs100 compiler that comes with Visual Studio 10.\u00a0 CUDA can [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-494","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/comments?post=494"}],"version-history":[{"count":8,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/494\/revisions"}],"predecessor-version":[{"id":502,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/posts\/494\/revisions\/502"}],"wp:attachment":[{"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/media?parent=494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/categories?post=494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gergltd.com\/home\/wp-json\/wp\/v2\/tags?post=494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}