[bjam] Building Regex with static runtime linking

Hello, I want my program to be statically linked to runtime libs, which is using Boost.Regex. I'm using the following command: bjam --toolset=msvc-9.0 --builddir=./ --address-model=32 --link=static --runtime-link=static --threading=multi stage --build-type=complete --with-regex But I get the following error message: error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use IMO, the option specified by "--link=static " is overlooked by bjam. What's the problem? Thanks for any information. B/Rgds Max

I want my program to be statically linked to runtime libs, which is using Boost.Regex.
I'm using the following command:
bjam --toolset=msvc-9.0 --builddir=./ --address-model=32 --link=static --runtime-link=static --threading=multi stage --build-type=complete --with-regex
But I get the following error message:
error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use
IMO, the option specified by "--link=static " is overlooked by bjam. What's the problem?
Thanks for any information.
There are two issues here: it should be link=static runtime-link=static i.e. without the leading "--", and also build-type=complete then conflicts with the request to build static lib's only. The easiest option is to just specify "--build-type=complete" and leave out the other options, otherwise it would need to be something like: bjam toolset=msvc-9.0 link=static runtime-link=static release ebug --with-regex which should give you 2 static lib variants linked against the 2 msvc static runtimes. HTH, John.

Subject: Re: [Boost-users] [bjam] Building Regex with static runtime
Hello John, linking
I want my program to be statically linked to runtime libs, which is
using
Boost.Regex.
I'm using the following command:
bjam --toolset=msvc-9.0 --builddir=./ --address-model=32 --link=static --runtime-link=static --threading=multi stage --build-type=complete --with-regex
But I get the following error message:
error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use
IMO, the option specified by "--link=static " is overlooked by bjam. What's the problem?
Thanks for any information.
There are two issues here: it should be link=static runtime-link=static i.e. without the leading "--", and also build-type=complete then conflicts with the request to build static lib's only. The easiest option is to just specify "--build-type=complete" and leave out the other options, otherwise it would need to be something like:
bjam toolset=msvc-9.0 link=static runtime-link=static release ebug --with-regex
I have tried with this bjam toolset=msvc-9.0 link=static runtime-link=static release debug --with-regex stage but I get WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python targets error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use In fact, I have ever used this bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=shared threading=multi stage debug release --with-program_options and got the expected lib's (So do test, date_time, thread, signal, serialization and filesystem). But with this bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=shared threading=multi stage debug release --with-regex -sHAVE_ICU=1 (with or w/o -sHAVE_ICU=1 does not make difference) I got the a.m. error message. How is Regex different from program_options in this matter?
which should give you 2 static lib variants linked against the 2 msvc
static
runtimes.
HTH, John.
Thank you very much, John. You are always warm-hearted and very helpful. :-) B/Rgds Max

AMDG Max wrote:
I have tried with this
bjam toolset=msvc-9.0 link=static runtime-link=static release debug --with-regex stage
but I get
WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python targets error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use
<snip>
Seems to work for me... C:\boost\trunk>bjam toolset=msvc-9.0express link=static runtime-link=static release debug --with-regex stage In Christ, Steven Watanabe

bjam toolset=msvc-9.0 link=static runtime-link=static release debug --with-regex stage
but I get
WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python
targets
error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use
<snip>
Seems to work for me...
C:\boost\trunk>bjam toolset=msvc-9.0express link=static runtime-link=static release debug --with-regex stage
Thanks for your time, Steven. I just don't know how regex is different here. I'm using a batch file with the contents: set BZIP2_SOURCE="E:\Lib\bzip2-1.0.5" set ZLIB_SOURCE="E:\Lib\zlib-1.2.3" set ICU_PATH="E:\lib\icu" set HAVE_ICU=1 bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-filesystem bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-serialization bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-regex -sHAVE_ICU=1 bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-signals bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-thread bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-date_time bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-test bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-program_options bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release After finished, I get all of the other lib's except those of regex. Best Max

Max wrote:
bjam toolset=msvc-9.0 link=static runtime-link=static release debug --with-regex stage
but I get
WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python
targets
error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use
<snip>
Seems to work for me...
C:\boost\trunk>bjam toolset=msvc-9.0express link=static runtime-link=static release debug --with-regex stage
Thanks for your time, Steven. I just don't know how regex is different here. I'm using a batch file with the contents:
set BZIP2_SOURCE="E:\Lib\bzip2-1.0.5" set ZLIB_SOURCE="E:\Lib\zlib-1.2.3" set ICU_PATH="E:\lib\icu" set HAVE_ICU=1
bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-filesystem bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-serialization bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-regex -sHAVE_ICU=1 bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-signals bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-thread bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-date_time bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-test bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release --with-program_options bjam --toolset=msvc --builddir=./ address-model=32 link=static runtime-link=static threading=multi stage debug release
After finished, I get all of the other lib's except those of regex.
Please run the problematic command with the --debug-building option and provide the output. Also, be sure to specify the exact version of Boost and Boost.Build - Volodya

Please run the problematic command with the --debug-building option and provide the output. Also, be sure to specify the exact version of Boost and
Boost.Build
- Volodya
Hello Volodya,
Thanks for your reply.
The problem seems to be related to ICU (installation).
with out
set ICU_PATH="E:\lib\icu"
set HAVE_ICU=1
in my batch file, I get the regex static lib's.
but with it, the problem comes.
here's the output on my machine with ICU enabled:
#######################################################################
E:\Lib\boost_1_39_0>set BZIP2_SOURCE="E:\Lib\bzip2-1.0.5"
E:\Lib\boost_1_39_0>set ZLIB_SOURCE="E:\Lib\zlib-1.2.3"
E:\Lib\boost_1_39_0>set ICU_PATH="E:\lib\icu"
E:\Lib\boost_1_39_0>set HAVE_ICU=1
E:\Lib\boost_1_39_0>bjam toolset=msvc-9.0 link=static runtime-link=static
release debug --with-regex stage --debug-building
WARNING: No python installation configured and autoconfiguration
failed. See http://www.boost.org/libs/python/doc/building.html
for configuration instructions or pass --without-python to
suppress this message and silently skip all Boost.Python targets
Building target './stage'
Build request: object(property-set)@424 <debug-symbols>off
<define>NDEBUG <inlining>full <link>static <optimization>speed
<runtime-debugging>off <runtime-link>static <threading>multi
toolset-msvc:version9.0 <toolset>msvc <variant>release
Command line free features:
Target requirements:
<conditional>@Jamfile%Jamfile.ha
ndle-static-runtime <define>BOOST_ALL_NO_LIB=1 <include>.
<tag>@Jamfile%Jamfile.tag
<toolset>msvc,<runtime-link>shared:<threading>multi
<toolset>sun:<stdlib>sun-stlport
Common properties: <asynch-exceptions>off
<conditional>@Jamfile%Jamfile.ha
ndle-static-runtime <debug-store>object <debug-symbols>off
<define>BOOST_ALL_NO_LIB=1 <define>NDEBUG <embed-manifest>on
<exception-handling>on <extern-c-nothrow>off <hardcode-dll-paths>true
<host-os>windows <include>. <inlining>full <install-dependencies>off
<link>static <midl-robust>yes <midl-stubless-proxy>yes <optimization>speed
<os>NT <pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off <python>2.5 <rtti>on <runtime-debugging>off
<runtime-link>static <stdlib>native <suppress-import-lib>false
<symlink-location>project-relative
<tag>@Jamfile%Jamfile.tag
<target-os>windows <threadapi>win32 <threading>multi
toolset-msvc:version9.0 <toolset>msvc <user-interface>console
<variant>release <warnings-as-errors>off <warnings>on
Building target './stage-proper'
Build request: object(property-set)@431 <asynch-exceptions>off
<debug-store>object <debug-symbols>off <define>NDEBUG <embed-manifest>on
<exception-handling>on <extern-c-nothrow>off <inlining>full <link>static
<midl-robust>yes <midl-stubless-proxy>yes <optimization>speed <os>NT <pch>on
<preserve-test-targets>on <profiling>off <python-debugging>off <python>2.5
<rtti>on <runtime-debugging>off <runtime-link>static <stdlib>native
<target-os>windows <threadapi>win32 <threading>multi
toolset-msvc:version9.0 <toolset>msvc <variant>release
<warnings-as-errors>off <warnings>on
Command line free features:
Target requirements:
<conditional>@Jamfile%Jamfile.ha
ndle-static-runtime <define>BOOST_ALL_NO_LIB=1 <hardcode-dll-paths>false
<include>. <install-dependencies>on <install-no-version-symlinks>on
<install-type>LIB <location>stage/lib
<tag>@Jamfile%Jamfile.tag
<toolset>msvc,<runtime-link>shared:<threading>multi
<toolset>sun:<stdlib>sun-stlport
Common properties: <asynch-exceptions>off
<conditional>@Jamfile%Jamfile.ha
ndle-static-runtime <debug-store>object <debug-symbols>off
<define>BOOST_ALL_NO_LIB=1 <define>NDEBUG <embed-manifest>on
<exception-handling>on <extern-c-nothrow>off <hardcode-dll-paths>false
<host-os>windows <include>. <inlining>full <install-dependencies>on
<install-no-version-symlinks>on <install-type>LIB <link>static
<location>stage/lib <midl-robust>yes <midl-stubless-proxy>yes
<optimization>speed <os>NT <pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off <python>2.5 <rtti>on <runtime-debugging>off
<runtime-link>static <stdlib>native <suppress-import-lib>false
<symlink-location>project-relative
<tag>@Jamfile%Jamfile.tag
<target-os>windows <threadapi>win32 <threading>multi
toolset-msvc:version9.0 <toolset>msvc <user-interface>console
<variant>release <warnings-as-errors>off <warnings>on
building project Jamfile
('object(project-target)@248') with <asynch-exceptions>off
<debug-store>object <debug-symbols>off <embed-manifest>on
<exception-handling>on <extern-c-nothrow>off <inlining>full <link>static
<midl-robust>yes <midl-stubless-proxy>yes <optimization>speed <os>NT <pch>on
<preserve-test-targets>on <profiling>off <python-debugging>off <python>2.5
<rtti>on <runtime-debugging>off <runtime-link>static <stdlib>native
<target-os>windows <threadapi>win32 <threading>multi
toolset-msvc:version9.0 <toolset>msvc <variant>release
<warnings-as-errors>off <warnings>on
Building target 'libs/regex/build/icucore'
Build request: object(property-set)@431
<asynch-exceptions>off <debug-store>object <debug-symbols>off <define>NDEBUG
<embed-manifest>on <exception-handling>on <extern-c-nothrow>off
<inlining>full <link>static <midl-robust>yes <midl-stubless-proxy>yes
<optimization>speed <os>NT <pch>on <preserve-test-targets>on <profiling>off
<python-debugging>off <python>2.5 <rtti>on <runtime-debugging>off
<runtime-link>static <stdlib>native <target-os>windows <threadapi>win32
<threading>multi toolset-msvc:version9.0 <toolset>msvc <variant>release
<warnings-as-errors>off <warnings>on
Command line free features:
Target requirements:
<conditional>@Jamfile%Jamfile.ha
ndle-static-runtime <define>BOOST_ALL_NO_LIB=1 <include>. <link>shared
<name>icuuc <python>2.5,<target-os>windows:
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Max wrote:
Please run the problematic command with the --debug-building option and provide the output. Also, be sure to specify the exact version of Boost and
Boost.Build
- Volodya
Hello Volodya,
Thanks for your reply.
The problem seems to be related to ICU (installation).
with out set ICU_PATH="E:\lib\icu" set HAVE_ICU=1 in my batch file, I get the regex static lib's.
but with it, the problem comes.
...
Building target 'libs/regex/build/icucore' Build request: object(property-set)@431 <asynch-exceptions>off <debug-store>object <debug-symbols>off <define>NDEBUG <embed-manifest>on <exception-handling>on <extern-c-nothrow>off <inlining>full <link>static <midl-robust>yes <midl-stubless-proxy>yes <optimization>speed <os>NT <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>2.5 <rtti>on <runtime-debugging>off <runtime-link>static <stdlib>native <target-os>windows <threadapi>win32 <threading>multi toolset-msvc:version9.0 <toolset>msvc <variant>release <warnings-as-errors>off <warnings>on Command line free features: Target requirements: <conditional>@Jamfile%Jamfile.ha ndle-static-runtime <define>BOOST_ALL_NO_LIB=1 <include>. <link>shared <name>icuuc <python>2.5,<target-os>windows:
python <search>/E:/lib/icu/lib <tag>@Jamfile%Jamfile.tag <toolset>msvc,<runtime-link>shared:<threading>multi <toolset>sun:<stdlib>sun-stlport error: link=shared together with runtime-link=static is not allowed error: such property combination is either impossible error: or too dangerious to be of any use #######################################################################
Thanks. John, why is icucore target (and other icu targets), have <link>shared in requirements? There's a number of ways to fix the direct issue above, but I need to know what was the original intention. - Volodya

