Boost logo

Boost Users :

Subject: [Boost-users] regex icu library (thread safety)
From: PingShan Li (ping.li_at_[hidden])
Date: 2013-07-23 16:31:05


I need to build boost regex library with ICU support.

I followed instruction in: http://www.boost.org/doc/libs/1_46_1/libs/regex/doc/html/boost_regex/install.html

First I downloaded ICU library and compiled it without any problem.

Then I ran the following command:
cd /opt/third_party_libraries/boost_1_46_1/libs/regex/build/ (Boost source code is in "/opt/third_party_libraries/boost_1_46_1")

[root_at_pli-dc-build build]# /opt/third_party_libraries/boost_1_46_1/bjam include=/usr/local/ --toolset=gcc install
Performing configuration checks

    - has_icu builds : yes
...patience...
...
...
gcc.compile.c++ ../../../bin.v2/libs/regex/build/gcc-3.4.6/debug/usinstances.o
gcc.link.dll ../../../bin.v2/libs/regex/build/gcc-3.4.6/debug/libboost_regex.so.1.46.1
common.copy /opt/third_party_libraries/boost_1_46_1/lib/libboost_regex.so.1.46.1
ln-UNIX /opt/third_party_libraries/boost_1_46_1/lib/libboost_regex.so
ln-UNIX /opt/third_party_libraries/boost_1_46_1/lib/libboost_regex.so.1
ln-UNIX /opt/third_party_libraries/boost_1_46_1/lib/libboost_regex.so.1.46
...updated 22 targets...

The build process is successful and I can find the library in "/opt/third_party_libraries/boost_1_46_1/lib/libboost_regex.so.1.46.1".

The question is: does this library support multiple threads? I did some research on this topic, it seems like even though the name does not contain "mt", it is actually thread safe. Or do I have to pass extra parameter to generate thread safe version?

The normal boost build process generates regex library with name like: libboost_regex-gcc34-mt-1_46_1.so.1.46.1 (http://www.boost.org/doc/libs/1_46_1/more/getting_started/unix-variants.html) From the name, I know if the library supports multiple threads.

My development box:
uname -a
Linux 2.6.18-308.1.1.el5PAE #1 SMP Wed Mar 7 04:57:46 EST 2012 i686 i686 i386 GNU/Linux

gcc --version
gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-4.1)
Copyright (C) 2006 Free Software Foundation, Inc.

Thanks



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net