From 09f515c62a492a7607ae490371f054d05b174ec7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Wed, 23 Jul 2014 00:55:50 +0200 Subject: [PATCH] Support for Windows/Cygwin, part 2. * Change: In bootstrap, in ccb, builder and coriolisEnv.py, correct detection of the windows architecture (32 or 64 bits). Under Cygwin, add the directory of the dll into the PATH also. Uses "site-package" as the location of Python modules (*not* "dist-package"). Use gnu++0x under Cygwin instead of c++11. * Change: In Etesian, if Coloquinte is not found, do not stop the compilation, just disable the tool altogether. * Change: In Hurricane, In Backtrace, disable backtrace under Cygwin as it uses features specific of the glibc. * Change: In Knik, use HUGE_VAL instead of HUGE (not present under Cygwin), add the header. * Change: In Unicorn, Coloquinte no longer stops the compilation. --- bootstrap/builder/Configuration.py | 8 ++--- bootstrap/ccb.py | 8 ++--- bootstrap/cmake_modules/FindBootstrap.cmake | 13 ++++++--- bootstrap/coriolisEnv.py | 16 ++++++---- etesian/CMakeLists.txt | 6 +++- etesian/src/EtesianEngine.cpp | 12 ++++++++ hurricane/src/hurricane/Backtrace.cpp | 22 ++++++-------- hurricane/src/hurricane/Error.cpp | 3 +- kite/src/CMakeLists.txt | 1 + knik/src/Edge.cpp | 3 +- knik/src/Graph.cpp | 29 ++++++++++--------- knik/src/Vertex.cpp | 8 ++--- unicorn/CMakeLists.txt | 2 +- .../src/liberty/src/LibertyParserScanner.ll | 1 + 14 files changed, 79 insertions(+), 53 deletions(-) diff --git a/bootstrap/builder/Configuration.py b/bootstrap/builder/Configuration.py index 88aa5fa8..024a25f8 100644 --- a/bootstrap/builder/Configuration.py +++ b/bootstrap/builder/Configuration.py @@ -131,10 +131,10 @@ class Configuration ( object ): self._osFreeBSD8x_64 = re.compile (".*FreeBSD 8.*x86_64.*") self._osFreeBSD8x = re.compile (".*FreeBSD 8.*") self._osDarwin = re.compile (".*Darwin.*") - self._osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1-WOW64.*") - self._osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*") - self._osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3]-WOW64.*") - self._osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*") + self._osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1.*x86_64.*") + self._osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*i686.*") + self._osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3].*x86_64.*") + self._osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*i686.*") uname = subprocess.Popen ( ["uname", "-srm"], stdout=subprocess.PIPE ) lines = uname.stdout.readlines() diff --git a/bootstrap/ccb.py b/bootstrap/ccb.py index 7a6b1611..f47f6a96 100755 --- a/bootstrap/ccb.py +++ b/bootstrap/ccb.py @@ -64,10 +64,10 @@ def guessOs (): osFreeBSD8x_64 = re.compile (".*FreeBSD 8.*x86_64.*") osFreeBSD8x = re.compile (".*FreeBSD 8.*") osDarwin = re.compile (".*Darwin.*") - osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1-WOW64.*") - osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*") - osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3]-WOW64.*") - osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*") + osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1.*x86_64.*") + osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*i686.*") + osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3].*x86_64.*") + osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*i686.*") uname = subprocess.Popen ( ["uname", "-srm"], stdout=subprocess.PIPE ) lines = uname.stdout.readlines() diff --git a/bootstrap/cmake_modules/FindBootstrap.cmake b/bootstrap/cmake_modules/FindBootstrap.cmake index c63e9607..ca7d6d42 100644 --- a/bootstrap/cmake_modules/FindBootstrap.cmake +++ b/bootstrap/cmake_modules/FindBootstrap.cmake @@ -72,10 +72,15 @@ # # Adds -Wall to the C/C++ flags. # - set(CMAKE_C_FLAGS_DEBUG "-std=c++0x -Wall -g" CACHE STRING "C Compiler Debug options." FORCE) - set(CMAKE_C_FLAGS_RELEASE "-std=c++0x -Wall -O2 -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) - set(CMAKE_CXX_FLAGS_DEBUG "-std=c++0x -Wall -g" CACHE STRING "C++ Compiler Debug options." FORCE) - set(CMAKE_CXX_FLAGS_RELEASE "-std=c++0x -Wall -O2 -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) + if(CYGWIN) + set(CXX_STANDARD "gnu++0x") + else() + set(CXX_STANDARD "c++11") + endif() + set(CMAKE_C_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -g" CACHE STRING "C Compiler Debug options." FORCE) + set(CMAKE_C_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 -DNDEBUG" CACHE STRING "C Compiler Release options." FORCE) + set(CMAKE_CXX_FLAGS_DEBUG "-std=${CXX_STANDARD} -Wall -g" CACHE STRING "C++ Compiler Debug options." FORCE) + set(CMAKE_CXX_FLAGS_RELEASE "-std=${CXX_STANDARD} -Wall -O2 -DNDEBUG" CACHE STRING "C++ Compiler Release options." FORCE) # diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index b5f21734..95b83f40 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -44,10 +44,10 @@ def guessOs (): osFreeBSD8x_amd64 = re.compile (".*FreeBSD 8.*amd64.*") osFreeBSD8x_64 = re.compile (".*FreeBSD 8.*x86_64.*") osFreeBSD8x = re.compile (".*FreeBSD 8.*") - osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1-WOW64.*") - osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*") - osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3]-WOW64.*") - osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*") + osCygwinW7_64 = re.compile (".*CYGWIN_NT-6\.1.*x86_64.*") + osCygwinW7 = re.compile (".*CYGWIN_NT-6\.1.*i686.*") + osCygwinW8_64 = re.compile (".*CYGWIN_NT-6\.[2-3].*x86_64.*") + osCygwinW8 = re.compile (".*CYGWIN_NT-6\.[2-3].*i686.*") uname = subprocess.Popen ( ["uname", "-srm"], stdout=subprocess.PIPE ) lines = uname.stdout.readlines() @@ -173,6 +173,9 @@ if __name__ == "__main__": sysconfDir = coriolisTop + "/etc/coriolis2" shellMessage = "Using user-selected Coriolis 2 (%s)" % rootDir + if osType.startswith("Cygwin"): + strippedPath = "%s/%s:%s" % ( coriolisTop, libDir, strippedPath ) + absLibDir = "%s/%s" % ( coriolisTop, libDir ) strippedPath = "%s/bin:%s" % ( coriolisTop, strippedPath ) strippedLibraryPath = "%s:%s" % ( absLibDir , strippedLibraryPath ) @@ -180,7 +183,10 @@ if __name__ == "__main__": if not options.nopython: pyVersion = sys.version_info version = "%d.%d" % (pyVersion[0],pyVersion[1]) - if osType.startswith("Linux.SL") or osType.startswith("Linux.sl") or osType.startswith("Darwin"): + if osType.startswith("Linux.SL") \ + or osType.startswith("Linux.sl") \ + or osType.startswith("Darwin") \ + or osType.startswith("Cygwin"): sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) else: sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version) diff --git a/etesian/CMakeLists.txt b/etesian/CMakeLists.txt index d091a252..e7e4d9cb 100644 --- a/etesian/CMakeLists.txt +++ b/etesian/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(LibXml2 REQUIRED) find_package(PythonLibs REQUIRED) find_package(PythonSitePackages REQUIRED) - find_package(COLOQUINTE REQUIRED) + find_package(COLOQUINTE ) find_package(VLSISAPD REQUIRED) find_package(LEFDEF REQUIRED) find_package(HURRICANE REQUIRED) @@ -30,6 +30,10 @@ add_subdirectory(src) add_subdirectory(cmake_modules) + if(COLOQUINTE_FOUND) + add_definitions(-DHAVE_COLOQUINTE) + endif() + if(BUILD_DOC) find_package(Doxygen) # if(DOXYGEN_FOUND) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 5be964f7..d7e3bd3d 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -17,7 +17,9 @@ #include #include #include +#if HAVE_COLOQUINTE #include "coloquinte/circuit_graph.hxx" +#endif #include "vlsisapd/utilities/Dots.h" #include "hurricane/DebugSession.h" #include "hurricane/Bug.h" @@ -99,6 +101,7 @@ namespace { } +#if HAVE_COLOQUINTE Coloquinte::cell::pin::pin_dir extractDirection ( const RoutingPad* rp ) { switch ( rp->_getEntityAsComponent()->getNet()->getDirection() ) { @@ -111,6 +114,7 @@ namespace { return Coloquinte::cell::pin::O; } +#endif Point extractRpOffset ( const RoutingPad* rp ) @@ -230,7 +234,9 @@ namespace Etesian { EtesianEngine::~EtesianEngine () { +#if HAVE_COLOQUINTE if (_circuit) delete _circuit; +#endif delete _configuration; } @@ -289,6 +295,7 @@ namespace Etesian { void EtesianEngine::place ( unsigned int slowMotion ) { +#if HAVE_COLOQUINTE cmess1 << " o Converting <" << getCell()->getName() << "> into Coloquinte." << endl; resetPlacement(); @@ -500,11 +507,15 @@ namespace Etesian { _updatePlacement( 1 ); _flags &= ~NoPlacement; +#else + cerr << Warning("Coloquinte library wasn't found, Etesian is disabled.") << endl; +#endif } void EtesianEngine::_updatePlacement ( unsigned int placementId ) { +#if HAVE_COLOQUINTE UpdateSession::open(); forEach ( Occurrence, ioccurrence, getCell()->getLeafInstanceOccurrences() ) @@ -536,6 +547,7 @@ namespace Etesian { UpdateSession::close(); if (_cellWidget) _cellWidget->refresh(); +#endif } diff --git a/hurricane/src/hurricane/Backtrace.cpp b/hurricane/src/hurricane/Backtrace.cpp index d18f7141..1dc53239 100644 --- a/hurricane/src/hurricane/Backtrace.cpp +++ b/hurricane/src/hurricane/Backtrace.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2010, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -19,26 +19,20 @@ // License along with Hurricane. If not, see // . // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | H U R R I C A N E | // | V L S I B a c k e n d D a t a - B a s e | // | | -// | Author : Remy Escassut | +// | Author : Jean-Paul Chaput | // | E-mail : Jean-Paul.Chaput@lip6.fr | // | =============================================================== | -// | C++ Module : "./Error.cpp" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// | C++ Module : "./Backtrace.cpp" | +// +-----------------------------------------------------------------+ +#if (defined __linux__ || defined __FreeBSD__ || defined __APPLE__) #include +#endif #include #include #include @@ -72,9 +66,11 @@ namespace Hurricane { Backtrace::Backtrace () : _stack() { +#if (defined __linux__ || defined __FreeBSD__ || defined __APPLE__) void* rawStack [ _stackSize ]; size_t depth = backtrace ( rawStack, _stackSize ); char** symbols = backtrace_symbols ( rawStack, depth ); +#endif #if (defined __linux__ || defined __FreeBSD__) boost::regex re ( "([^/]+)\\(([^+]+)\\+" ); diff --git a/hurricane/src/hurricane/Error.cpp b/hurricane/src/hurricane/Error.cpp index cc7b2d97..85270121 100644 --- a/hurricane/src/hurricane/Error.cpp +++ b/hurricane/src/hurricane/Error.cpp @@ -1,7 +1,7 @@ // -*- C++ -*- // -// Copyright (c) BULL S.A. 2000-2009, All Rights Reserved +// Copyright (c) BULL S.A. 2000-2014, All Rights Reserved // // This file is part of Hurricane. // @@ -30,7 +30,6 @@ // +-----------------------------------------------------------------+ -#include #include #include #include diff --git a/kite/src/CMakeLists.txt b/kite/src/CMakeLists.txt index 54c08514..2d83971a 100644 --- a/kite/src/CMakeLists.txt +++ b/kite/src/CMakeLists.txt @@ -87,6 +87,7 @@ ${BOOKSHELF_LIBRARY} ${CIF_LIBRARY} ${AGDS_LIBRARY} + ${UTILITIES_LIBRARY} ${LEFDEF_LIBRARIES} ${OA_LIBRARIES} ${QtX_LIBRARIES} diff --git a/knik/src/Edge.cpp b/knik/src/Edge.cpp index 39851fb5..220e43fd 100644 --- a/knik/src/Edge.cpp +++ b/knik/src/Edge.cpp @@ -1,4 +1,5 @@ +#include #include "crlcore/Utilities.h" #include "hurricane/Breakpoint.h" #include "hurricane/Warning.h" @@ -199,7 +200,7 @@ float Edge::getCost ( Edge* arrivalEdge ) { // 20/10/2010: Check for null capacity, which may occurs after back-annotation // by Kite. - if ( _capacity == 0.0 ) return (float)(HUGE); + if ( _capacity == 0.0 ) return (float)(HUGE_VAL); //#ifdef __USE_CONGESTION__ if ( __congestion__ ) { diff --git a/knik/src/Graph.cpp b/knik/src/Graph.cpp index dc7158f7..e978167c 100644 --- a/knik/src/Graph.cpp +++ b/knik/src/Graph.cpp @@ -1,4 +1,5 @@ +#include #include #include #include @@ -1008,7 +1009,7 @@ int Graph::initRouting ( Net* net ) //cerr << " Adding vertex to _vertexes_to_route: continue" << endl; _vertexes_to_route.insert ( contactVertex ); _searchingArea.merge ( contactVertex->getBox() ); - contactVertex->setDistance((float)(HUGE)); + contactVertex->setDistance((float)(HUGE_VAL)); contactVertex->setPredecessor(NULL); currentConnexID++; } @@ -1048,7 +1049,7 @@ int Graph::initRouting ( Net* net ) _searchingArea.merge ( rpVertex->getBox() ); rpVertex->setConnexID ( currentConnexID ); rpVertex->setNetStamp ( _netStamp ); - rpVertex->setDistance((float)(HUGE)); + rpVertex->setDistance((float)(HUGE_VAL)); rpVertex->setPredecessor(NULL); currentConnexID++; } @@ -1134,7 +1135,7 @@ void Graph::Dijkstra() while ( _vertexes_to_route.size() > 1 ) { // Now, let's expanse the top of the queue VertexList reachedVertexes; - float reachedDistance = (float)(HUGE); + float reachedDistance = (float)(HUGE_VAL); //checkGraphConsistency(); if (ltracelevel() >= 600) { @@ -1266,7 +1267,7 @@ void Graph::Dijkstra() message << " Unable to reach target on net " << _working_net->getName() << "."; throw Error( message.str() ); } - assert( reachedDistance < (float)(HUGE) ); + assert( reachedDistance < (float)(HUGE_VAL) ); ltrace(600) << "Updating two connex components:" << endl; ltrace(600) << "1. " << (*(reachedVertexes.begin())) << endl; @@ -1367,8 +1368,8 @@ void Graph::Monotonic() while ( topEdge ) { Vertex* currentVertex = topEdge->getOpposite ( vertPred ); if ( currentVertex->getPosition().getY() <= targetY ) { - float vertDistance = (float)(HUGE); - float horzDistance = (float)(HUGE); + float vertDistance = (float)(HUGE_VAL); + float horzDistance = (float)(HUGE_VAL); vertDistance = vertPred->getDistance() + topEdge->getCost ( vertPred->getPredecessor() ); Edge* leftEdge = currentVertex->getHEdgeIn(); @@ -1442,8 +1443,8 @@ void Graph::Monotonic() while ( bottomEdge ) { Vertex* currentVertex = bottomEdge->getOpposite ( vertPred ); if ( currentVertex->getPosition().getY() >= targetY ) { - float vertDistance = (float)(HUGE); - float horzDistance = (float)(HUGE); + float vertDistance = (float)(HUGE_VAL); + float horzDistance = (float)(HUGE_VAL); vertDistance = vertPred->getDistance() + bottomEdge->getCost ( vertPred->getPredecessor() ); Edge* leftEdge = currentVertex->getHEdgeIn(); @@ -1811,7 +1812,7 @@ void Graph::rebuildConnexComponent ( Contact* contact, int connexID, Segment* ar contactVertex->setContact ( contact ); contactVertex->setConnexID ( connexID ); contactVertex->setNetStamp ( _netStamp ); - contactVertex->setDistance((float)(HUGE)); + contactVertex->setDistance((float)(HUGE_VAL)); contactVertex->setPredecessor(NULL); //cerr << "from :" << contact << endl; //cerr << "arrivalSegment: " << arrivalSegment << endl; @@ -1850,7 +1851,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE)); + vertex->setDistance((float)(HUGE_VAL)); Edge* edge = vertex->getVEdgeOut(); assert(edge); edge->setNetStamp ( _netStamp ); @@ -1860,7 +1861,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE)); + vertex->setDistance((float)(HUGE_VAL)); return; } if ( sourceLineIdx == targetLineIdx ) { // horizontal segment @@ -1869,7 +1870,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE)); + vertex->setDistance((float)(HUGE_VAL)); Edge* edge = vertex->getHEdgeOut(); assert(edge); edge->setNetStamp ( _netStamp ); @@ -1879,7 +1880,7 @@ void Graph::setNetStampConnexID ( Segment* segment, int connexID ) assert(vertex); vertex->setNetStamp ( _netStamp ); vertex->setConnexID ( connexID ); - vertex->setDistance((float)(HUGE)); + vertex->setDistance((float)(HUGE_VAL)); return; } throw Error ( "Graph::setNetStampConnexId(): what sort of segment is that, a diagonal one?" ); @@ -2324,7 +2325,7 @@ void Graph::CleanRoutingState() // assert (vertex); // vertex->setLocalRingHook(NULL); // vertex->setConnexID(-1); - // vertex->setDistance((float)(HUGE)); + // vertex->setDistance((float)(HUGE_VAL)); // vertex->setPredecessor(NULL); // assert ( vertex->getVTuple() == NULL ); //} diff --git a/knik/src/Vertex.cpp b/knik/src/Vertex.cpp index 7b3c2226..301b8568 100644 --- a/knik/src/Vertex.cpp +++ b/knik/src/Vertex.cpp @@ -1,5 +1,5 @@ +#include #include -//#include "crlcore/CEditor.h" #include "hurricane/Technology.h" #include "hurricane/DataBase.h" #include "knik/Vertex.h" @@ -101,7 +101,7 @@ Vertex::Vertex ( Graph* routingGraph, Point position, DbU::Unit halfWidth, DbU:: , _contact (NULL) , _position (position) , _vtuple (NULL) - , _distance ((float)(HUGE)) + , _distance ((float)(HUGE_VAL)) , _connexID (-1) , _netStamp (0) , _halfWidth (halfWidth) @@ -459,8 +459,8 @@ Cell* Vertex::getCell() const // { // DbU::Unit size = DbU::lambda(5); // view->FillCircle ( transformation.getPoint ( getPosition() ), size ); -// //if ( _distance < (float)(HUGE) ) -// if ( _netStamp == _routingGraph->getNetStamp() && _distance < (float)(HUGE) ) +// //if ( _distance < (float)(HUGE_VAL) ) +// if ( _netStamp == _routingGraph->getNetStamp() && _distance < (float)(HUGE_VAL) ) // view->DrawString ( getString(_distance), getXMax() - (_halfWidth), getYMax() - (_halfHeight/2) ); // if ( _connexID != -1 ) // view->DrawString ( getString(_connexID)+","+getString(_netStamp), getXMax() - (_halfWidth), getYMin() + (_halfHeight/2) ); diff --git a/unicorn/CMakeLists.txt b/unicorn/CMakeLists.txt index 35ee4553..1c66f912 100644 --- a/unicorn/CMakeLists.txt +++ b/unicorn/CMakeLists.txt @@ -20,7 +20,7 @@ find_package(PythonLibs REQUIRED) find_package(PythonSitePackages REQUIRED) find_package(LEFDEF REQUIRED) - find_package(COLOQUINTE REQUIRED) + find_package(COLOQUINTE) find_package(VLSISAPD REQUIRED) find_package(HURRICANE REQUIRED) find_package(CORIOLIS REQUIRED) diff --git a/vlsisapd/src/liberty/src/LibertyParserScanner.ll b/vlsisapd/src/liberty/src/LibertyParserScanner.ll index c69bf809..11e5fe01 100644 --- a/vlsisapd/src/liberty/src/LibertyParserScanner.ll +++ b/vlsisapd/src/liberty/src/LibertyParserScanner.ll @@ -3,6 +3,7 @@ %{ +#include #include #include