Adding compile flag to get rid of STXXL dependency for osrm-routed
This commit is contained in:
parent
ee1b3afdcf
commit
8e1d69ac8b
@ -27,7 +27,10 @@ or see http://www.gnu.org/licenses/agpl.txt.
|
|||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#ifndef ROUTED
|
||||||
#include <stxxl.h>
|
#include <stxxl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
@ -71,9 +74,11 @@ public:
|
|||||||
~NNGrid() {
|
~NNGrid() {
|
||||||
if(ramInFile.is_open()) ramInFile.close();
|
if(ramInFile.is_open()) ramInFile.close();
|
||||||
|
|
||||||
|
#ifndef ROUTED
|
||||||
if (WriteAccess) {
|
if (WriteAccess) {
|
||||||
entries.clear();
|
entries.clear();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if(localStream.get() && localStream->is_open()) {
|
if(localStream.get() && localStream->is_open()) {
|
||||||
localStream->close();
|
localStream->close();
|
||||||
}
|
}
|
||||||
@ -87,6 +92,7 @@ public:
|
|||||||
|
|
||||||
template<typename EdgeT>
|
template<typename EdgeT>
|
||||||
void ConstructGrid(std::vector<EdgeT> & edgeList, char * ramIndexOut, char * fileIndexOut) {
|
void ConstructGrid(std::vector<EdgeT> & edgeList, char * ramIndexOut, char * fileIndexOut) {
|
||||||
|
#ifndef ROUTED
|
||||||
Percent p(edgeList.size());
|
Percent p(edgeList.size());
|
||||||
BOOST_FOREACH(EdgeT & edge, edgeList) {
|
BOOST_FOREACH(EdgeT & edge, edgeList) {
|
||||||
p.printIncrement();
|
p.printIncrement();
|
||||||
@ -139,9 +145,10 @@ public:
|
|||||||
ramFile.write((char *)&ramIndexTable[0], sizeof(unsigned long)*1024*1024 );
|
ramFile.write((char *)&ramIndexTable[0], sizeof(unsigned long)*1024*1024 );
|
||||||
//close ram index file
|
//close ram index file
|
||||||
ramFile.close();
|
ramFile.close();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FindPhantomNodeForCoordinate( const _Coordinate & location, PhantomNode & resultNode) {
|
bool FindPhantomNodeForCoordinate( const _Coordinate & location, PhantomNode & resultNode) {
|
||||||
bool foundNode = false;
|
bool foundNode = false;
|
||||||
_Coordinate startCoord(100000*(lat2y(static_cast<double>(location.lat)/100000.)), location.lon);
|
_Coordinate startCoord(100000*(lat2y(static_cast<double>(location.lat)/100000.)), location.lon);
|
||||||
/** search for point on edge close to source */
|
/** search for point on edge close to source */
|
||||||
@ -397,11 +404,13 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AddEdge(_GridEdge edge) {
|
void AddEdge(_GridEdge edge) {
|
||||||
|
#ifndef ROUTED
|
||||||
std::vector<BresenhamPixel> indexList;
|
std::vector<BresenhamPixel> indexList;
|
||||||
GetListOfIndexesForEdgeAndGridSize(edge.startCoord, edge.targetCoord, indexList);
|
GetListOfIndexesForEdgeAndGridSize(edge.startCoord, edge.targetCoord, indexList);
|
||||||
for(unsigned i = 0; i < indexList.size(); ++i) {
|
for(unsigned i = 0; i < indexList.size(); ++i) {
|
||||||
entries.push_back(GridEntry(edge, indexList[i].first, indexList[i].second));
|
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) {
|
inline double ComputeDistance(const _Coordinate& inputPoint, const _Coordinate& source, const _Coordinate& target, _Coordinate& nearest, double *r) {
|
||||||
@ -502,7 +511,9 @@ private:
|
|||||||
|
|
||||||
ofstream indexOutFile;
|
ofstream indexOutFile;
|
||||||
ifstream ramInFile;
|
ifstream ramInFile;
|
||||||
|
#ifndef ROUTED
|
||||||
stxxl::vector<GridEntry> entries;
|
stxxl::vector<GridEntry> entries;
|
||||||
|
#endif
|
||||||
std::vector<unsigned long> ramIndexTable; //8 MB for first level index in RAM
|
std::vector<unsigned long> ramIndexTable; //8 MB for first level index in RAM
|
||||||
std::string iif;
|
std::string iif;
|
||||||
// LRUCache<int,std::vector<unsigned> > cellCache;
|
// LRUCache<int,std::vector<unsigned> > cellCache;
|
||||||
|
@ -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.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(CCFLAGS = ['-lboost_regex', '-lboost_iostreams', '-lbz2', '-lz', '-lprotobuf'])
|
||||||
env.Append(LINKFLAGS = ['-lboost_system'])
|
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()
|
env = conf.Finish()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user