Support for devtoolset-2, clang and c++11 improvement.

This commit is contained in:
Jean-Paul Chaput 2014-12-05 18:50:15 +01:00
parent b98e6a968a
commit 37c8498962
8 changed files with 77 additions and 83 deletions

View File

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

View File

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

View File

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

View File

@ -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<RawDrawingStyle>));
// memcpy((void*)&(pyDs->_object),(void*)empty,sizeof(shared_ptr<RawDrawingStyle>));
// //cerr << "ptr:" << pyDs->_object.get()
// // << " use_count:" << pyDs->_object.use_count() << endl;

View File

@ -20,7 +20,7 @@
#include <math.h>
#include <vector>
#include <functional>
#include <tr1/memory>
#include <memory>
#include <boost/function.hpp>
#include <QWidget>
#include <QPixmap>
@ -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;

View File

@ -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 <tr1/memory>
#include <memory>
#include <set>
#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<Ruler> > RulerSet;
typedef std::set< std::shared_ptr<Ruler> > RulerSet;
} // End of Hurricane namespace.

View File

@ -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 <QPoint>
@ -48,9 +39,9 @@ namespace Hurricane {
RulerCommand ( const RulerCommand& );
RulerCommand& operator= ( const RulerCommand& );
private:
static string _name;
std::tr1::shared_ptr<Ruler> _ruler;
bool _drawing;
static string _name;
std::shared_ptr<Ruler> _ruler;
bool _drawing;
};

View File

@ -243,7 +243,7 @@ namespace Utilities {
Path& Path::operator= ( const Path& other )
{
vector<std::string>().swap( _elements );
_elements.swap( vector<std::string>() );
_elements = other._elements;
_flags = other._flags;
_pathcache = other._pathcache;