* ./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()
set_lib_link_mode()
setup_sysconfdir("${CMAKE_INSTALL_PREFIX}")
setup_boost(program_options filesystem python regex wave)
setup_boost(program_options python regex wave)
message(STATUS "${Boost_LIBRARIES}")
find_package(LibXml2 REQUIRED)

View File

@ -2,7 +2,7 @@
// -*- C++ -*-
//
// 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 |
@ -16,6 +16,7 @@
#include <unistd.h>
#include "vlsisapd/utilities/Path.h"
#include "hurricane/Warning.h"
#include "hurricane/Technology.h"
#include "hurricane/DataBase.h"
@ -23,7 +24,6 @@
#include "hurricane/Cell.h"
#include "hurricane/Instance.h"
#include "hurricane/viewer/Graphics.h"
#include "crlcore/Utilities.h"
#include "crlcore/GraphicsParser.h"
#include "crlcore/SymbolicTechnologyParser.h"
@ -392,9 +392,9 @@ namespace CRL {
{
if ( library == NULL ) return;
bfs::path libPath ( getString(library->getPath()) );
if ( not bfs::exists(libPath) ) {
bfs::create_directory(libPath);
Utilities::Path libPath ( getString(library->getPath()) );
if ( not libPath.exists() ) {
libPath.mkdir();
}
forEach ( Cell*, icell, library->getLibrary()->getCells() ) {

View File

@ -2,7 +2,7 @@
// -*- C++ -*-
//
// 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 |
@ -19,10 +19,7 @@
#include <sstream>
#include <fstream>
#include <iomanip>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/fstream.hpp>
namespace bfs = boost::filesystem;
#include "vlsisapd/utilities/Path.h"
#include "crlcore/Histogram.h"
@ -114,11 +111,11 @@ namespace CRL {
void Histogram::toGnuplot ( const string& basename )
{
bfs::path datFile = basename + _fileExtension + ".dat";
Utilities::Path datFile ( basename+_fileExtension+".dat" );
toFile ( datFile.string() );
bfs::path pltFile = basename + _fileExtension + ".plt";
bfs::ofstream fd ( pltFile );
Utilities::Path pltFile ( basename+_fileExtension+".plt" );
ofstream fd ( pltFile.string() );
if ( not _mainTitle.empty() )
fd << "set title \"" << _mainTitle << "\"\n";

View File

@ -2,7 +2,7 @@
// -*- C++ -*-
//
// 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 |
@ -24,6 +24,7 @@
#include <boost/program_options.hpp>
namespace boptions = boost::program_options;
#include "vlsisapd/utilities/Path.h"
#include "vlsisapd/configuration/Configuration.h"
#include "hurricane/Backtrace.h"
#include "hurricane/Warning.h"
@ -89,8 +90,8 @@ namespace {
void stratus1MappingNameChanged ( Cfg::Parameter* p )
{
bfs::path stratusMappingName = p->asString();
if ( not stratusMappingName.has_root_directory() ) {
Utilities::Path stratusMappingName ( p->asString() );
if ( not stratusMappingName.absolute() ) {
stratusMappingName = System::getPath("etc") / stratusMappingName;
}
setenv ( "STRATUS_MAPPING_NAME", stratusMappingName.string().c_str(), 1 );
@ -249,9 +250,6 @@ namespace CRL {
boptions::store ( boptions::parse_environment(options,environmentMapper), 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.
// cerr << "In System singleton creation." << endl;
// AllianceFramework::get();
@ -266,8 +264,8 @@ namespace CRL {
);
}
bfs::path sysConfDir ( SYS_CONF_DIR );
if ( not sysConfDir.has_root_path() ) {
Utilities::Path sysConfDir ( SYS_CONF_DIR );
if ( not sysConfDir.absolute() ) {
if ( arguments.count("coriolis_top") ) {
// const boptions::variable_value& value = arguments["coriolis_top"];
// cerr << "value:"
@ -297,12 +295,12 @@ namespace CRL {
_pathes.insert ( make_pair("home",arguments["home"].as<string>()) );
// 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;
_pathes.insert ( make_pair("pythonSitePackages",pythonSitePackages.string()) );
bfs::path crlcoreDir = pythonSitePackages / "crlcore";
bfs::path stratusDir = pythonSitePackages / "stratus";
bfs::path cumulusDir = pythonSitePackages / "cumulus";
Utilities::Path crlcoreDir = pythonSitePackages / "crlcore";
Utilities::Path stratusDir = pythonSitePackages / "stratus";
Utilities::Path cumulusDir = pythonSitePackages / "cumulus";
Isobar::Script::addPath ( sysConfDir.string() );
Isobar::Script::addPath ( pythonSitePackages.string() );
@ -331,7 +329,7 @@ namespace CRL {
logModeChanged ( Cfg::getParamBool("misc.logMode" ) );
traceLevelChanged ( Cfg::getParamInt ("misc.traceLevel" ) );
bfs::path stratusMappingName;
Utilities::Path stratusMappingName;
if ( arguments.count("stratus_mapping_name") ) {
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;
return (*ipath).second;
@ -420,13 +418,13 @@ namespace CRL {
void System::_runPythonInit ()
{
Cfg::Configuration* conf = Cfg::Configuration::get ();
bfs::path sysConfDir = getPath("etc");
bfs::path pythonSitePackages = getPath("pythonSitePackages");
Utilities::Path sysConfDir = getPath("etc");
Utilities::Path pythonSitePackages = getPath("pythonSitePackages");
#if XML_NOT_DISABLED
bool systemConfFound = false;
bfs::path systemConfFile = sysConfDir / "tools.configuration.xml";
if ( bfs::exists(systemConfFile) ) {
bool systemConfFound = false;
Utilities::Path systemConfFile = sysConfDir / "tools.configuration.xml";
if ( systemConfFile.exists() ) {
systemConfFound = true;
conf->readFromFile ( systemConfFile.string() );
} else {
@ -435,14 +433,14 @@ namespace CRL {
}
#endif
bool systemConfFound = false;
bfs::path systemConfFile = pythonSitePackages / "crlcore" / "coriolisInit.py";
if ( bfs::exists(systemConfFile) ) {
bool systemConfFound = false;
Utilities::Path systemConfFile = pythonSitePackages / "crlcore" / "coriolisInit.py";
if ( systemConfFile.exists() ) {
systemConfFound = true;
//cout << " o Reading python dot configuration:" << 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->destroy();
} else {
@ -450,17 +448,17 @@ namespace CRL {
,systemConfFile.string().c_str()) << endl;
}
bool homeConfFound = false;
bfs::path homeConfFile = getPath("home");
bool homeConfFound = false;
Utilities::Path homeConfFile = getPath("home");
homeConfFile /= ".coriolis2.configuration.xml";
if ( bfs::exists(homeConfFile) ) {
if ( homeConfFile.exists() ) {
homeConfFound = true;
conf->readFromFile ( homeConfFile.string() );
}
bool dotConfFound = false;
bfs::path dotConfFile = "./.coriolis2.configuration.xml";
if ( bfs::exists(dotConfFile) ) {
bool dotConfFound = false;
Utilities::Path dotConfFile = "./.coriolis2.configuration.xml";
if ( dotConfFile.exists() ) {
dotConfFound = true;
conf->readFromFile ( dotConfFile.string() );
}

View File

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

View File

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

View File

@ -2,14 +2,9 @@
// -*- C++ -*-
//
// 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 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 |
// | =============================================================== |
// | C++ Module : "./CyclopMain.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
// +-----------------------------------------------------------------+
#include <memory>
#include <vector>
@ -30,14 +23,12 @@ using namespace std;
#include <boost/program_options.hpp>
namespace boptions = boost::program_options;
#include <boost/filesystem/operations.hpp>
namespace bfs = boost::filesystem;
#include <QtGui>
#if (QT_VERSION >= QT_VERSION_CHECK(4,5,0)) and not defined (__APPLE__)
# include <QGtkStyle>
#endif
#include "vlsisapd/utilities/Path.h"
#include "hurricane/DataBase.h"
#include "hurricane/Technology.h"
#include "hurricane/Layer.h"
@ -100,8 +91,6 @@ int main ( int argc, char *argv[] )
int returnCode = 0;
try {
bfs::path::default_name_check ( bfs::portable_posix_name );
unsigned int traceLevel;
bool verbose1;
bool verbose2;
@ -129,7 +118,7 @@ int main ( int argc, char *argv[] )
boptions::store ( boptions::parse_command_line(argc,argv,options), arguments );
boptions::notify ( arguments );
bfs::path userConfFile = "ma/configuration";
Utilities::Path userConfFile ( "ma/configuration" );
cerr << "Mark:" << userConfFile.string() << endl;
if ( arguments.count("help") ) {

View File

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