Zachary Mark
Hello,
Our application is using boost::program_options to parse commandline arguments. We have found that when we perform our own builds of boost from source code, program_options freezes the application hard at variable points in the code (a step through in GDB confirms this). However, when we use pre-built binaries of the program_options library for any of our target OSes (Debian stable, Centos 4, Fedora 4) the application runs properly.
We are also using the boost::thread library. Are there thread safety or interaction issues between thread and program_options that I am not aware of? We are using 1.32 due a change in the behavior of program_options in 1.33. This script shows how we are building boost.
You did not indicate where the library hangs (i.e. did not provide a complete backtrace). If it's in some threading-related function, it means that you're using wrong version of the library. If you application is multi-threaded, you must link to MT build of program_options. One important aspect of this is that MT mode changes layout of shared_ptr, which is used in program_options public interface, so mismatch in MT mode between the library and the program causes sure problems.
# run configure
cd libs/config || fail-configure chmod +x configure || fail "error: could not change permissions on ${PACKAGE} configure script" ./configure || fail-configure cp user.hpp ../../boost/config/
cd ../..
# build and install libraries
BOOST_LIBS="date_time filesystem program_options regex thread"
for LIB in ${BOOST_LIBS}; do echo "Building library ${LIB}..." bjam -sTOOLS=gcc -sBUILD="release threading=multi" --with-${LIB} \ --layout="system" stage 2>&1 || \ fail "error: could not build boost library ${LIB}" bjam -sTOOLS=gcc -sBUILD="release threading=multi" --with-${LIB} --layout="system" \ --prefix=`pwd`/../../${INSTALL_DIR} install 2>&1 || \ fail "error: could not install boost library ${LIB}" done
Thanks in advance.
Well, this looks reasonable. Do you build your own application in such a way that Boost things its multi-threaded? - Volodya