From 8e1d69ac8b7516127edebb165c7bfea908b7db70 Mon Sep 17 00:00:00 2001 From: DennisOSRM Date: Sun, 1 Jan 2012 16:20:00 +0100 Subject: [PATCH] Adding compile flag to get rid of STXXL dependency for osrm-routed --- DataStructures/NNGrid.h | 13 ++++++++++++- SConstruct | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DataStructures/NNGrid.h b/DataStructures/NNGrid.h index bdcc1197c..830c63bfe 100644 --- a/DataStructures/NNGrid.h +++ b/DataStructures/NNGrid.h @@ -27,7 +27,10 @@ or see http://www.gnu.org/licenses/agpl.txt. #include #include #include + +#ifndef ROUTED #include +#endif #ifdef _WIN32 #include @@ -71,9 +74,11 @@ public: ~NNGrid() { if(ramInFile.is_open()) ramInFile.close(); +#ifndef ROUTED if (WriteAccess) { entries.clear(); } +#endif if(localStream.get() && localStream->is_open()) { localStream->close(); } @@ -87,6 +92,7 @@ public: template void ConstructGrid(std::vector & edgeList, char * ramIndexOut, char * fileIndexOut) { +#ifndef ROUTED Percent p(edgeList.size()); BOOST_FOREACH(EdgeT & edge, edgeList) { p.printIncrement(); @@ -139,9 +145,10 @@ public: ramFile.write((char *)&ramIndexTable[0], sizeof(unsigned long)*1024*1024 ); //close ram index file ramFile.close(); +#endif } - bool FindPhantomNodeForCoordinate( const _Coordinate & location, PhantomNode & resultNode) { + bool FindPhantomNodeForCoordinate( const _Coordinate & location, PhantomNode & resultNode) { bool foundNode = false; _Coordinate startCoord(100000*(lat2y(static_cast(location.lat)/100000.)), location.lon); /** search for point on edge close to source */ @@ -397,11 +404,13 @@ private: } void AddEdge(_GridEdge edge) { +#ifndef ROUTED std::vector indexList; GetListOfIndexesForEdgeAndGridSize(edge.startCoord, edge.targetCoord, indexList); for(unsigned i = 0; i < indexList.size(); ++i) { entries.push_back(GridEntry(edge, indexList[i].first, indexList[i].second)); } +#endif } inline double ComputeDistance(const _Coordinate& inputPoint, const _Coordinate& source, const _Coordinate& target, _Coordinate& nearest, double *r) { @@ -502,7 +511,9 @@ private: ofstream indexOutFile; ifstream ramInFile; +#ifndef ROUTED stxxl::vector entries; +#endif std::vector ramIndexTable; //8 MB for first level index in RAM std::string iif; // LRUCache > cellCache; diff --git a/SConstruct b/SConstruct index c7d6bfd69..169f0d211 100644 --- a/SConstruct +++ b/SConstruct @@ -172,6 +172,6 @@ env.Program(target = 'osrm-extract', source = ["extractor.cpp", Glob('DataStruct env.Program(target = 'osrm-prepare', source = ["createHierarchy.cpp", 'Contractor/EdgeBasedGraphFactory.cpp', Glob('Util/SRTMLookup/*.cpp')]) env.Append(CCFLAGS = ['-lboost_regex', '-lboost_iostreams', '-lbz2', '-lz', '-lprotobuf']) env.Append(LINKFLAGS = ['-lboost_system']) -env.Program(target = 'osrm-routed', source = ["routed.cpp", 'Descriptors/DescriptionFactory.cpp']) +env.Program(target = 'osrm-routed', source = ["routed.cpp", 'Descriptors/DescriptionFactory.cpp'], CCFLAGS = ['-DROUTED']) env = conf.Finish()