Building Boost 32/64 on Windows: Difference between revisions

From NEOSYS Dev Wiki
Jump to navigationJump to search
No edit summary
 
(42 intermediate revisions by the same user not shown)
Line 1: Line 1:
== building boost x64 "release only" in windows from command line using ready icu binaries ==
= Building boost x64 "release only" =


*Boost x64 binaries are not available from boost or not exactly the right tool version perhaps
Ready-made boost x64 binary libs are not available from boost project. To build boost binary libs with regex having unicode support we need ICU libs.
*Building boost x64 binaries requires icu x64 binaries which we have to make or get
 
== Getting ICU's binary libraries ==
 
*Building boost x64 binaries WITH UNICODE REGEX SUPPORT requires icu x64 binaries which we have to make or get
*NB building icu "release only" can be done from the command line with sdk only
*NB building icu "release only" can be done from the command line with sdk only
*Building icu debug version can be done from command line but requires a path to visual studio's bscmake (express will do)
*Building icu debug version can be done from command line but requires a path to visual studio's bscmake (express will do)


=== Getting ICU's binary libraries ===
=== From ICU Project (Release Only/No Debug) ===


Here we get "release only" binaries from icu at http://site.icu-project.org/download
Here we get "release only" binaries from icu at http://site.icu-project.org/download
Line 20: Line 23:
  dir F:\icu4c-4_6-Win64-msvc10\icu
  dir F:\icu4c-4_6-Win64-msvc10\icu


=== Work-around for "HAS_ICU BUILDS: NO" ===
== Define ICU Location ==
 
set ICU64=F:\icu4c-4_6-Win64-msvc10\icu
rem set ICU64=F:\icu4c-4_6_1-src\icu
dir %ICU64%
 
== Get Boost Source ==
 
To unzip boost files fast get 7-Zip because Windows is intolerably slow to unzip the large number of files in Boost.
 
http://www.7-zip.org/download.html
 
Get boost source and open in 7-Zip's File Manager "FM"
 
http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.7z/download
 
Extract to F:\ so that subfolder isnt doubled up as f:\exodus_1_46_1\exodus_1_46_1\
 
f:\boost_1_46_1
 
or just get boost zip but Windows unzips Boost intolerably slowly
 
http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip/download
 
== Build Boost Builder ==
 
Install Windows SDK if you have not already done so.
 
Get into a SDK command line and move into the boost source folder to build the boost builder "bjam"
 
<pre>
>>>Windows SDK 7.1 Command Prompt
f:
cd \boost_1_46_1
 
rem NOTE the boost builder "bjam" MUST be built in x86 mode!!!
setenv /x86 /Release


a boost build bug that tests for existence of *debug* version of ICU even when building release only version of boost.
bootstrap
</pre>


log will show you all the attempted linking including bin/bin64 lib/lib64 issues.
== Check if Boost builds with ICU ==


notepad bin\v2\config.log
First, for speed, build the regex library only to check that icu is being used


also includes an library list in a @file
setenv /x64 /Release
bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-regex stage --stagedir=stage64 -j2 -a


notepad bin.v2\libs\regex\build\msvc-10.0\debug\address-model-64\architecture-x86\threading-multi\has_icu.exe.rsp
If it says HAS_ICU=NO then do the following work otherwise skip to final section and build all five boost binary libraries needed by Exodus


LINK : fatal error LNK1181: cannot open input file 'icuind.lib'
=== Work-around for "HAS_ICU BUILDS: NO" ===


bjam should not use the debug libraries while building regex so probably we can just use the release versions as debug to get around the icu detection!
bjam should not use the debug libraries while building regex so probably we can just use the release versions as debug to get around the icu detection!
Line 40: Line 81:
  copy icuuc.lib icuucd.lib
  copy icuuc.lib icuucd.lib


=== Build Boost Builder ===
=== If the work-around doesnt work! ===
 
A boost build bug that tests for existence of *debug* version of ICU even when building release only version of boost. config.log will show you all the attempted linking including bin/bin64 lib/lib64 issues. also includes list of libraries in a @file
 
notepad bin.v2\config.log
notepad bin.v2\libs\regex\build\msvc-10.0\debug\address-model-64\architecture-x86\threading-multi\has_icu.exe.rsp
 
LINK : fatal error LNK1181: cannot open input file 'icuind.lib'
 
maybe your ICU_PATH IS WRONG
 
== Build Boost with ICU ==
 
setenv /x64 /Release
bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage64 -j2 -a
dir stage64\lib
 
= Complete Build of Boost 32/64/Debug/Release =
 
If you have acquired or built a complete set of ICU 32/64/release/debug libraries then you can build the same for boost and therefore can build Exodus in any configuration or platform.
 