John, why is icucore target (and other icu targets), have <link>shared in requirements? There's a number of ways to fix the direct issue above, but I need to know what was the original intention.
Ah, good point: the libraries that ICU supply are DLL's, you can't use them with the static msvc runtime as far as I know unless the OP has done a custom build of ICU? John.

John, why is icucore target (and other icu targets), have <link>shared in requirements? There's a number of ways to fix the direct issue above, but I need to know what was the original intention.
Ah, good point: the libraries that ICU supply are DLL's, you can't use them with the static msvc runtime as far as I know unless the OP has done a custom build of ICU?
That's the point. I don't remember exactly what I have done during the process of installing ICU. But one thing clear is that I haven't modified the solution configuration that comes with the original package. Thank you for you time, John. B/Rgds Max

Max wrote:
John, why is icucore target (and other icu targets), have <link>shared in requirements? There's a number of ways to fix the direct issue above, but I need to know what was the original intention.
Ah, good point: the libraries that ICU supply are DLL's, you can't use them with the static msvc runtime as far as I know unless the OP has done a custom build of ICU?
That's the point. I don't remember exactly what I have done during the process of installing ICU. But one thing clear is that I haven't modified the solution configuration that comes with the original package.
And do you have static libs for ICU? If not, then per John statement above, you cannot use ICU with static runtime. - Volodya

