* ./crlcore:

- Change: Switch from boost::filestem to VLSISAPD path.
This commit is contained in:
Jean-Paul Chaput 2013-04-21 15:36:06 +00:00
parent dcc3084884
commit e2cb433962
8 changed files with 80 additions and 96 deletions

View File

@ -16,7 +16,7 @@
check_distribution() check_distribution()
set_lib_link_mode() set_lib_link_mode()
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}") setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
setup_boost(program_options filesystem python regex wave) setup_boost(program_options python regex wave)
message(STATUS "${Boost_LIBRARIES}") message(STATUS "${Boost_LIBRARIES}")
find_package(LibXml2 REQUIRED) find_package(LibXml2 REQUIRED)

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // Copyright (c) UPMC 2008-2013, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | C O R I O L I S | // | C O R I O L I S |
@ -16,6 +16,7 @@
#include <unistd.h> #include <unistd.h>
#include "vlsisapd/utilities/Path.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
#include "hurricane/Technology.h" #include "hurricane/Technology.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
@ -23,7 +24,6 @@
#include "hurricane/Cell.h" #include "hurricane/Cell.h"
#include "hurricane/Instance.h" #include "hurricane/Instance.h"
#include "hurricane/viewer/Graphics.h" #include "hurricane/viewer/Graphics.h"
#include "crlcore/Utilities.h" #include "crlcore/Utilities.h"
#include "crlcore/GraphicsParser.h" #include "crlcore/GraphicsParser.h"
#include "crlcore/SymbolicTechnologyParser.h" #include "crlcore/SymbolicTechnologyParser.h"
@ -392,9 +392,9 @@ namespace CRL {
{ {
if ( library == NULL ) return; if ( library == NULL ) return;
bfs::path libPath ( getString(library->getPath()) ); Utilities::Path libPath ( getString(library->getPath()) );
if ( not bfs::exists(libPath) ) { if ( not libPath.exists() ) {
bfs::create_directory(libPath); libPath.mkdir();
} }
forEach ( Cell*, icell, library->getLibrary()->getCells() ) { forEach ( Cell*, icell, library->getLibrary()->getCells() ) {

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // Copyright (c) UPMC 2008-2013, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | C O R I O L I S | // | C O R I O L I S |
@ -19,10 +19,7 @@
#include <sstream> #include <sstream>
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
#include <boost/filesystem/operations.hpp> #include "vlsisapd/utilities/Path.h"
#include <boost/filesystem/fstream.hpp>
namespace bfs = boost::filesystem;
#include "crlcore/Histogram.h" #include "crlcore/Histogram.h"
@ -114,11 +111,11 @@ namespace CRL {
void Histogram::toGnuplot ( const string& basename ) void Histogram::toGnuplot ( const string& basename )
{ {
bfs::path datFile = basename + _fileExtension + ".dat"; Utilities::Path datFile ( basename+_fileExtension+".dat" );
toFile ( datFile.string() ); toFile ( datFile.string() );
bfs::path pltFile = basename + _fileExtension + ".plt"; Utilities::Path pltFile ( basename+_fileExtension+".plt" );
bfs::ofstream fd ( pltFile ); ofstream fd ( pltFile.string() );
if ( not _mainTitle.empty() ) if ( not _mainTitle.empty() )
fd << "set title \"" << _mainTitle << "\"\n"; fd << "set title \"" << _mainTitle << "\"\n";

View File

@ -2,7 +2,7 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2012, All Rights Reserved // Copyright (c) UPMC 2008-2013, All Rights Reserved
// //
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
// | C O R I O L I S | // | C O R I O L I S |
@ -24,6 +24,7 @@
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace boptions = boost::program_options; namespace boptions = boost::program_options;
#include "vlsisapd/utilities/Path.h"
#include "vlsisapd/configuration/Configuration.h" #include "vlsisapd/configuration/Configuration.h"
#include "hurricane/Backtrace.h" #include "hurricane/Backtrace.h"
#include "hurricane/Warning.h" #include "hurricane/Warning.h"
@ -89,8 +90,8 @@ namespace {
void stratus1MappingNameChanged ( Cfg::Parameter* p ) void stratus1MappingNameChanged ( Cfg::Parameter* p )
{ {
bfs::path stratusMappingName = p->asString(); Utilities::Path stratusMappingName ( p->asString() );
if ( not stratusMappingName.has_root_directory() ) { if ( not stratusMappingName.absolute() ) {
stratusMappingName = System::getPath("etc") / stratusMappingName; stratusMappingName = System::getPath("etc") / stratusMappingName;
} }
setenv ( "STRATUS_MAPPING_NAME", stratusMappingName.string().c_str(), 1 ); setenv ( "STRATUS_MAPPING_NAME", stratusMappingName.string().c_str(), 1 );
@ -249,9 +250,6 @@ namespace CRL {
boptions::store ( boptions::parse_environment(options,environmentMapper), arguments ); boptions::store ( boptions::parse_environment(options,environmentMapper), arguments );
boptions::notify ( arguments ); boptions::notify ( arguments );
if ( bfs::path::default_name_check_writable() )
bfs::path::default_name_check ( bfs::portable_posix_name );
// Force creation of singleton at this stage. // Force creation of singleton at this stage.
// cerr << "In System singleton creation." << endl; // cerr << "In System singleton creation." << endl;
// AllianceFramework::get(); // AllianceFramework::get();
@ -266,8 +264,8 @@ namespace CRL {
); );
} }
bfs::path sysConfDir ( SYS_CONF_DIR ); Utilities::Path sysConfDir ( SYS_CONF_DIR );
if ( not sysConfDir.has_root_path() ) { if ( not sysConfDir.absolute() ) {
if ( arguments.count("coriolis_top") ) { if ( arguments.count("coriolis_top") ) {
// const boptions::variable_value& value = arguments["coriolis_top"]; // const boptions::variable_value& value = arguments["coriolis_top"];
// cerr << "value:" // cerr << "value:"
@ -297,12 +295,12 @@ namespace CRL {
_pathes.insert ( make_pair("home",arguments["home"].as<string>()) ); _pathes.insert ( make_pair("home",arguments["home"].as<string>()) );
// Early setting of python pathes to be able to execute configuration scripts. // Early setting of python pathes to be able to execute configuration scripts.
bfs::path pythonSitePackages = PYTHON_SITE_PACKAGES; Utilities::Path pythonSitePackages ( PYTHON_SITE_PACKAGES );
pythonSitePackages = arguments["coriolis_top"].as<string>() / pythonSitePackages; pythonSitePackages = arguments["coriolis_top"].as<string>() / pythonSitePackages;
_pathes.insert ( make_pair("pythonSitePackages",pythonSitePackages.string()) ); _pathes.insert ( make_pair("pythonSitePackages",pythonSitePackages.string()) );
bfs::path crlcoreDir = pythonSitePackages / "crlcore"; Utilities::Path crlcoreDir = pythonSitePackages / "crlcore";
bfs::path stratusDir = pythonSitePackages / "stratus"; Utilities::Path stratusDir = pythonSitePackages / "stratus";
bfs::path cumulusDir = pythonSitePackages / "cumulus"; Utilities::Path cumulusDir = pythonSitePackages / "cumulus";
Isobar::Script::addPath ( sysConfDir.string() ); Isobar::Script::addPath ( sysConfDir.string() );
Isobar::Script::addPath ( pythonSitePackages.string() ); Isobar::Script::addPath ( pythonSitePackages.string() );
@ -331,7 +329,7 @@ namespace CRL {
logModeChanged ( Cfg::getParamBool("misc.logMode" ) ); logModeChanged ( Cfg::getParamBool("misc.logMode" ) );
traceLevelChanged ( Cfg::getParamInt ("misc.traceLevel" ) ); traceLevelChanged ( Cfg::getParamInt ("misc.traceLevel" ) );
bfs::path stratusMappingName; Utilities::Path stratusMappingName;
if ( arguments.count("stratus_mapping_name") ) { if ( arguments.count("stratus_mapping_name") ) {
Cfg::getParamString( "stratus1.mappingName")->setString ( arguments["stratus_mapping_name"].as<string>() ); Cfg::getParamString( "stratus1.mappingName")->setString ( arguments["stratus_mapping_name"].as<string>() );
} }
@ -406,11 +404,11 @@ namespace CRL {
} }
const bfs::path& System::_getPath ( const string& key ) const Utilities::Path& System::_getPath ( const string& key )
{ {
static bfs::path nullPath ("no_path"); static Utilities::Path nullPath ("no_path");
map<const string,bfs::path>::const_iterator ipath = _pathes.find ( key ); map<const string,Utilities::Path>::const_iterator ipath = _pathes.find( key );
if ( ipath == _pathes.end() ) return nullPath; if ( ipath == _pathes.end() ) return nullPath;
return (*ipath).second; return (*ipath).second;
@ -420,13 +418,13 @@ namespace CRL {
void System::_runPythonInit () void System::_runPythonInit ()
{ {
Cfg::Configuration* conf = Cfg::Configuration::get (); Cfg::Configuration* conf = Cfg::Configuration::get ();
bfs::path sysConfDir = getPath("etc"); Utilities::Path sysConfDir = getPath("etc");
bfs::path pythonSitePackages = getPath("pythonSitePackages"); Utilities::Path pythonSitePackages = getPath("pythonSitePackages");
#if XML_NOT_DISABLED #if XML_NOT_DISABLED
bool systemConfFound = false; bool systemConfFound = false;
bfs::path systemConfFile = sysConfDir / "tools.configuration.xml"; Utilities::Path systemConfFile = sysConfDir / "tools.configuration.xml";
if ( bfs::exists(systemConfFile) ) { if ( systemConfFile.exists() ) {
systemConfFound = true; systemConfFound = true;
conf->readFromFile ( systemConfFile.string() ); conf->readFromFile ( systemConfFile.string() );
} else { } else {
@ -435,14 +433,14 @@ namespace CRL {
} }
#endif #endif
bool systemConfFound = false; bool systemConfFound = false;
bfs::path systemConfFile = pythonSitePackages / "crlcore" / "coriolisInit.py"; Utilities::Path systemConfFile = pythonSitePackages / "crlcore" / "coriolisInit.py";
if ( bfs::exists(systemConfFile) ) { if ( systemConfFile.exists() ) {
systemConfFound = true; systemConfFound = true;
//cout << " o Reading python dot configuration:" << endl; //cout << " o Reading python dot configuration:" << endl;
//cout << " - <" << systemConfFile.string() << ">." << endl; //cout << " - <" << systemConfFile.string() << ">." << endl;
Isobar::Script* systemScript = Isobar::Script::create(systemConfFile.stem()); Isobar::Script* systemScript = Isobar::Script::create(systemConfFile.stem().string());
systemScript->runFunction("coriolisConfigure",NULL,Isobar::Script::NoScriptArgs); systemScript->runFunction("coriolisConfigure",NULL,Isobar::Script::NoScriptArgs);
systemScript->destroy(); systemScript->destroy();
} else { } else {
@ -450,17 +448,17 @@ namespace CRL {
,systemConfFile.string().c_str()) << endl; ,systemConfFile.string().c_str()) << endl;
} }
bool homeConfFound = false; bool homeConfFound = false;
bfs::path homeConfFile = getPath("home"); Utilities::Path homeConfFile = getPath("home");
homeConfFile /= ".coriolis2.configuration.xml"; homeConfFile /= ".coriolis2.configuration.xml";
if ( bfs::exists(homeConfFile) ) { if ( homeConfFile.exists() ) {
homeConfFound = true; homeConfFound = true;
conf->readFromFile ( homeConfFile.string() ); conf->readFromFile ( homeConfFile.string() );
} }
bool dotConfFound = false; bool dotConfFound = false;
bfs::path dotConfFile = "./.coriolis2.configuration.xml"; Utilities::Path dotConfFile = "./.coriolis2.configuration.xml";
if ( bfs::exists(dotConfFile) ) { if ( dotConfFile.exists() ) {
dotConfFound = true; dotConfFound = true;
conf->readFromFile ( dotConfFile.string() ); conf->readFromFile ( dotConfFile.string() );
} }

View File

@ -15,23 +15,19 @@
// +-----------------------------------------------------------------+ // +-----------------------------------------------------------------+
#ifndef __CRL_UTILITIES_H__ #ifndef CRL_UTILITIES_H
#define __CRL_UTILITIES_H__ #define CRL_UTILITIES_H
#include <cstdarg> #include <cstdarg>
#include <cstdio> #include <cstdio>
#include <ostream> #include <ostream>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "vlsisapd/utilities/Path.h"
#include <boost/filesystem/operations.hpp> #include "hurricane/Commons.h"
namespace bfs = boost::filesystem; #include "hurricane/Error.h"
#include "hurricane/Slot.h"
#include "hurricane/Commons.h" #include "hurricane/DbU.h"
#include "hurricane/Error.h"
#include "hurricane/Slot.h"
#include "hurricane/DbU.h"
namespace CRL { namespace CRL {
@ -50,31 +46,31 @@ namespace CRL {
class System { class System {
public: public:
static System* get (); static System* get ();
static inline bool getCatchCore (); static inline bool getCatchCore ();
static inline const bfs::path& getPath ( const std::string& ); static inline const Utilities::Path& getPath ( const std::string& );
static inline bool setCatchCore ( bool catchCore ); static inline bool setCatchCore ( bool catchCore );
static inline void runPythonInit (); static inline void runPythonInit ();
private: private:
static System* _singleton; static System* _singleton;
bool _catchCore; bool _catchCore;
std::map<const std::string,bfs::path> _pathes; std::map<const std::string,Utilities::Path> _pathes;
private: private:
System (); System ();
System ( const System &other ); System ( const System &other );
System& operator= ( const System &other ); System& operator= ( const System &other );
static void _trapSig ( int sig ); static void _trapSig ( int sig );
inline bool _getCatchCore (); inline bool _getCatchCore ();
const bfs::path& _getPath ( const std::string& ); const Utilities::Path& _getPath ( const std::string& );
inline bool _setCatchCore ( bool catchCore ); inline bool _setCatchCore ( bool catchCore );
void _runPythonInit (); void _runPythonInit ();
}; };
inline bool System::getCatchCore () { return get()->_getCatchCore(); } inline bool System::getCatchCore () { return get()->_getCatchCore(); }
inline const bfs::path& System::getPath ( const std::string& key ) { return get()->_getPath(key); } inline const Utilities::Path& System::getPath ( const std::string& key ) { return get()->_getPath(key); }
inline bool System::setCatchCore ( bool catchCore ) { return get()->_setCatchCore(catchCore); } inline bool System::setCatchCore ( bool catchCore ) { return get()->_setCatchCore(catchCore); }
inline void System::runPythonInit () { return get()->_runPythonInit(); } inline void System::runPythonInit () { return get()->_runPythonInit(); }
// ------------------------------------------------------------------- // -------------------------------------------------------------------
@ -461,4 +457,4 @@ inline linefill& linefill::operator<< ( const T* t )
LINEFILL_PR_SUPPORT(std::string); LINEFILL_PR_SUPPORT(std::string);
# endif #endif // CRL_UTILITIES

View File

@ -2,6 +2,7 @@
include ( ${QT_USE_FILE} ) include ( ${QT_USE_FILE} )
include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore
${HURRICANE_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR}
${UTILITIES_INCLUDE_DIR}
${Boost_INCLUDE_DIR} ${Boost_INCLUDE_DIR}
) )
@ -27,6 +28,7 @@
${AGDS_LIBRARY} ${AGDS_LIBRARY}
${CIF_LIBRARY} ${CIF_LIBRARY}
${CONFIGURATION_LIBRARY} ${CONFIGURATION_LIBRARY}
${UTILITIES_LIBRARY}
${LEFDEF_LIBRARIES} ${LEFDEF_LIBRARIES}
${OA_LIBRARIES} ${OA_LIBRARIES}
${QT_LIBRARIES} ${QT_LIBRARIES}

View File

@ -2,14 +2,9 @@
// -*- C++ -*- // -*- C++ -*-
// //
// This file is part of the Coriolis Software. // This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // Copyright (c) UPMC 2008-2013, All Rights Reserved
// //
// =================================================================== // +-----------------------------------------------------------------+
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | C O R I O L I S | // | C O R I O L I S |
// | C y c l o p - S i m p l e V i e w e r | // | C y c l o p - S i m p l e V i e w e r |
// | | // | |
@ -17,10 +12,8 @@
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr | // | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
// | =============================================================== | // | =============================================================== |
// | C++ Module : "./CyclopMain.cpp" | // | C++ Module : "./CyclopMain.cpp" |
// | *************************************************************** | // +-----------------------------------------------------------------+
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include <memory> #include <memory>
#include <vector> #include <vector>
@ -30,14 +23,12 @@ using namespace std;
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
namespace boptions = boost::program_options; namespace boptions = boost::program_options;
#include <boost/filesystem/operations.hpp>
namespace bfs = boost::filesystem;
#include <QtGui> #include <QtGui>
#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__) #if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__)
# include <QGtkStyle> # include <QGtkStyle>
#endif #endif
#include "vlsisapd/utilities/Path.h"
#include "hurricane/DataBase.h" #include "hurricane/DataBase.h"
#include "hurricane/Technology.h" #include "hurricane/Technology.h"
#include "hurricane/Layer.h" #include "hurricane/Layer.h"
@ -100,8 +91,6 @@ int main ( int argc, char *argv[] )
int returnCode = 0; int returnCode = 0;
try { try {
bfs::path::default_name_check ( bfs::portable_posix_name );
unsigned int traceLevel; unsigned int traceLevel;
bool verbose1; bool verbose1;
bool verbose2; bool verbose2;
@ -129,7 +118,7 @@ int main ( int argc, char *argv[] )
boptions::store ( boptions::parse_command_line(argc,argv,options), arguments ); boptions::store ( boptions::parse_command_line(argc,argv,options), arguments );
boptions::notify ( arguments ); boptions::notify ( arguments );
bfs::path userConfFile = "ma/configuration"; Utilities::Path userConfFile ( "ma/configuration" );
cerr << "Mark:" << userConfFile.string() << endl; cerr << "Mark:" << userConfFile.string() << endl;
if ( arguments.count("help") ) { if ( arguments.count("help") ) {

View File

@ -2,6 +2,7 @@
include ( ${QT_USE_FILE} ) include ( ${QT_USE_FILE} )
include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore include_directories ( ${CRLCORE_SOURCE_DIR}/src/ccore
${HURRICANE_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR}
${UTILITIES_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )
@ -11,6 +12,7 @@
add_executable ( cx2y ${cpps} ) add_executable ( cx2y ${cpps} )
target_link_libraries ( cx2y crlcore target_link_libraries ( cx2y crlcore
${LIBEXECINFO_LIBRARIES} ${UTILITIES_LIBRARY}
) ${LIBEXECINFO_LIBRARIES}
)
install ( TARGETS cx2y DESTINATION bin ) install ( TARGETS cx2y DESTINATION bin )