Building Boost Libs - boost

About 3 months ago I managed to build boost libs and left myself the following instructions:
Extract boost to ->
cd C:\Program Files\boost\boost_1_43_0
Build bjam ->
bootstrap.bat
Issue the following command ->
bjam --toolset=msvc-9.0 stage variant=debug threading=multi link=static runtime-link=static --with-filesystem --with-iostreams --with-regex --with-serialization --with-signals --with-system --with-thread --with-wave
before it build the libs in the default 'stage' directory. Now the command fails to accept any of the lib names. If i remove filesystem, it fails on the next... and so on.
C:\Program Files\boost\boost_1_44_0>win32_build_boost_libs.bat
error: wrong library name 'filesystem' in the --with- option.
Can anyone tell me why I've spent 3 hours trying to google for this but can't find anything :-(
I'm sure its something stupid but the process works on my old laptop but not on my new. They both have the same visual studio, version of boost, archive of boost, path variables... It really is quite frustrating.

You can use BlueGo to build boost - it supports different boost and Visual Studio versions: https://bitbucket.org/Vertexwahn/bluego

Related

Building Boost with Clang "Failed to build Boost.build engine"

I am trying to build Boost 1_74_0 for Clang on Windows 7. I go to the folder with bootstrap etc and run:
bootstrap --with-toolset=clang-win
but I get:
Building Boost.build engine
Failed to build Boost.build engine
and the log says:
Found with vswhere Visual Studio Locator version 2.5.2+gebb9f26a3d
###
### "Unknown toolset: vcunk"
###
### You can specify the toolset as the argument, i.e.:
### .\build.bat msvc
###
### Toolsets supported by this script are: borland, como, gcc,
### gcc-nocygwin, intel-win32, metrowerks, mingw,
### vc11, vc12, vc14, vc141, vc142
I did add my Clang bin folder to my PATH env variable.
How should I resolve this?
I assume that your version of clang was installed with VS2019 from your previous question.
Therefore, you need to issue the commands from a Developer Command Prompt for VS 2019.
Since you've already added the Clang bin folder to your PATH env variable, the following should work for you:
bootstrap.bat --with-toolset=clang-win
b2 toolset=clang-win link=shared threading=multi --build-type=complete stage
Note: this builds 32 bit boost library binaries.
The following command should build 64 bit boost library binaries:
b2 toolset=clang-win address-model=64 link=shared threading=multi --build-type=complete stage
However, it only builds the exception and test_exec_monitor binaries.
The other binaries, including date_time, report linker errors.

boost 1.66.0 with visual studio 2017, b2 keeps using cl.exe under ARM folder

I scratched my head hard but could not find someone asks the same question.
I'm building boost 1.66 with VS2017 on my machine, the command I'm using is b2 -a -j6 toolset=msvc-14.1 link=static runtime-link=static,shared address-model=64 architecture=x86 define=BOOST_CONFIG_SUPPRESS_OUTDATED_MESSAGE --with-math.
I think it should use cl.exe from Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\<version>\bin\Hostx64\x64
However, from the log b2 gives me
It looks really weird to me that it's using cl.exe under arm folder to compile my address-model=64 binaries. My question is, will the binary be the same as what I expected? Could this be a bug in boost build engine, and is there a workaround to make this look right?
P.S.: I've tried editing project-config.jam to hardcode the path of desired location of compiler, but it returns me "could not locate correct compiler cl". What I referenced is: build-boost-with-msvc-14-1-vs2017-rc

Boost linker Multi-threaded build issue

I've been using a successfully built boost library version 1.55.0 for a few weeks now but I ran into error LNK1140 cannot open file 'libboost_filesystem-vc120-mt-sgd-1_55.lib when I try using Multi-threaded(/MT) rather than /MD. I've been searching through forums and it seems that I need to statically link the library so I tried running .\b2 --with-thread variant=release link=static threading=multi runtime-link=static but that didn't work either. I have C:/Boost/1.55.0/VC/12.0 in VC++ Directories->Include Directories and C:\Boost\1.55.0\VC\12.0\stage\lib in Linker->General->Additional Library Directories. Any ideas?

Trying to build Boost: I cannot get bjam

I would like to build boost using two different compilers, MinGW and Visual C++ 2010 Express, using bjam:
bjam toolset=gcc,msvc variant=release link=static,shared threading=multi install
The problem is that I do not have bjam. I could not find it in the Boost directory, and the one I downloaded from somewhere else was a wrong version.
I should be able to build it from the code in Boost, but how? I read that I must launch build.bat from the BOOST_ROOT/tools/jam/src directory, but that directory does not exist !
Thank you!
Platform: Windows7
Compilers: MinGW and Visual C++ 2010 Express
Update:
I have been able to get bjam with: bootstrap.bat gcc
Then, launching bjam with the previous parameters, I only get libraries for MinGW (.dll and .a).
This is an extract of the error messages I get with regard to Visual C++ 10:
...
call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo #"bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj.rsp"
...failed compile-c-c++ bin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi\plain_report_formatter.obj...
...
...skipped <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>boost_unit_test_framework-vc100-mt-1_48.dll for lack of <pbin.v2\libs\test\build\msvc-10.0\release\asynch-exceptions-on\threading-multi>compiler_log_formatter.obj...
...
common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi
common.mkdir bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32
compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj
\Microsoft was unexpected at this time.
...
call "c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86 >nul
cl /Zm800 -nologo #"bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj.rsp"
...failed compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\thread.obj...
compile-c-c++ bin.v2\libs\thread\build\msvc-10.0\release\threading-multi\win32\tss_dll.obj
\Microsoft was unexpected at this time.
...
...skipped <pC:\Boost\lib>boost_thread-vc100-mt-1_48.lib for lack of <pbin.v2\libs\thread\build\msvc-10.0\release\threading-multi>boost_thread-vc100-mt-1_48.lib
...
Trying to use:
bootstrap.bat vc100
I get the error: "Unknown toolset: vc100"
With either:
bootstrap.bat vc10
or:
bootstrap.bat mingw
I get: "\Microsoft was unexpected at this time."
Changing project-config.jam did not help.
So, I did a big step forward, but vc10 is not working, yet...
There is a bootstrap.bat in your boost directory. Run it.
It will build bjam automatically (probably using visual c++).
The directory structure in boost has changed in recent version, I think.
The sources for bjam are in tools/build/v2/engine. Run build.sh mingw from that directory using MinGW shell, and it should build bjam.exe and b2.exe and place them in tools/build/v2/engine/ntx86. Copy b2.exe to the boost root directory. You should then be able to build Visual c++ libraries with b2 toolset=msvc.
Hope that helps.
In my case, the solution from jork works!
I searched the bjam.exe file and found it located in the tools/build/src/engine directory and just copied it to the boost root directory. But I have to say this is awful, I felt like the codebase writer is trying to hide sth. And I found that my bjam.exe is exactly is the same size with b2.exe, which is 404KB.
I will turn back later to ensure that I solved this issue.

Boost + Visual Studio 2010 + Windows Platform SDK 7.1

Could someone tell me a command line switch for bjam or something else that will make boost compile with VS2010 using the new Windows Platform SDK 7.1 toolchain? It's an option you can set in a normal visual studio project. The default is v100 a variant of the platform 7.0 toolchain. Thanks in advance.
Try this in your environment
set SdkTools=c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin
call "%SdkTools%\SetEnv.Cmd" /xp /x86
assuming that's where you have the Windows SDK installed. Info is from here - there may be more to do, but this looks on the right track to me.
To build boost 1.43.0 libraries for VS 2010:
Download and extract to C:\Temp\boost_1_43_0
Start Visual Studio 2010 Command Prompt
Build BJam
cd C:\Temp\boost_1_43_0\tools\jam\src
build.bat
Build Boost using BJam
cd C:\Temp\boost_1_43_0
tools\jam\src\bin.ntx86\bjam.exe --with-regex link=static runtime-link=static threading=multi variant=debug,release address-model=32,64
Check bin.v2 or stage/lib for output. Note naming conventions.
May need to build in two phases with just address-model=32 then with just address-model=64. In this case we are choosing to build libs that statically link to the C runtime and to statically link to the boost lib itself.
Use --with to build non-header based libs like regex. Note stage/lib will be overwritten after each address-model build, but all libs are always kept in bin.v2.

Resources