diff --git a/Algorithms/CRC32.cpp b/Algorithms/CRC32.cpp index 5d1971d18..643837514 100644 --- a/Algorithms/CRC32.cpp +++ b/Algorithms/CRC32.cpp @@ -26,7 +26,7 @@ CRC32::CRC32() : crc(0) { unsigned CRC32::SoftwareBasedCRC32(char *str, unsigned len, unsigned crc) { boost::crc_optimal<32, 0x1EDC6F41, 0x0, 0x0, true, true> CRC32_Processor; - CRC32_Processor.process_bytes( str, 100000000); + CRC32_Processor.process_bytes( str, len); return CRC32_Processor.checksum(); } @@ -62,8 +62,10 @@ CRC32::CRC32CFunctionPtr CRC32::detectBestCRC32C() { unsigned ecx = cpuid(1); bool hasSSE42 = ecx & (1 << SSE42_BIT); if (hasSSE42) { + std::cout << "sse based" << std::endl; return &CRC32::SSEBasedCRC32; //crc32 hardware accelarated; } else { + std::cout << "softbased" << std::endl; return &CRC32::SoftwareBasedCRC32; //crc32cSlicingBy8; } } diff --git a/Algorithms/CRC32.h b/Algorithms/CRC32.h index 32b72f838..5e4493e3c 100644 --- a/Algorithms/CRC32.h +++ b/Algorithms/CRC32.h @@ -22,6 +22,7 @@ #define CRC32_H_ #include // for boost::crc_32_type +#include class CRC32 { private: diff --git a/SConstruct b/SConstruct index f8d0c718c..4a5f1a34f 100644 --- a/SConstruct +++ b/SConstruct @@ -198,7 +198,7 @@ env.Append(CCFLAGS = ['-fopenmp']) env.Append(LINKFLAGS = ['-fopenmp']) env.Program(target = 'osrm-extract', source = ["extractor.cpp", Glob('DataStructures/pbf-proto/*.pb.cc'), Glob('Util/*.cpp')]) -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'), Glob('Algorithms/*.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', Glob('ThirdParty/*.cc')], CCFLAGS = ['-DROUTED'])