Adding compile flag to get rid of STXXL dependency for osrm-routed

This commit is contained in:
DennisOSRM 2012-01-01 16:20:00 +01:00
parent ee1b3afdcf
commit 8e1d69ac8b
2 changed files with 13 additions and 2 deletions

View File

@ -27,7 +27,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <fstream>
#include <limits>
#include <vector>
#ifndef ROUTED
#include <stxxl.h>
#endif
#ifdef _WIN32
#include <math.h>
@ -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<typename EdgeT>
void ConstructGrid(std::vector<EdgeT> & edgeList, char * ramIndexOut, char * fileIndexOut) {
#ifndef ROUTED
Percent p(edgeList.size());
BOOST_FOREACH(EdgeT & edge, edgeList) {
p.printIncrement();
@ -139,6 +145,7 @@ 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) {
@ -397,11 +404,13 @@ private:
}
void AddEdge(_GridEdge edge) {
#ifndef ROUTED
std::vector<BresenhamPixel> 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<GridEntry> entries;
#endif
std::vector<unsigned long> ramIndexTable; //8 MB for first level index in RAM
std::string iif;
// LRUCache<int,std::vector<unsigned> > cellCache;

View File

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