diff --git a/bootstrap/builder/Builder.py b/bootstrap/builder/Builder.py index b5783285..dd29e961 100644 --- a/bootstrap/builder/Builder.py +++ b/bootstrap/builder/Builder.py @@ -34,6 +34,7 @@ class Builder: self._doBuild = True self._noCache = False self._ninja = False + self._clang = False self._devtoolset2 = False self._qt5 = False self._enableShared = "ON" @@ -58,6 +59,7 @@ class Builder: elif attribute == "doBuild": self._doBuild = value elif attribute == "noCache": self._noCache = value elif attribute == "ninja": self._ninja = value + elif attribute == "clang": self._clang = value elif attribute == "devtoolset2": self._devtoolset2 = value elif attribute == "qt5": self._qt5 = value elif attribute == "enableDoc": self._enableDoc = value @@ -340,6 +342,9 @@ class Builder: def _commandTemplate ( self, tools, projects, command ): + if self._clang: + self._environment[ 'CC' ] = '/usr/bin/clang' + self._environment[ 'CXX' ] = '/usr/bin/clang++' if self._devtoolset2: self._environment[ 'BOOST_INCLUDEDIR' ] = '/opt/rh/devtoolset-2/root/usr/include' self._environment[ 'BOOST_LIBRARYDIR' ] = '/opt/rh/devtoolset-2/root/usr/lib' diff --git a/bootstrap/ccb.py b/bootstrap/ccb.py index f47f6a96..2cfcb42b 100755 --- a/bootstrap/ccb.py +++ b/bootstrap/ccb.py @@ -186,6 +186,7 @@ parser.add_option ( "--rm-build" , action="store_true" , parser.add_option ( "--devtoolset-2", action="store_true" , dest="devtoolset2" , help="Build against TUV Dev Toolset 2." ) parser.add_option ( "--qt5" , action="store_true" , dest="qt5" , help="Build against Qt 5 (default: Qt 4)." ) parser.add_option ( "--ninja" , action="store_true" , dest="ninja" , help="Use Ninja instead of UNIX Makefile." ) +parser.add_option ( "--clang" , action="store_true" , dest="clang" , help="Force use of Clang C/C++ compiler instead of system default." ) parser.add_option ( "--make" , action="store" , type="string", dest="makeArguments", help="Arguments to pass to make (ex: \"-j4 install\")." ) parser.add_option ( "--project" , action="append" , type="string", dest="projects" , help="The name of a project to build (may appears any number of time)." ) parser.add_option ( "-t", "--tool" , action="append" , type="string", dest="tools" , help="The name of a tool to build (may appears any number of time)." ) @@ -257,6 +258,7 @@ else: if options.noCache: builder.noCache = True if options.rmBuild: builder.rmBuild = True if options.ninja: builder.ninja = True + if options.clang: builder.clang = True if options.devtoolset2: builder.devtoolset2 = True if options.qt5: builder.qt5 = True if options.makeArguments: builder.makeArguments = options.makeArguments diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index cc87530d..d62f11bc 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -32,6 +32,7 @@ def stripPath ( pathName ): def guessOs (): + useDevtoolset2 = False osSlsoc6x_64 = re.compile (".*Linux.*el6.*x86_64.*") osSlsoc6x = re.compile (".*Linux.*(el|slsoc)6.*") osSLSoC5x_64 = re.compile (".*Linux.*el5.*x86_64.*") @@ -54,12 +55,15 @@ def guessOs (): libDir="lib" if osSlsoc6x_64.match(lines[0]): - osType = "Linux.slsoc6x_64" - libDir = "lib64" - elif osSlsoc6x.match(lines[0]): osType = "Linux.slsoc6x" + osType = "Linux.slsoc6x_64" + libDir = "lib64" + useDevtoolset2 = True + elif osSlsoc6x.match(lines[0]): + osType = "Linux.slsoc6x" + useDevtoolset2 = True elif osSLSoC5x_64.match(lines[0]): - osType = "Linux.SLSoC5x_64" - libDir = "lib64" + osType = "Linux.SLSoC5x_64" + libDir = "lib64" elif osSLSoC5x.match(lines[0]): osType = "Linux.SLSoC5x" elif osUbuntu1004.match(lines[0]): @@ -99,17 +103,17 @@ def guessOs (): #print "[WARNING] Unrecognized OS: \"%s\"." % lines[0][:-1] #print " (using: \"%s\")" % osType - return (osType,libDir) + return (osType,libDir,useDevtoolset2) if __name__ == "__main__": - (osType,libDir) = guessOs() - buildType = "Release" - linkType = "Shared" - rootDir = None + osType,libDir,useDevtoolset2 = guessOs() + buildType = "Release" + linkType = "Shared" + rootDir = None parser = optparse.OptionParser () # Build relateds. @@ -136,23 +140,21 @@ if __name__ == "__main__": strippedPythonPath = stripPath ( "PYTHONPATH" ) shellScriptSh = \ - 'echo "%(MESSAGE)s";\n' \ - 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \ - 'PATH="%(PATH)s";\n' \ - 'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";\n' \ - 'CORIOLIS_TOP="%(CORIOLIS_TOP)s";\n' \ - 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \ - 'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;\n' \ - 'hash -r;\n' + 'echo "%(MESSAGE)s";' \ + 'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \ + 'PATH="%(PATH)s";' \ + 'BOOTSTRAP_TOP="%(BOOTSTRAP_TOP)s";' \ + 'CORIOLIS_TOP="%(CORIOLIS_TOP)s";' \ + 'STRATUS_MAPPING_NAME="%(SYSCONF_DIR)s/stratus2sxlib.xml";' \ + 'export PATH BOOTSTRAP_TOP CORIOLIS_TOP STRATUS_MAPPING_NAME;' shellScriptCsh = \ - 'echo "%(MESSAGE)s";\n' \ - 'echo "Switching to Coriolis 2.x (%(buildDir)s)";\n' \ - 'setenv PATH "%(PATH)s";\n' \ - 'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";\n' \ - 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";\n' \ - 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";\n' \ - 'rehash\n;' + 'echo "%(MESSAGE)s";' \ + 'echo "Switching to Coriolis 2.x (%(buildDir)s)";' \ + 'setenv PATH "%(PATH)s";' \ + 'setenv BOOTSTRAP_TOP "%(BOOTSTRAP_TOP)s";' \ + 'setenv CORIOLIS_TOP "%(CORIOLIS_TOP)s";' \ + 'setenv STRATUS_MAPPING_NAME "%(SYSCONF_DIR)s/stratus2sxlib.xml";' buildDir = buildType + "." + linkType scriptDir = os.path.dirname ( os.path.abspath(__file__) ) @@ -197,31 +199,35 @@ if __name__ == "__main__": strippedPythonPath = "%s/cumulus/plugins:" % (sitePackagesDir) + strippedPythonPath strippedPythonPath = "%s/stratus:" % (sitePackagesDir) + strippedPythonPath - shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";\n' \ - 'export PYTHONPATH;\n' + shellScriptSh += 'PYTHONPATH="%(PYTHONPATH)s";' \ + 'export PYTHONPATH;' shellScriptCsh += 'setenv PYTHONPATH "%(PYTHONPATH)s";' if osType == "Darwin": - shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \ - 'export DYLD_LIBRARY_PATH;\n' - shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' + shellScriptSh += 'DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \ + 'export DYLD_LIBRARY_PATH;' + shellScriptCsh += 'setenv DYLD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' else: - shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' \ - 'export LD_LIBRARY_PATH;\n' - shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";\n' + shellScriptSh += 'LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' \ + 'export LD_LIBRARY_PATH;' + shellScriptCsh += 'setenv LD_LIBRARY_PATH="%(LD_LIBRARY_PATH)s";' - shellScriptSh += "hash -r;\n" - shellScriptCsh += "rehash;\n" + shellScriptSh += "hash -r;" + shellScriptCsh += "rehash;" if options.csh: shellScript = shellScriptCsh else: shellScript = shellScriptSh - print shellScript % { "PATH" : strippedPath - , "LD_LIBRARY_PATH" : strippedLibraryPath - , "PYTHONPATH" : strippedPythonPath - , "BOOTSTRAP_TOP" : coriolisTop - , "CORIOLIS_TOP" : coriolisTop - , "SYSCONF_DIR" : sysconfDir - , "MESSAGE" : shellMessage - , "buildDir" : buildDir - } + evalScript = shellScript % { "PATH" : strippedPath + , "LD_LIBRARY_PATH" : strippedLibraryPath + , "PYTHONPATH" : strippedPythonPath + , "BOOTSTRAP_TOP" : coriolisTop + , "CORIOLIS_TOP" : coriolisTop + , "SYSCONF_DIR" : sysconfDir + , "MESSAGE" : shellMessage + , "buildDir" : buildDir + } + if useDevtoolset2: + evalScript = '%s scl enable devtoolset-2 ${SHELL}' % evalScript + + print evalScript diff --git a/hurricane/src/viewer/PyDrawingStyle.cpp b/hurricane/src/viewer/PyDrawingStyle.cpp index 263d5bc3..932af1c2 100644 --- a/hurricane/src/viewer/PyDrawingStyle.cpp +++ b/hurricane/src/viewer/PyDrawingStyle.cpp @@ -1,8 +1,7 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2012-2010, All Rights Reserved +// Copyright (c) UPMC/LIP6 2012-2014, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -154,7 +153,7 @@ extern "C" { // // we allocate dynamically (so it doesn't get destructed at the function's // // exit). // DrawingStyle* empty = new DrawingStyle(); - // memcpy((void*)&(pyDs->_object),(void*)empty,sizeof(tr1::shared_ptr)); + // memcpy((void*)&(pyDs->_object),(void*)empty,sizeof(shared_ptr)); // //cerr << "ptr:" << pyDs->_object.get() // // << " use_count:" << pyDs->_object.use_count() << endl; diff --git a/hurricane/src/viewer/hurricane/viewer/CellWidget.h b/hurricane/src/viewer/hurricane/viewer/CellWidget.h index d7a7508a..cd1ddfa3 100644 --- a/hurricane/src/viewer/hurricane/viewer/CellWidget.h +++ b/hurricane/src/viewer/hurricane/viewer/CellWidget.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ namespace Hurricane { using std::vector; using std::unary_function; - using std::tr1::shared_ptr; + using std::shared_ptr; class Technology; class BasicLayer; diff --git a/hurricane/src/viewer/hurricane/viewer/Ruler.h b/hurricane/src/viewer/hurricane/viewer/Ruler.h index f96e5833..f06b32ec 100644 --- a/hurricane/src/viewer/hurricane/viewer/Ruler.h +++ b/hurricane/src/viewer/hurricane/viewer/Ruler.h @@ -1,15 +1,9 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // -// =================================================================== -// -// $Id$ -// -// x-----------------------------------------------------------------x -// | | +// +-----------------------------------------------------------------+ // | C O R I O L I S | // | V L S I B a c k e n d D a t a - B a s e | // | | @@ -17,16 +11,13 @@ // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Header : "./Ruler.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_RULER__ -#define __HURRICANE_RULER__ +#ifndef HURRICANE_RULER_H +#define HURRICANE_RULER_H -#include +#include #include #include "hurricane/Point.h" @@ -63,7 +54,7 @@ namespace Hurricane { inline void Ruler::setExtremity ( const Point& extremity ) { _extremity = extremity; } inline bool Ruler::intersect ( const Box& area ) const { return area.intersect(Box(_origin,getAngle())); } - typedef std::set< std::tr1::shared_ptr > RulerSet; + typedef std::set< std::shared_ptr > RulerSet; } // End of Hurricane namespace. diff --git a/hurricane/src/viewer/hurricane/viewer/RulerCommand.h b/hurricane/src/viewer/hurricane/viewer/RulerCommand.h index a7d55bbf..913567b3 100644 --- a/hurricane/src/viewer/hurricane/viewer/RulerCommand.h +++ b/hurricane/src/viewer/hurricane/viewer/RulerCommand.h @@ -1,15 +1,9 @@ - // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2014, All Rights Reserved // -// =================================================================== -// -// $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 | // | | @@ -17,14 +11,11 @@ // | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | =============================================================== | // | C++ Header : "./RulerCommand.h" | -// | *************************************************************** | -// | U p d a t e s | -// | | -// x-----------------------------------------------------------------x +// +-----------------------------------------------------------------+ -#ifndef __HURRICANE_RULER_COMMAND__ -#define __HURRICANE_RULER_COMMAND__ +#ifndef HURRICANE_RULER_COMMAND_H +#define HURRICANE_RULER_COMMAND_H #include @@ -48,9 +39,9 @@ namespace Hurricane { RulerCommand ( const RulerCommand& ); RulerCommand& operator= ( const RulerCommand& ); private: - static string _name; - std::tr1::shared_ptr _ruler; - bool _drawing; + static string _name; + std::shared_ptr _ruler; + bool _drawing; }; diff --git a/vlsisapd/src/utilities/src/Path.cpp b/vlsisapd/src/utilities/src/Path.cpp index 32b774fc..b283bd1b 100644 --- a/vlsisapd/src/utilities/src/Path.cpp +++ b/vlsisapd/src/utilities/src/Path.cpp @@ -243,7 +243,7 @@ namespace Utilities { Path& Path::operator= ( const Path& other ) { - vector().swap( _elements ); + _elements.swap( vector() ); _elements = other._elements; _flags = other._flags; _pathcache = other._pathcache;