From 6b5169d021c063278b591aef4faf45ed62bd6f8a Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 1 Jul 2010 11:50:37 +0000 Subject: [PATCH] * All tools: - Library linking: there must not be "target_link_library()" for libraries, only when building binaries. Avoid clashes between static module or class variables, and strange reinitialisation of those variables. - Change: Boost is now always linked staticly. --- unicorn/CMakeLists.txt | 4 +++- unicorn/src/CMakeLists.txt | 9 ++++++++- unicorn/src/CgtMain.cpp | 31 ++++++++++++++++++++++++++----- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index 8ced4cb3..8a446d06 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -62,7 +62,9 @@ ENDIF(IS_USR OR IS_OPT) SET(QT_USE_QTXML "true") +FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(Qt4 REQUIRED) # find and setup Qt4 for this project +FIND_PACKAGE(PythonLibs REQUIRED) FIND_PACKAGE(LEFDEF REQUIRED) FIND_PACKAGE(VLSISAPD REQUIRED) FIND_PACKAGE(HURRICANE REQUIRED) @@ -77,6 +79,6 @@ FIND_PACKAGE(KITE REQUIRED) #FIND_PACKAGE(SOLSTICE REQUIRED) SET_LIB_LINK_MODE() -FIND_PACKAGE(Boost 1.33.1 COMPONENTS program_options filesystem REQUIRED) +FIND_PACKAGE(Boost 1.33.1 COMPONENTS filesystem program_options REQUIRED) ADD_SUBDIRECTORY(src) diff --git a/unicorn/src/CMakeLists.txt b/unicorn/src/CMakeLists.txt index 411cee6f..37998ff6 100644 --- a/unicorn/src/CMakeLists.txt +++ b/unicorn/src/CMakeLists.txt @@ -6,6 +6,7 @@ ${CORIOLIS_INCLUDE_DIR} ${CONFIGURATION_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} + ${PYTHON_INCLUDE_PATH} ) add_definitions ( -DSYS_CONF_DIR=\\"${SYS_CONF_DIR}\\" ) @@ -40,6 +41,7 @@ ${NIMBUS_GRAPHICAL_LIBRARIES} ${NIMBUS_LIBRARIES} ${CORIOLIS_LIBRARIES} + ${HURRICANE_PYTHON_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${HURRICANE_LIBRARIES} ${AGDS_LIBRARY} @@ -48,7 +50,9 @@ ${LEFDEF_LIBRARIES} ${OA_LIBRARIES} ${QT_LIBRARIES} - ${Boost_LIBRARIES} + ${PYTHON_LIBRARIES} + -lutil + ${LIBXML2_LIBRARIES} ) add_executable ( cgt ${cgtcpp} ) target_link_libraries ( cgt unicorn @@ -63,12 +67,15 @@ ${KNIK_GRAPHICAL_LIBRARIES} ${KNIK_LIBRARIES} ${CORIOLIS_LIBRARIES} + ${HURRICANE_PYTHON_LIBRARIES} ${HURRICANE_LIBRARIES} ${HURRICANE_GRAPHICAL_LIBRARIES} ${CONFIGURATION_LIBRARY} ${OA_LIBRARIES} ${QT_LIBRARIES} ${Boost_LIBRARIES} + ${PYTHON_LIBRARIES} + -lutil ) install ( TARGETS unicorn DESTINATION lib${LIB_SUFFIX} ) install ( TARGETS cgt DESTINATION bin ) diff --git a/unicorn/src/CgtMain.cpp b/unicorn/src/CgtMain.cpp index ff29e069..c9e77220 100644 --- a/unicorn/src/CgtMain.cpp +++ b/unicorn/src/CgtMain.cpp @@ -33,17 +33,19 @@ namespace boptions = boost::program_options; #include namespace bfs = boost::filesystem; -#include -#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__) -# include -#endif - #include "vlsisapd/configuration/Configuration.h" #include "hurricane/DebugSession.h" #include "hurricane/DataBase.h" #include "hurricane/Cell.h" #include "hurricane/Warning.h" #include "hurricane/UpdateSession.h" +#include "hurricane/isobar/Script.h" + +#include +#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__) +# include +#endif + #include "hurricane/viewer/HApplication.h" #include "hurricane/viewer/Graphics.h" using namespace Hurricane; @@ -93,6 +95,8 @@ int main ( int argc, char *argv[] ) bool kiteSuccess = true; try { + bfs::path::default_name_check ( bfs::portable_posix_name ); + float edgeCapacity; float expandStep; unsigned long eventsLimit; @@ -333,6 +337,23 @@ int main ( int argc, char *argv[] ) // eFPGA/16x16. //DebugSession::addToTrace ( cell, "group_15_6_clb_topside_in1_mux_q01" ); //DebugSession::addToTrace ( cell, "g_7_14_top_2" ); + + // Python Script test. + + Isobar::Script::addPath ( "/dsk/l1/jpc/coriolis-2.x/work/benchs/routing/addaccu" ); + + for ( int i=0 ; i<5 ; ++i ) { + cerr << "Call:" << i << " ======================================" << endl; + + Isobar::Script* script = Isobar::Script::create ( "getCellName" ); + script->runFunction ( "runScript", cell ); + } + + Box box ( DbU::lambda(0.0), DbU::lambda(0.0), DbU::lambda(5.0), DbU::lambda(10.0) ); + + // throw Error ("Tu le vois bien: %s
" + // "Un retour a la ligne\nUne ligne" + // ,getString(box).c_str() ); } if ( not textMode ) {