简体   繁体   中英

How do I build Boost 1.55 with Visual Studio 2013 CTP November 2013

I'm aware that the new toolset is not supported by boost yet but I'd like to try to build Boost with it anyways. I've naively tried using the Boost build system and the option toolset=msvc-12.0-ctp but it doesn't work. I'm confident that it is possible since Boost 1.55 officially supports Visual Studio 2013 (msvc-12.0) and there have only been few breaking changes between the two releases.

My motivation is that I need some features of the CTP so my own application will be compiled with the CTP version of the msvc compiler. I'm afraid that simply compiling Boost with the original 2013 compiler will cause binary incompatibilities between Boost and my own application. Stephen T. Lavavej himself doesn't guarantee binary compatibility :

-- any chance of reusing Boost Binaries built for MSVC 2013 in MSVC Nov 2013 CTP

Because this is compiler-only, you can probably get away with mixing-and-matching. I wouldn't recommend it, though.

Any thoughts on how to solve this? Thanks in advance.

Note, that I did not built Boost with Visual Studio 2013 November CTP, so further explanations are purely theoretical.

After some Googling and trying, finally, I did it. So, algorithm is:

  1. Check out latest Boost from subversion (probably, it can be done with release distro, but I did not tried)

     svn co http://svn.boost.org/svn/boost/trunk boost-trunk 
  2. Specify custom path to compiler in user-config.jam file, which is situated in %BOOST_HOME%/tools/build/v2/ (where %BOOST_HOME% is a path where you checked out your distro):

    • Add line like this:

    using msvc : 12.1 : "C:/Program Files (x86)/Microsoft Visual C++ Compiler Nov 2013 CTP/bin/cl" ;

    • you can use arbitrary string instead of 12.1 , just put something here to distinguish your toolset later, when invoking b2

    • Don't forget to put spaces before and after colon and before semicolon, and also use slashes / or double backslashes \\\\ instead of backslashes \\ . See explanation in comments of user-config.jam file

    • Make sure that you don't have # in the beginning of the line (ie it is not commented)

  3. Run VS2013 x86 Native Tools Command prompt or run manually cmd.exe and then set up environment by invoking "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall.bat" -x86 . Change x86 to x64 if needed.

  4. Add path to CTP compiler to PATH variable :

     set PATH=C:/Program Files (x86)/Microsoft Visual C++ Compiler Nov 2013 CTP/bin;%PATH% 
  5. Check that path to CTP compiler goes before path to release one:

     echo %PATH% 
  6. Go to %BOOST_HOME% and run b2 toolset=msvc-12.1 ...<other params go there>...

  7. In process manager or ProcessExplorer check that b2 invokes CTP compiler, and not release one

  8. Unfortunately, not all libraries builds fine. There are some compile errors.

See also:

Hope it helps. Happy building! =)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM