Vcpkg: How do I build boost with ICU support without having to build most components of boost twice?

Created on 22 Oct 2019  Â·  9Comments  Â·  Source: microsoft/vcpkg

The documentation is unclear on how to build all of boost with ICU support.

The following command builds all of boost without ICU support.

vcpkg install boost:x64-windows boost:x64-windows

Based on the output of the vcpkg search command, the following two components support the ICU feature.

  • boost-locale
  • boost-regex

The problem is that then Boost component itself does not support the ICU feature. As a result, you get the following error if you attempt to install all of boost with ICU support as follows.

vcpkg install boost[icu]:x64-windows boost[icu]:x64-windows

Error: icu is not a feature of package boost.

The following command installs only part of boost with ICU support.

vcpkg install boost-locale[icu]:x64-windows boost-locale[icu]:x64-windows boost-regex[icu]:x64-windows boost-regex[icu]:x64-windows

If you attempt to install all of boost with the following two commands, you get an error.

vcpkg install boost:x64-windows boost:x64-windows
vcpkg install boost-locale[icu]:x64-windows boost-locale[icu]:x64-windows boost-regex[icu]:x64-windows boost-regex[icu]:x64-windows

The error is as follows.

vcpkg install boost-locale[icu]:x64-windows boost-locale[icu]:x86-windows boost-locale[icu]:x64-windows boost-locale[icu]:x86-windows
The following packages will be rebuilt:
Package list omitted for brevity.
Additional packages (*) will be modified to complete this operation.
If you are sure you want to rebuild the above packages, run the command with the --recurse option

I am well aware that this error message suggests a solution, to use the --recurse option as follows.

vcpkg install boost-locale[icu]:x64-windows boost-locale[icu]:x64-windows boost-regex[icu]:x64-windows boost-regex[icu]:x64-windows --recurse

The problem is that this requires that many components of boost be built twice.

There should be one command to build all of boost with ICU support that does not require this rebuild nonsense.

port-feature question

Most helpful comment

To do it in a single command:

./vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet x64-windows --recurse

For what is worth, most of Boost is header only. So there's no actual buid and it should be fast to reinstall.

You can also enable binary caching by setting the VCPKG_FEATURE_FLAGS environment variable to binarycaching. This will save the build output when you install a library for the first time and restore it if you reinstall the library (provided that it is the same version).

In this case, libraries that depend on boost-regex or boost-locale need to rebuild, to take into account the now-enabled icu support.

All 9 comments

The port named boost in vcpkg is a collection of all components of boost, and it has only one feature mpi. If it needs to support ICU, we need to modify it.

Vcpkg builds and installs each port based on the _triplet_, so if we need to build new features to the ports of the installed _triplet_, we need to rebuild it.

Are you saying that there is currently no way to install all of boost with
ICU support?

In that case you need to modify the boost port. Which would you prefer,
having to use 20 or more commands to install boost, one for each boost-*
port or one command to install all of boost? If you are going to support a
one command build of boost, then have it support all possible options
related to building boost.


Ciao,
Ben Key
Email: [email protected] bkey76@gmail.com
Website: https://sullivanandkey.com/ https://sullivanandkey.com/


On Mon, Oct 21, 2019 at 9:27 PM JackBoosY notifications@github.com wrote:

The port named boost in vcpkg is a collection of all components of boost,
and it has only one feature mpi. If it needs to support ICU, we need to
modify it.

Vcpkg builds and installs each port based on the triplet, so if we need
to build new features to the ports of the installed triplet, we need to
rebuild it.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vcpkg/issues/8687?email_source=notifications&email_token=ABLGDU4R2XU55SUDNOP6WRDQPZQKDA5CNFSM4JDIU2EKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB4LPAY#issuecomment-544782211,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLGDU3MMXNJ7ZNJUD576FLQPZQKDANCNFSM4JDIU2EA
.

@BenKey Yes, I think we should do that.

To do it in a single command:

./vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet x64-windows --recurse

For what is worth, most of Boost is header only. So there's no actual buid and it should be fast to reinstall.

You can also enable binary caching by setting the VCPKG_FEATURE_FLAGS environment variable to binarycaching. This will save the build output when you install a library for the first time and restore it if you reinstall the library (provided that it is the same version).

In this case, libraries that depend on boost-regex or boost-locale need to rebuild, to take into account the now-enabled icu support.

I have a script I use to install all of boost and all the required packages and then let vcpkg make the determination of what order to install each component. The icu and mpi options get installed along with the rest of the boost libraries in a single pass.

This issue with the boost builds, that I've discovered, is much of the time the boost-build and boost-modular-build-helper components fail to be updated with the corrected version numbers.

Also, boost is building the .dll and .pbd with what appears to be the correct toolset and bitset in the installed bin directory but .lib appears to be built with the first toolset boost-build finds, in my case vc140 from VS2015, instead of vc141 for 2017 and vc142 for 2019. The .lib files also lack the boost version number. Lastly even though the .dll and .pdb files have vc141 or vc142 in the file names, they are in fact, in my case, being built with vc140 toolset - it seems boost the complete boost build is using the first toolset found regardless of what version of visual studio you're building for.

I researched, but my knowledge is limited, there is a way to set the toolset on the b2.exe command line with "--toolset=msvc-14.1" or "--toolset=msvc-14.2" or inside a project-config.jam, site-config.jam and/or user-config.jam files - but making the changes to vcpkg cmake files would be a task I have not enough knowledge to undertake.

Attached is the file I use to install the boost libraries....
vcpkg-4-install-boost.cmd.txt

In reference to my comment mentioned above about the toolset used by boost, here is the directory listing of installed boost libraries - bin versus lib directories for x64-windows built with VS2017, toolset vc141:

bin
SYSTEM@ANDROMEDA 10/22/2019 15:32:03 D:Gitvs2017installedx64-windowsbin
->dir boost*
Volume in drive D is Development
Volume Serial Number is 943D-BFCB

Directory of D:Gitvs2017installedx64-windowsbin

10/10/2019 09:47 9,728 BUILTINAdministrators boost_atomic-vc141-mt-x64-1_71.dll
10/10/2019 09:47 307,200 BUILTINAdministrators boost_atomic-vc141-mt-x64-1_71.pdb
10/10/2019 09:40 36,864 BUILTINAdministrators boost_chrono-vc141-mt-x64-1_71.dll
10/10/2019 09:40 1,306,624 BUILTINAdministrators boost_chrono-vc141-mt-x64-1_71.pdb
10/10/2019 09:45 53,760 BUILTINAdministrators boost_container-vc141-mt-x64-1_71.dll
10/10/2019 09:45 847,872 BUILTINAdministrators boost_container-vc141-mt-x64-1_71.pdb
10/10/2019 09:58 20,992 BUILTINAdministrators boost_context-vc141-mt-x64-1_71.dll
10/10/2019 09:58 790,528 BUILTINAdministrators boost_context-vc141-mt-x64-1_71.pdb
10/10/2019 09:59 91,136 BUILTINAdministrators boost_contract-vc141-mt-x64-1_71.dll
10/10/2019 09:59 1,839,104 BUILTINAdministrators boost_contract-vc141-mt-x64-1_71.pdb
10/10/2019 09:59 33,792 BUILTINAdministrators boost_coroutine-vc141-mt-x64-1_71.dll
10/10/2019 09:59 2,035,712 BUILTINAdministrators boost_coroutine-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 54,784 BUILTINAdministrators boost_date_time-vc141-mt-x64-1_71.dll
10/10/2019 09:47 1,347,584 BUILTINAdministrators boost_date_time-vc141-mt-x64-1_71.pdb
10/10/2019 09:58 77,312 BUILTINAdministrators boost_fiber-vc141-mt-x64-1_71.dll
10/10/2019 09:58 2,551,808 BUILTINAdministrators boost_fiber-vc141-mt-x64-1_71.pdb
10/10/2019 09:45 107,520 BUILTINAdministrators boost_filesystem-vc141-mt-x64-1_71.dll
10/10/2019 09:45 1,978,368 BUILTINAdministrators boost_filesystem-vc141-mt-x64-1_71.pdb
10/10/2019 09:50 252,928 BUILTINAdministrators boost_graph-vc141-mt-x64-1_71.dll
10/10/2019 09:50 5,058,560 BUILTINAdministrators boost_graph-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 105,984 BUILTINAdministrators boost_iostreams.dll
10/10/2019 09:47 1,519,616 BUILTINAdministrators boost_iostreams.pdb
10/10/2019 09:48 501,760 BUILTINAdministrators boost_locale-vc141-mt-x64-1_71.dll
10/10/2019 09:48 5,771,264 BUILTINAdministrators boost_locale-vc141-mt-x64-1_71.pdb
10/10/2019 10:01 665,600 BUILTINAdministrators boost_log-vc141-mt-x64-1_71.dll
10/10/2019 10:01 15,110,144 BUILTINAdministrators boost_log-vc141-mt-x64-1_71.pdb
10/10/2019 10:01 603,136 BUILTINAdministrators boost_log_setup-vc141-mt-x64-1_71.dll
10/10/2019 10:01 22,958,080 BUILTINAdministrators boost_log_setup-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 36,352 BUILTINAdministrators boost_math_c99-vc141-mt-x64-1_71.dll
10/10/2019 09:47 1,601,536 BUILTINAdministrators boost_math_c99-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 36,864 BUILTINAdministrators boost_math_c99f-vc141-mt-x64-1_71.dll
10/10/2019 09:47 1,593,344 BUILTINAdministrators boost_math_c99f-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 34,816 BUILTINAdministrators boost_math_c99l-vc141-mt-x64-1_71.dll
10/10/2019 09:47 1,593,344 BUILTINAdministrators boost_math_c99l-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 152,064 BUILTINAdministrators boost_math_tr1-vc141-mt-x64-1_71.dll
10/10/2019 09:47 2,510,848 BUILTINAdministrators boost_math_tr1-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 166,400 BUILTINAdministrators boost_math_tr1f-vc141-mt-x64-1_71.dll
10/10/2019 09:47 2,568,192 BUILTINAdministrators boost_math_tr1f-vc141-mt-x64-1_71.pdb
10/10/2019 09:47 152,064 BUILTINAdministrators boost_math_tr1l-vc141-mt-x64-1_71.dll
10/10/2019 09:47 2,502,656 BUILTINAdministrators boost_math_tr1l-vc141-mt-x64-1_71.pdb
10/10/2019 10:01 202,752 BUILTINAdministrators boost_mpi-vc141-mt-x64-1_71.dll
10/10/2019 10:01 2,936,832 BUILTINAdministrators boost_mpi-vc141-mt-x64-1_71.pdb
10/10/2019 09:50 66,048 BUILTINAdministrators boost_prg_exec_monitor-vc141-mt-x64-1_71.dll
10/10/2019 09:50 1,306,624 BUILTINAdministrators boost_prg_exec_monitor-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 433,664 BUILTINAdministrators boost_program_options-vc141-mt-x64-1_71.dll
10/10/2019 10:02 4,558,848 BUILTINAdministrators boost_program_options-vc141-mt-x64-1_71.pdb
10/10/2019 09:58 227,840 BUILTINAdministrators boost_python37-vc141-mt-x64-1_71.dll
10/10/2019 09:58 4,231,168 BUILTINAdministrators boost_python37-vc141-mt-x64-1_71.pdb
10/10/2019 09:49 31,744 BUILTINAdministrators boost_random-vc141-mt-x64-1_71.dll
10/10/2019 09:49 1,150,976 BUILTINAdministrators boost_random-vc141-mt-x64-1_71.pdb
10/10/2019 09:44 999,936 BUILTINAdministrators boost_regex-vc141-mt-x64-1_71.dll
10/10/2019 09:44 10,498,048 BUILTINAdministrators boost_regex-vc141-mt-x64-1_71.pdb
10/10/2019 09:48 238,592 BUILTINAdministrators boost_serialization-vc141-mt-x64-1_71.dll
10/10/2019 09:48 6,836,224 BUILTINAdministrators boost_serialization-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 61,440 BUILTINAdministrators boost_signals-vc141-mt-x64-1_71.dll
10/10/2019 10:02 1,363,968 BUILTINAdministrators boost_signals-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 10,240 BUILTINAdministrators boost_stacktrace_noop-vc141-mt-x64-1_71.dll
10/10/2019 10:02 536,576 BUILTINAdministrators boost_stacktrace_noop-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 24,576 BUILTINAdministrators boost_stacktrace_windbg-vc141-mt-x64-1_71.dll
10/10/2019 10:02 815,104 BUILTINAdministrators boost_stacktrace_windbg-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 25,600 BUILTINAdministrators boost_stacktrace_windbg_cached-vc141-mt-x64-1_71.dll
10/10/2019 10:02 847,872 BUILTINAdministrators boost_stacktrace_windbg_cached-vc141-mt-x64-1_71.pdb
10/10/2019 09:40 9,728 BUILTINAdministrators boost_system-vc141-mt-x64-1_71.dll
10/10/2019 09:40 307,200 BUILTINAdministrators boost_system-vc141-mt-x64-1_71.pdb
10/10/2019 09:48 91,136 BUILTINAdministrators boost_thread-vc141-mt-x64-1_71.dll
10/10/2019 09:48 2,306,048 BUILTINAdministrators boost_thread-vc141-mt-x64-1_71.pdb
10/10/2019 10:02 29,184 BUILTINAdministrators boost_timer-vc141-mt-x64-1_71.dll
10/10/2019 10:02 1,159,168 BUILTINAdministrators boost_timer-vc141-mt-x64-1_71.pdb
10/10/2019 09:49 41,984 BUILTINAdministrators boost_type_erasure-vc141-mt-x64-1_71.dll
10/10/2019 09:49 1,478,656 BUILTINAdministrators boost_type_erasure-vc141-mt-x64-1_71.pdb
10/10/2019 09:50 577,536 BUILTINAdministrators boost_unit_test_framework-vc141-mt-x64-1_71.dll
10/10/2019 09:50 8,622,080 BUILTINAdministrators boost_unit_test_framework-vc141-mt-x64-1_71.pdb
10/10/2019 10:03 876,032 BUILTINAdministrators boost_wave-vc141-mt-x64-1_71.dll
10/10/2019 10:03 27,455,488 BUILTINAdministrators boost_wave-vc141-mt-x64-1_71.pdb
10/10/2019 09:48 164,352 BUILTINAdministrators boost_wserialization-vc141-mt-x64-1_71.dll
10/10/2019 09:48 5,648,384 BUILTINAdministrators boost_wserialization-vc141-mt-x64-1_71.pdb
76 File(s) 165,157,888 bytes
0 Dir(s) 499,123,060,736 bytes free

lib
SYSTEM@ANDROMEDA 10/22/2019 15:34:45 D:Gitvs2017installedx64-windowslib
->dir boost*
Volume in drive D is Development
Volume Serial Number is 943D-BFCB

Directory of D:Gitvs2017installedx64-windowslib

10/10/2019 09:47 3,530 BUILTINAdministrators boost_atomic-vc140-mt.lib
10/10/2019 09:40 24,940 BUILTINAdministrators boost_chrono-vc140-mt.lib
10/10/2019 09:45 46,428 BUILTINAdministrators boost_container-vc140-mt.lib
10/10/2019 09:58 17,010 BUILTINAdministrators boost_context-vc140-mt.lib
10/10/2019 09:59 42,860 BUILTINAdministrators boost_contract-vc140-mt.lib
10/10/2019 09:59 11,536 BUILTINAdministrators boost_coroutine-vc140-mt.lib
10/10/2019 09:47 30,188 BUILTINAdministrators boost_date_time-vc140-mt.lib
10/10/2019 09:45 34,130 BUILTINAdministrators boost_exception-vc140-mt.lib
10/10/2019 09:58 67,932 BUILTINAdministrators boost_fiber-vc140-mt.lib
10/10/2019 09:45 60,804 BUILTINAdministrators boost_filesystem-vc140-mt.lib
10/10/2019 09:50 3,302 BUILTINAdministrators boost_graph-vc140-mt.lib
10/10/2019 09:47 100,394 BUILTINAdministrators boost_iostreams-vc140-mt.lib
10/10/2019 09:48 101,912 BUILTINAdministrators boost_locale-vc140-mt.lib
10/10/2019 10:01 282,046 BUILTINAdministrators boost_log-vc140-mt.lib
10/10/2019 10:01 12,864 BUILTINAdministrators boost_log_setup-vc140-mt.lib
10/10/2019 09:47 8,058 BUILTINAdministrators boost_math_c99-vc140-mt.lib
10/10/2019 09:47 8,196 BUILTINAdministrators boost_math_c99f-vc140-mt.lib
10/10/2019 09:47 8,196 BUILTINAdministrators boost_math_c99l-vc140-mt.lib
10/10/2019 09:47 6,776 BUILTINAdministrators boost_math_tr1-vc140-mt.lib
10/10/2019 09:47 6,912 BUILTINAdministrators boost_math_tr1f-vc140-mt.lib
10/10/2019 09:47 6,912 BUILTINAdministrators boost_math_tr1l-vc140-mt.lib
10/10/2019 10:01 379,200 BUILTINAdministrators boost_mpi-vc140-mt.lib
10/10/2019 10:02 485,530 BUILTINAdministrators boost_program_options-vc140-mt.lib
10/10/2019 09:58 180,984 BUILTINAdministrators boost_python37-vc140-mt.lib
10/10/2019 09:49 3,932 BUILTINAdministrators boost_random-vc140-mt.lib
10/10/2019 09:44 1,341,680 BUILTINAdministrators boost_regex-vc140-mt.lib
10/10/2019 09:48 208,042 BUILTINAdministrators boost_serialization-vc140-mt.lib
10/10/2019 10:02 63,418 BUILTINAdministrators boost_signals-vc140-mt.lib
10/10/2019 10:02 6,502 BUILTINAdministrators boost_stacktrace_noop-vc140-mt.lib
10/10/2019 10:02 6,542 BUILTINAdministrators boost_stacktrace_windbg-vc140-mt.lib
10/10/2019 10:02 6,684 BUILTINAdministrators boost_stacktrace_windbg_cached-vc140-mt.lib
10/10/2019 09:40 2,254 BUILTINAdministrators boost_system-vc140-mt.lib
10/10/2019 09:48 29,214 BUILTINAdministrators boost_thread-vc140-mt.lib
10/10/2019 10:02 15,068 BUILTINAdministrators boost_timer-vc140-mt.lib
10/10/2019 09:49 3,552 BUILTINAdministrators boost_type_erasure-vc140-mt.lib
10/10/2019 09:50 301,514 BUILTINAdministrators boost_unit_test_framework-vc140-mt.lib
10/10/2019 10:03 151,172 BUILTINAdministrators boost_wave-vc140-mt.lib
10/10/2019 09:48 93,986 BUILTINAdministrators boost_wserialization-vc140-mt.lib
38 File(s) 4,164,200 bytes
0 Dir(s) 499,123,060,736 bytes free