== Getting ICU's binary libraries ==
 
*Building boost x64 binaries WITH UNICODE REGEX SUPPORT requires icu x64 binaries which we have to make or get
*NB building icu "release only" can be done from the command line with sdk only
*Building icu debug version can be done from command line but requires a path to visual studio's bscmake (express will do)
 
=== Either - Built from Source ===
 
[[Building ICU 32/64 on Windows]]
 
=== Or - Ready made from Exodus Project (x86/x64/Release/Debug) ===
 
===== Binaries =====
 
http://exodusdb.googlecode.com/files/icu461-vc100-x86x64-rd.zip
 
===== Include/Headers =====
 
Download and unzip include/headers from: [[Building_ICU_32/64_on_Windows#Get_ICU_Source]]


Install Windows SDK and get into a SDK command line and get into boost
Position the lib and lib64 folder in the \icu include/header folder next to the source folder


f:
create a folder "include" next to lib lib64 and source folder
cd \boost_a_46_1


NOTE the boost builder "bjam" MUST be built in x86 mode!
create an folder unicode in the include folder


setenv /x86 /Release
copy the contents of the source\common\unicode and source\i18n\unicode folders into the include\unicode folders that you just created
bootstrap


=== Build Boost with ICU ===
== Complete Build ==


setenv /x64 /Release #we need to build x64:release
First setup boost:
#[[Building_Boost_32/64_on_Windows#Get_Boost_Source]]
#[[Building_Boost_32/64_on_Windows#Build_Boost_Builder]]


First build the regex library only to check that icu is being used
CHECK THAT IT SAYS "HAS_ICU BUILDS : YES" in the following and troubleshoot using the procedure from the previous section/<br>
[[Building_Boost_32/64_on_Windows#If_the_work-around_doesnt_work.21]] BUT DONT USE THE WORKAROUND!


bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=F:\icu4c-4_6-Win64-msvc10\icu --with-regex stage --stagedir=stage64 -j2 -a
<pre>
set ICU32=f:\icu4c-4_6_1-src\icu
set ICU64=f:\icu4c-4_6_1-src\icu
set VCVER=10.0
if "%VCVER%" == "10.0" set SETENV_TARGET=win7
if "%VCVER%" == "9.0" set SETENV_TARGET=2008
if "%VCVER%" == "8.0" set SETENV_TARGET=xp


If it says HAS_ICU=NO then go back up to review the work around section above, otherwise build all five boost binary libraries needed by Exodus
setenv /x64 /%SETENV_TARGET%
bjam --toolset=msvc-%VCVER% architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage64 -j2 -a
dir stage64\lib
rem should be 20 files. 5 libraries x 4 (ie release/debug + versioned/not versioned)


bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=F:\icu4c-4_6-Win64-msvc10\icu --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage64 -j2 -a
setenv /x86 /%SETENV_TARGET%
bjam --toolset=msvc-%VCVER% architecture=x86 address-model=32 -sICU_PATH=%ICU32% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage32 -j2 -a
dir stage32\lib
rem should be 20 files. 5 libraries x 4 (ie release/debug + versioned/not versioned)
</pre>


dir stage66\lib
You can also change the 10.0 to 9.0 or 8.0 to get VS2008 or VS2005 boost libraries ... IF the icu libs at ICU32 and ICU64 are VS2008/VS2005 etc.

Latest revision as of 00:34, 23 June 2011

Building boost x64 "release only"

Ready-made boost x64 binary libs are not available from boost project. To build boost binary libs with regex having unicode support we need ICU libs.

Getting ICU's binary libraries

  • Building boost x64 binaries WITH UNICODE REGEX SUPPORT requires icu x64 binaries which we have to make or get
  • NB building icu "release only" can be done from the command line with sdk only
  • Building icu debug version can be done from command line but requires a path to visual studio's bscmake (express will do)

From ICU Project (Release Only/No Debug)

Here we get "release only" binaries from icu at http://site.icu-project.org/download

http://download.icu-project.org/files/icu4c/4.6/icu4c-4_6-Win64-msvc10.zip

and extract to

F:\icu4c-4_6-Win64-msvc10

check they are at the right level

dir F:\icu4c-4_6-Win64-msvc10\icu

Define ICU Location

set ICU64=F:\icu4c-4_6-Win64-msvc10\icu
rem set ICU64=F:\icu4c-4_6_1-src\icu
dir %ICU64%

Get Boost Source

To unzip boost files fast get 7-Zip because Windows is intolerably slow to unzip the large number of files in Boost.

http://www.7-zip.org/download.html

Get boost source and open in 7-Zip's File Manager "FM"

http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.7z/download

Extract to F:\ so that subfolder isnt doubled up as f:\exodus_1_46_1\exodus_1_46_1\

f:\boost_1_46_1

or just get boost zip but Windows unzips Boost intolerably slowly

http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip/download

Build Boost Builder

Install Windows SDK if you have not already done so.

Get into a SDK command line and move into the boost source folder to build the boost builder "bjam"

>>>Windows SDK 7.1 Command Prompt
f:
cd \boost_1_46_1

rem NOTE the boost builder "bjam" MUST be built in x86 mode!!!
setenv /x86 /Release

bootstrap

Check if Boost builds with ICU

First, for speed, build the regex library only to check that icu is being used

setenv /x64 /Release
bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-regex stage --stagedir=stage64 -j2 -a

If it says HAS_ICU=NO then do the following work otherwise skip to final section and build all five boost binary libraries needed by Exodus

Work-around for "HAS_ICU BUILDS: NO"

bjam should not use the debug libraries while building regex so probably we can just use the release versions as debug to get around the icu detection!

cd icu\lib64
copy icuin.lib icuind.lib
copy icuuc.lib icuucd.lib

If the work-around doesnt work!

A boost build bug that tests for existence of *debug* version of ICU even when building release only version of boost. config.log will show you all the attempted linking including bin/bin64 lib/lib64 issues. also includes list of libraries in a @file

notepad bin.v2\config.log
notepad bin.v2\libs\regex\build\msvc-10.0\debug\address-model-64\architecture-x86\threading-multi\has_icu.exe.rsp
LINK : fatal error LNK1181: cannot open input file 'icuind.lib'

maybe your ICU_PATH IS WRONG

Build Boost with ICU

setenv /x64 /Release
bjam variant=release --toolset=msvc-10.0 architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage64 -j2 -a
dir stage64\lib

Complete Build of Boost 32/64/Debug/Release

If you have acquired or built a complete set of ICU 32/64/release/debug libraries then you can build the same for boost and therefore can build Exodus in any configuration or platform.

Getting ICU's binary libraries

  • Building boost x64 binaries WITH UNICODE REGEX SUPPORT requires icu x64 binaries which we have to make or get
  • NB building icu "release only" can be done from the command line with sdk only
  • Building icu debug version can be done from command line but requires a path to visual studio's bscmake (express will do)

Either - Built from Source

Building ICU 32/64 on Windows

Or - Ready made from Exodus Project (x86/x64/Release/Debug)

Binaries

http://exodusdb.googlecode.com/files/icu461-vc100-x86x64-rd.zip

Include/Headers

Download and unzip include/headers from: Building_ICU_32/64_on_Windows#Get_ICU_Source

Position the lib and lib64 folder in the \icu include/header folder next to the source folder

create a folder "include" next to lib lib64 and source folder

create an folder unicode in the include folder

copy the contents of the source\common\unicode and source\i18n\unicode folders into the include\unicode folders that you just created

Complete Build

First setup boost:

  1. Building_Boost_32/64_on_Windows#Get_Boost_Source
  2. Building_Boost_32/64_on_Windows#Build_Boost_Builder

CHECK THAT IT SAYS "HAS_ICU BUILDS : YES" in the following and troubleshoot using the procedure from the previous section/
Building_Boost_32/64_on_Windows#If_the_work-around_doesnt_work.21 BUT DONT USE THE WORKAROUND!

set ICU32=f:\icu4c-4_6_1-src\icu
set ICU64=f:\icu4c-4_6_1-src\icu
set VCVER=10.0
if "%VCVER%" == "10.0" set SETENV_TARGET=win7
if "%VCVER%" == "9.0" set SETENV_TARGET=2008
if "%VCVER%" == "8.0" set SETENV_TARGET=xp

setenv /x64 /%SETENV_TARGET%
bjam --toolset=msvc-%VCVER% architecture=x86 address-model=64 -sICU_PATH=%ICU64% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage64 -j2 -a
dir stage64\lib
rem should be 20 files. 5 libraries x 4 (ie release/debug + versioned/not versioned)

setenv /x86 /%SETENV_TARGET%
bjam --toolset=msvc-%VCVER% architecture=x86 address-model=32 -sICU_PATH=%ICU32% --with-date_time --with-filesystem --with-regex --with-system --with-thread stage --stagedir=stage32 -j2 -a
dir stage32\lib
rem should be 20 files. 5 libraries x 4 (ie release/debug + versioned/not versioned)

You can also change the 10.0 to 9.0 or 8.0 to get VS2008 or VS2005 boost libraries ... IF the icu libs at ICU32 and ICU64 are VS2008/VS2005 etc.