And do you have static libs for ICU? If not, then per John statement
above,
you cannot use ICU with static runtime.
- Volodya
No. I think it's not a difficult task to change the solution configuration of ICU to get the static libs. But I don't know whether I need to specially change the names of resulting static version libs to make them in line with those expected by bjam. Probably the author of the bjam building scripts can tell immediately the answer without even having a look at the code. :-) Static version of the unicode-enabled regex is not a must-have of me so far. Any time that becomes the case, I will have a more deeper test. Thank you all for your help. B/Rgds Max

Max wrote:
And do you have static libs for ICU? If not, then per John statement
above,
you cannot use ICU with static runtime.
- Volodya
No. I think it's not a difficult task to change the solution configuration of ICU to get the static libs. But I don't know whether I need to specially change the names of resulting static version libs to make them in line with those expected by bjam.
[BTW, bjam is a low-level, and dumb, build engine. You are talking about Boost.Build here]. Boost.Build will use icucore.lib on the command line (and similar for other libraries). MSVC does not have a way to explicitly request static or shared variant.
Probably the author of the bjam building scripts can tell immediately the answer without even having a look at the code. :-)
See above.
Static version of the unicode-enabled regex is not a must-have of me so far. Any time that becomes the case, I will have a more deeper test.
Thank you all for your help.
I'd suggest that you and John figure out what behaviour is right. Implementing pretty much everything is trivial, but I don't know anything about ICU so don't know what's right. - Volodya

No. I think it's not a difficult task to change the solution configuration of ICU to get the static libs. But I don't know whether I need to specially change the names of resulting static version libs to make them in line with those expected by bjam.
[BTW, bjam is a low-level, and dumb, build engine. You are talking about Boost.Build here].
Sorry for the confusion and thanks for the clarification.
Boost.Build will use icucore.lib on the command line (and similar for
libraries). MSVC does not have a way to explicitly request static or shared variant.
Probably the author of the bjam building scripts can tell immediately
other the
answer without even having a look at the code. :-)
See above.
Thanks for the quick answer. What I meant is that I guess the static lib of icucore is possible to need a trailing 's' or so to cooperate with regex, just as a postfix of 'd' is often used to mark the debug version of a lib.
Static version of the unicode-enabled regex is not a must-have of me so
far.
Any time that becomes the case, I will have a more deeper test.
Thank you all for your help.
I'd suggest that you and John figure out what behaviour is right. Implementing pretty much everything is trivial, but I don't know anything about ICU so don't know what's right.
I think the support of static ICU-enabled regex would make regex more seamless. That being said, I guess John is the right person to figure it out. :-) B/Rgds Max

That's the point. I don't remember exactly what I have done during the process of installing ICU. But one thing clear is that I haven't modified the solution configuration that comes with the original package.
In that case, you are restricted to using the same msvc runtime that ICU uses (assuming you are committed to using regex with ICU - regex and Win32 provide passable Unicode support without it via boost::wregex).
Thank you for you time, John.
No problem, Regards, John.

That's the point. I don't remember exactly what I have done during the process of installing ICU. But one thing clear is that I haven't modified the solution configuration that comes with the original package.
In that case, you are restricted to using the same msvc runtime that ICU uses (assuming you are committed to using regex with ICU - regex and Win32 provide passable Unicode support without it via boost::wregex).
That means I can get unicode support without ICU in the Win32 environment? If that's true, then what is ICU for? B/Rgds Max

That's the point. I don't remember exactly what I have done during the process of installing ICU. But one thing clear is that I haven't modified the solution configuration that comes with the original package.
In that case, you are restricted to using the same msvc runtime that ICU uses (assuming you are committed to using regex with ICU - regex and Win32 provide passable Unicode support without it via boost::wregex).
That means I can get unicode support without ICU in the Win32 environment? If that's true, then what is ICU for?
It depends how complete you want the Unicode support, have you seen: http://www.boost.org/doc/libs/1_39_0/libs/regex/doc/html/boost_regex/unicode... ? Basically on Win32 character classification and upper/lower case conversion works OK in wregex, but Unicode specific character classes like [[:lu:]] can't be used, likewise nothing in icu.hpp (so UTF8 support for example). HTH, John.

In that case, you are restricted to using the same msvc runtime that
ICU
uses (assuming you are committed to using regex with ICU - regex and Win32 provide passable Unicode support without it via boost::wregex).
That means I can get unicode support without ICU in the Win32 environment? If that's true, then what is ICU for?
It depends how complete you want the Unicode support, have you seen: http://www.boost.org/doc/libs/1_39_0/libs/regex/doc/html/boost_regex/unic ode.html ?
Basically on Win32 character classification and upper/lower case conversion works OK in wregex, but Unicode specific character classes like [[:lu:]] can't be used, likewise nothing in icu.hpp (so UTF8 support for example).
HTH, John.
Thanks for the explanation. Best, Max
participants (5)
-
John Maddock
-
Max
-
Max
-
Steven Watanabe
-
Vladimir Prus