I hope you can understand what I'm conveying about the descrepencey in the toolset version between the bin and lib files.

Thank you and have a wonderful day!

Update: After further research the .lib files are named correctly in the buildtreesboostbuild and buildtrees(rel or dbg)stagelib folders.

Somehow when they get copied to installedlib, installeddebuglib, packages_lib and packages_debuglib they get the wrong toolset version and the boost version is lost completely?

For example, take boost-atomic... the file are named as follows after ".vcpkg.exe install boost-atomic[core]:x64-windows:

buildtreesboost-atomicx64-windows-relboostbuildboost_atomic-vc142-mt-x64-1_71.lib
buildtreesboost-atomicx64-windows-relstagelibboost_atomic-vc142-mt-x64-1_71.lib

buildtreesboost-atomicx64-windows-dbgboostbuildboost_atomic-vc142-mt-gd-x64-1_71.lib
buildtreesboost-atomicx64-windows-dbgstagelibboost_atomic-vc142-mt-gd-x64-1_71.lib

Are then copied/renamed as:

installedx64-windowslibboost_atomic-vc140-mt.lib
installedx64-windowsdebuglibboost_atomic-vc140-mt-gd.lib

packagesboost-atomic_x64-windowslibboost_atomic-vc140-mt.lib
packagesboost-atomic_x64-windowsdebuglibboost_atomic-vc140-mt-gd.lib

Hope this isn't too confusing, but just wanted to make this aware again, this is on Windows 10, x64-windows triplet.

This is exactly what I needed. Thanks.


Ciao,
Ben Key
Email: [email protected] bkey76@gmail.com
Website: https://sullivanandkey.com/ https://sullivanandkey.com/


On Tue, Oct 22, 2019 at 2:05 PM Victor Romero notifications@github.com
wrote:

To do it in a single command:

./vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet
x64-windows --recurse

For what is worth, most of Boost is header only. So there's no actual buid
so it should be fast, only the time it takes to copy the header files into
the /installed directory.

You can also enable binary caching by setting the VCPKG_FEATURE_FLAGS
environment variable to binarycaching. This will save the build output
when you install a library for the first time and restore it if you
reinstall the library (provided that it is the same version).

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vcpkg/issues/8687?email_source=notifications&email_token=ABLGDUYDMYKQFK44DXRSC5TQP5FGPA5CNFSM4JDIU2EKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEB63BQY#issuecomment-545108163,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ABLGDU3KRXHFFRR6NRZUYC3QP5FGPANCNFSM4JDIU2EA
.

As @vicroms pointed out, the following command does exactly what I wanted.

./vcpkg install boost-locale[icu] boost-regex[icu] boost --triplet x64-windows --recurse

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cskrisz picture cskrisz  Â·  3Comments

madkoala picture madkoala  Â·  3Comments

husseinalihazime picture husseinalihazime  Â·  3Comments

angelmixu picture angelmixu  Â·  3Comments

grandprixgp picture grandprixgp  Â·  3Comments