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 <cmath> header.
* Change: In Unicorn, Coloquinte no longer stops the compilation.
This commit is contained in:
Jean-Paul Chaput 2014-07-23 00:55:50 +02:00
parent 520b9ae382
commit 09f515c62a
14 changed files with 79 additions and 53 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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)
#

View File

@ -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)

View File

@ -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)

View File

@ -17,7 +17,9 @@
#include <sstream>
#include <fstream>
#include <iomanip>
#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
}

View File

@ -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
// <http://www.gnu.org/licenses/>.
//
// ===================================================================
//
// $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 <execinfo.h>
#endif
#include <sstream>
#include <iomanip>
#include <boost/regex.hpp>
@ -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 ( "([^/]+)\\(([^+]+)\\+" );

View File

@ -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 <execinfo.h>
#include <cstdarg>
#include <iomanip>
#include <boost/regex.hpp>

View File

@ -87,6 +87,7 @@
${BOOKSHELF_LIBRARY}
${CIF_LIBRARY}
${AGDS_LIBRARY}
${UTILITIES_LIBRARY}
${LEFDEF_LIBRARIES}
${OA_LIBRARIES}
${QtX_LIBRARIES}

View File

@ -1,4 +1,5 @@
#include <cmath>
#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__ ) {

View File

@ -1,4 +1,5 @@
#include <cmath>
#include <sstream>
#include <algorithm>
#include <memory>
@ -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 );
//}

View File

@ -1,5 +1,5 @@
#include <cmath>
#include <algorithm>
//#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) );

View File

@ -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)

View File

@ -3,6 +3,7 @@
%{
#include <cstdio>
#include <iostream>
#include <string>