From 73fa2f5f7c2978cc22576ab979618695446cbb76 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 17 Jul 2010 10:30:35 +0000 Subject: [PATCH] * All Main Python Modules: - Change: New problem identified with the Python modules: each module seems to be built as a complete binary, so all the static C++ initializers are allocated in each module. In particular the C++ tree inheritance is built for *each* module so we cannot longer uses the typeid() comparisons across modules... It was used by boost::program_options to perform is casts with boost::any and was starting throwing exceptions because of bad casts. program_option was first initialized in "configuration" first included by PyViewer then in PyCRL (see Utilities.cpp). A first solution is to re-order the import of Python modules in stratus1/st_model so that CRL is imported first. The second is to not not link "configuration" with boost::program_option as only the binary vlsisapd-conf-editor needs it. That is a serious problem of which we must be aware and can cause further strange behaviors. Debug code used to diagnostic has been kept commented in the sources a it may be needed again :-( This behavior do not affect our singletons because they are part of dynamic libraries that seems to be correctly shared between the various Python modules. * ./vlsisapd: - Change: In Configuration CMakeLists.txt, add Boost_LIBRARIES only on the target_link_libraries() of the binary, not the libraries, as they are not needed there and cause later trouble. --- vlsisapd/src/configuration/src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlsisapd/src/configuration/src/CMakeLists.txt b/vlsisapd/src/configuration/src/CMakeLists.txt index 50deb934..f9e01320 100644 --- a/vlsisapd/src/configuration/src/CMakeLists.txt +++ b/vlsisapd/src/configuration/src/CMakeLists.txt @@ -1,4 +1,5 @@ + include ( ${QT_USE_FILE} ) include_directories ( ${VLSISAPD_SOURCE_DIR}/src/configuration/src ${Boost_INCLUDE_DIRS} @@ -28,12 +29,11 @@ add_library ( configuration ${cpps} ${mocCpps} ) target_link_libraries ( configuration ${QT_LIBRARIES} - ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${LIBXML2_LIBRARIES} ) add_executable ( vlsisapd-conf-editor ${editorcpp} ) - target_link_libraries ( vlsisapd-conf-editor configuration ) + target_link_libraries ( vlsisapd-conf-editor configuration ${Boost_LIBRARIES} ) install ( TARGETS configuration DESTINATION lib${LIB_SUFFIX} ) install ( TARGETS vlsisapd-conf-editor DESTINATION bin )