Boost logo

Boost :

Subject: Re: [boost] regex/ICU fix
From: Vladimir Prus (vladimir_at_[hidden])
Date: 2009-08-23 11:53:45


John Maddock wrote:

>>> Yes the ICU binary is always a dll, linked to the shared runtime.
>>> However,
>>> the regex binary could be a static lib as long as links to the same
>>> shared
>>> runtime as the ICU dll.
>>
>> OK, I have checked in this:
>>
>> https://svn.boost.org/trac/boost/changeset/55685
>
> Testing on Win32 checks out OK, but on Linux I see some errors, first off:
>
> john_at_john-laptop:~/boost/trunk$ bjam
> stage --with-regex -sHAVE_ICU=1 --build-type=complete
> Note: Building Boost.Regex with Unicode/ICU support enabled
> Using ICU in
> warning: forcing runtime-link=shared for Boost.Regex
> warning: this is required when using the ICU library
> /home/john/boost/trunk/tools/build/v2/build/virtual-target.jam:1056: in
> virtual-target.register-actual-name from module virtual-target
> error: Duplicate name of actual target: <pstage/lib>libboost_regex.a
> error: previous virtual target {
> common%common.copy-libboost_regex.a.STATIC_LIB {
> gcc%gcc.archive-libboost_regex.a.STATIC_LIB {
> gcc%gcc.compile.c++-c_regex_traits.o.OBJ { ../src/c_regex_traits.cpp.CPP } }
> { gcc%gcc.compile.c++-cpp_regex_traits.o.OBJ {
> ../src/cpp_regex_traits.cpp.CPP } } { gcc%gcc.compile.c++-cregex.o.OBJ {
> ../src/cregex.cpp.CPP } } { gcc%gcc.compile.c++-fileiter.o.OBJ {
> ../src/fileiter.cpp.CPP } } { gcc%gcc.compile.c++-icu.o.OBJ {
> ../src/icu.cpp.CPP } } { gcc%gcc.compile.c++-instances.o.OBJ {
> ../src/instances.cpp.CPP } } { gcc%gcc.compile.c++-posix_api.o.OBJ {
> ../src/posix_api.cpp.CPP } } { gcc%gcc.compile.c++-regex.o.OBJ {
> ../src/regex.cpp.CPP } } { gcc%gcc.compile.c++-regex_debug.o.OBJ {
> ../src/regex_debug.cpp.CPP } } { gcc%gcc.compile.c++-regex_raw_buffer.o.OBJ
> { ../src/regex_raw_buffer.cpp.CPP } } {
> gcc%gcc.compile.c++-regex_traits_defaults.o.OBJ {
> ../src/regex_traits_defaults.cpp.CPP } } {
> gcc%gcc.compile.c++-static_mutex.o.OBJ { ../src/static_mutex.cpp.CPP } } {
> gcc%gcc.compile.c++-w32_regex_traits.o.OBJ {
> ../src/w32_regex_traits.cpp.CPP } } {
> gcc%gcc.compile.c++-wc_regex_traits.o.OBJ {
> ../src/wc_regex_traits.cpp.CPP } } {
> gcc%gcc.compile.c++-wide_posix_api.o.OBJ { ../src/wide_posix_api.cpp.CPP } }
> { gcc%gcc.compile.c++-winstances.o.OBJ { ../src/winstances.cpp.CPP } } {
> gcc%gcc.compile.c++-usinstances.o.OBJ { ../src/usinstances.cpp.CPP } } } }
> error: created from ./stage-proper
> error: another virtual target {
> common%common.copy-libboost_regex.a.STATIC_LIB {
> gcc%gcc.archive-libboost_regex.a.STATIC_LIB {
> gcc%gcc.compile.c++-c_regex_traits.o.OBJ { ../src/c_regex_traits.cpp.CPP } }
> { gcc%gcc.compile.c++-cpp_regex_traits.o.OBJ {
> ../src/cpp_regex_traits.cpp.CPP } } { gcc%gcc.compile.c++-cregex.o.OBJ {
> ../src/cregex.cpp.CPP } } { gcc%gcc.compile.c++-fileiter.o.OBJ {
> ../src/fileiter.cpp.CPP } } { gcc%gcc.compile.c++-icu.o.OBJ {
> ../src/icu.cpp.CPP } } { gcc%gcc.compile.c++-instances.o.OBJ {
> ../src/instances.cpp.CPP } } { gcc%gcc.compile.c++-posix_api.o.OBJ {
> ../src/posix_api.cpp.CPP } } { gcc%gcc.compile.c++-regex.o.OBJ {
> ../src/regex.cpp.CPP } } { gcc%gcc.compile.c++-regex_debug.o.OBJ {
> ../src/regex_debug.cpp.CPP } } { gcc%gcc.compile.c++-regex_raw_buffer.o.OBJ
> { ../src/regex_raw_buffer.cpp.CPP } } {
> gcc%gcc.compile.c++-regex_traits_defaults.o.OBJ {
> ../src/regex_traits_defaults.cpp.CPP } } {
> gcc%gcc.compile.c++-static_mutex.o.OBJ { ../src/static_mutex.cpp.CPP } } {
> gcc%gcc.compile.c++-w32_regex_traits.o.OBJ {
> ../src/w32_regex_traits.cpp.CPP } } {
> gcc%gcc.compile.c++-wc_regex_traits.o.OBJ {
> ../src/wc_regex_traits.cpp.CPP } } {
> gcc%gcc.compile.c++-wide_posix_api.o.OBJ { ../src/wide_posix_api.cpp.CPP } }
> { gcc%gcc.compile.c++-winstances.o.OBJ { ../src/winstances.cpp.CPP } } {
> gcc%gcc.compile.c++-usinstances.o.OBJ { ../src/usinstances.cpp.CPP } } } }
> error: created from ./stage-proper
> error: added properties: <debug-symbols>off <define>NDEBUG <inlining>full
> <optimization>speed <runtime-debugging>off <variant>release
> error: removed properties: <debug-symbols>on <inlining>off <optimization>off
> <runtime-debugging>on <variant>debug
> /home/john/boost/trunk/tools/build/v2/build/virtual-target.jam:480: in
> actualize-no-scanner from module object(file-target)@1216
> /home/john/boost/trunk/tools/build/v2/build/virtual-target.jam:130: in
> object(file-target)@1216.actualize from module object(file-target)@1216
> /home/john/boost/trunk/tools/build/v2/build-system.jam:713: in load from
> module build-system
> /home/john/boost/trunk/tools/build/v2/kernel/modules.jam:283: in import from
> module modules
> /home/john/boost/trunk/tools/build/v2/kernel/bootstrap.jam:142: in
> boost-build from module
> /home/john/boost/trunk/boost-build.jam:17: in module scope from module
>
> Am I doing something wrong here? Is this due to the lib names not being
> mangled anymore? If so can we please have a better error message :-)
>
> And when I set ICU_PATH I see a different error:
>
> john_at_john-laptop:~/boost/trunk$ bjam
> stage --with-regex -sICU_PATH=../../download/open/icu-4.2
> /home/john/boost/trunk/tools/build/v2/build/property.jam:455: in
> property.translate-paths
> *** argument error
> * rule path.root ( path root )
> * called with: ( libs/regex/build )
> * missing argument root
> /home/john/boost/trunk/tools/build/v2/util/path.jam:201:see definition of
> rule 'root' being called

While the error message could be better, I believe the error is yours :-)
See this code:

 36689 johnmaddock if $(ICU_PATH)
 29658 johnmaddock {
 36689 johnmaddock if $(ICU_PATH) != "/usr" && $(ICU_PATH) != "/usr/local"
 36689 johnmaddock {
 36689 johnmaddock BOOST_REGEX_ICU_OPTS += "<include>$(ICU_PATH)/include" ;
 36689 johnmaddock ICU_SEARCH_OPTS = <search>/$(ICU_PATH)/lib ;
 36689 johnmaddock }
 29658 johnmaddock }

If ICU_PATH is ../whatever, you end up with

        <search>/../whatever

and it is not a valid path. I've made the obvious fix, verified that things work
with:

        bjam -sICU_PATH=../../../../../usr --with-regex

and checked in. Because this fix seems to be most obvious possible, I've also
merged to release branch.

HTH,
Volodya


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk