The new version of Boost library has been released recently. Since we have released ApexSQL Log 2005.04 just the other day, we can now migrate our source base to Boost 1.34. This post will deal with building of Boost static libraries for side-by-side compilation and linking of x86, x64 and IA64 libraries. This is now much easier than it was in Boost 1.33 but there is still some work to be done.
-
Download Boost and Boost.Jam from here.
-
Put
Boost.Jam
binary into a directory on yourPATH
. -
Uncompress Boost library into a directory of your choice.
-
There is an error in one of Boost build files that needs to be fixed before compiling for IA64 architecture:
- Go to
boost_1_34_0\tools\build\v2\tools
folder. - Open
msvc.jam
in your favorite editor (mine is by far Visual Studio itself) - Replace all instances of
x86_IPF
withx86_ia64
(there should be two)
There is also an omission in the same file and native x64 compiler will be used only on boxes with
%PROCESS_IDENTIFIER%
matching AMD64. So if you have Intel based x64 CPU build will be done with x86-x64 cross-compiler. It’s just slower but the results are the same. If it bothers you, you should be able to fix it easily. - Go to
-
Go to command prompt, change directory to boost_1_34 and build Boost library for all three architectures.
-
For x86:
bjam msvc architecture=x86 stage
-
For x64:
bjam msvc architecture=x86 address-model=64 stage
-
For IA64:
bjam msvc architecture=ia64 stage
-
-
Install x86 libraries:
bjam msvc architecture=x86 install
By default Boost will install its include and lib files into
C:\Boost\lib
andC:\Boost\include\boost-1_34
. The problem with this is that if want to install x64 or IA64 static library files these will overwrite x86 static library files already installed. To avoid this we need to move all x86 static libraries toC:\Boost\lib\x86
(this is my solution - obviously other solutions are possible) so that these aren’t overwritten by subsequent installations. -
Install x64 libraries:
bjam msvc architecture=x86 address-model=64 install
Again, move these libraries from
C:\Boost\lib
toC:\Boost\lib\x64
. -
Install IA64 libraries:
bjam msvc architecture=architecture=ia64 install
Now move these libraries
C:\Boost\lib
toC:\Boost\lib\ia64
. -
Adapt your Visual C++ projects so that:
- x86 platform links libraries from
C:\Boost\lib\x86
- x64 platform links libraries from
C:\Boost\lib\x64
- ia64 platform links libraries from
C:\Boost\lib\ia64
- x86 platform links libraries from
That’s it! You should now be ready to use Boost libraries for binaries on all three Windows platforms.
UPDATE 2014-03-08 09:51: Updated layout and formatting.
Last modified on 2007-05-17