DigitalInBlue / Celero

C++ Benchmark Authoring Library/Framework
Other
824 stars 95 forks source link

Compilation Error on Ubuntu 15.04 using g++ #56

Closed danielsaad closed 8 years ago

danielsaad commented 9 years ago

Hello! I had a problem during compilation while using Ubuntu 15.04 with g++ 4.9.2. When running the makefile generated by the CMakeLists.txt, this is the output:

Scanning dependencies of target celero [ 3%] Building CXX object CMakeFiles/celero.dir/src/Archive.cpp.o [ 6%] Building CXX object CMakeFiles/celero.dir/src/Benchmark.cpp.o [ 10%] Building CXX object CMakeFiles/celero.dir/src/Callbacks.cpp.o [ 13%] Building CXX object CMakeFiles/celero.dir/src/Celero.cpp.o [ 17%] Building CXX object CMakeFiles/celero.dir/src/Console.cpp.o [ 20%] Building CXX object CMakeFiles/celero.dir/src/Distribution.cpp.o [ 24%] Building CXX object CMakeFiles/celero.dir/src/Executor.cpp.o [ 27%] Building CXX object CMakeFiles/celero.dir/src/JUnit.cpp.o [ 31%] Building CXX object CMakeFiles/celero.dir/src/Print.cpp.o [ 34%] Building CXX object CMakeFiles/celero.dir/src/Experiment.cpp.o [ 37%] Building CXX object CMakeFiles/celero.dir/src/Result.cpp.o [ 41%] Building CXX object CMakeFiles/celero.dir/src/ResultTable.cpp.o [ 44%] Building CXX object CMakeFiles/celero.dir/src/Statistics.cpp.o [ 48%] Building CXX object CMakeFiles/celero.dir/src/TestVector.cpp.o [ 51%] Building CXX object CMakeFiles/celero.dir/src/TestFixture.cpp.o [ 55%] Building CXX object CMakeFiles/celero.dir/src/ThreadTestFixture.cpp.o [ 58%] Building CXX object CMakeFiles/celero.dir/src/Timer.cpp.o [ 62%] Building CXX object CMakeFiles/celero.dir/src/Utilities.cpp.o Linking CXX shared library libcelero.so [ 62%] Built target celero Scanning dependencies of target celeroDemoMultithread [ 65%] Building CXX object experiments/DemoMultithread/CMakeFiles/celeroDemoMultithread.dir/DemoMultithread.cpp.o Linking CXX executable ../../celeroDemoMultithread [ 65%] Built target celeroDemoMultithread Scanning dependencies of target celeroDemoFileWrite [ 68%] Building CXX object experiments/DemoFileWrite/CMakeFiles/celeroDemoFileWrite.dir/DemoFileWrite.cpp.o Linking CXX executable ../../celeroDemoFileWrite [ 68%] Built target celeroDemoFileWrite Scanning dependencies of target celeroExperimentParameterPassing [ 72%] Building CXX object experiments/ExperimentParameterPassing/CMakeFiles/celeroExperimentParameterPassing.dir/ExperimentParameterPassing.cpp.o Linking CXX executable ../../celeroExperimentParameterPassing [ 72%] Built target celeroExperimentParameterPassing Scanning dependencies of target celeroExperimentSimpleComparison [ 75%] Building CXX object experiments/ExperimentSimpleComparison/CMakeFiles/celeroExperimentSimpleComparison.dir/ExperimentSimpleComparison.cpp.o Linking CXX executable ../../celeroExperimentSimpleComparison [ 75%] Built target celeroExperimentSimpleComparison Scanning dependencies of target celeroDemoSleep [ 79%] Building CXX object experiments/DemoSleep/CMakeFiles/celeroDemoSleep.dir/DemoSleep.cpp.o Linking CXX executable ../../celeroDemoSleep [ 79%] Built target celeroDemoSleep Scanning dependencies of target celeroExperimentCostOfPimpl [ 82%] Building CXX object experiments/ExperimentCostOfPimpl/CMakeFiles/celeroExperimentCostOfPimpl.dir/ExperimentCostOfPimpl.cpp.o Linking CXX executable ../../celeroExperimentCostOfPimpl [ 82%] Built target celeroExperimentCostOfPimpl Scanning dependencies of target celeroDemoSimpleJUnit [ 86%] Building CXX object experiments/DemoSimpleJUnit/CMakeFiles/celeroDemoSimpleJUnit.dir/DemoSimpleJUnit.cpp.o Linking CXX executable ../../celeroDemoSimpleJUnit [ 86%] Built target celeroDemoSimpleJUnit Scanning dependencies of target celeroDemoDoNotOptimizeAway [ 89%] Building CXX object experiments/DemoDoNotOptimizeAway/CMakeFiles/celeroDemoDoNotOptimizeAway.dir/DemoDoNotOptimizeAway.cpp.o Linking CXX executable ../../celeroDemoDoNotOptimizeAway [ 89%] Built target celeroDemoDoNotOptimizeAway Scanning dependencies of target celeroDemoTransform [ 93%] Building CXX object experiments/DemoTransform/CMakeFiles/celeroDemoTransform.dir/DemoTransform.cpp.o Linking CXX executable ../../celeroDemoTransform [ 93%] Built target celeroDemoTransform Scanning dependencies of target celeroExperimentSortingRandomInts [ 96%] Building CXX object experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:125:48: error: wrong number of template arguments (0, should be 1) template<class FwdIt, class Compare = std::less<>> ^ In file included from /usr/include/c++/4.9/string:48:0, from /home/daniel/Desktop/Celero-master/include/celero/Benchmark.h:24, from /home/daniel/Desktop/Celero-master/include/celero/Celero.h:43, from /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:1: /usr/include/c++/4.9/bits/stl_function.h:367:12: error: provided for ‘template struct std::less’ struct less : public binary_function<_Tp, _Tp, bool> ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp: In member function ‘virtual void CeleroUserBenchmark_SortRandInts_QuickSort::UserBenchmark()’: /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:139:58: error: no matching function for call to ‘quickSort(std::vector::iterator, std::vector::iterator)’ quickSort(std::begin(this->array), std::end(this->array)); ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:139:58: note: candidate is: /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:126:6: note: template<class FwdIt, class Compare> void quickSort(FwdIt, FwdIt, Compare) void quickSort(FwdIt first, FwdIt last, Compare cmp = Compare {}) ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:126:6: note: template argument deduction/substitution failed: experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/build.make:54: recipe for target 'experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o' failed make[2]: * [experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o] Error 1 CMakeFiles/Makefile2:605: recipe for target 'experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/all' failed make[1]: * [experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *\ [all] Error 2

DigitalInBlue commented 9 years ago

Thank you for the bug report!

John Farrier

On May 22, 2015, at 15:58, Daniel Saad Nogueira Nunes notifications@github.com wrote:

Hello! I had a problem during compilation while using Ubuntu 15.04 with g++ 4.9.2. When running the makefile generated by the CMakeLists.txt, this is the output:

Scanning dependencies of target celero [ 3%] Building CXX object CMakeFiles/celero.dir/src/Archive.cpp.o [ 6%] Building CXX object CMakeFiles/celero.dir/src/Benchmark.cpp.o [ 10%] Building CXX object CMakeFiles/celero.dir/src/Callbacks.cpp.o [ 13%] Building CXX object CMakeFiles/celero.dir/src/Celero.cpp.o [ 17%] Building CXX object CMakeFiles/celero.dir/src/Console.cpp.o [ 20%] Building CXX object CMakeFiles/celero.dir/src/Distribution.cpp.o [ 24%] Building CXX object CMakeFiles/celero.dir/src/Executor.cpp.o [ 27%] Building CXX object CMakeFiles/celero.dir/src/JUnit.cpp.o [ 31%] Building CXX object CMakeFiles/celero.dir/src/Print.cpp.o [ 34%] Building CXX object CMakeFiles/celero.dir/src/Experiment.cpp.o [ 37%] Building CXX object CMakeFiles/celero.dir/src/Result.cpp.o [ 41%] Building CXX object CMakeFiles/celero.dir/src/ResultTable.cpp.o [ 44%] Building CXX object CMakeFiles/celero.dir/src/Statistics.cpp.o [ 48%] Building CXX object CMakeFiles/celero.dir/src/TestVector.cpp.o [ 51%] Building CXX object CMakeFiles/celero.dir/src/TestFixture.cpp.o [ 55%] Building CXX object CMakeFiles/celero.dir/src/ThreadTestFixture.cpp.o [ 58%] Building CXX object CMakeFiles/celero.dir/src/Timer.cpp.o [ 62%] Building CXX object CMakeFiles/celero.dir/src/Utilities.cpp.o Linking CXX shared library libcelero.so [ 62%] Built target celero Scanning dependencies of target celeroDemoMultithread [ 65%] Building CXX object experiments/DemoMultithread/CMakeFiles/celeroDemoMultithread.dir/DemoMultithread.cpp.o Linking CXX executable ../../celeroDemoMultithread [ 65%] Built target celeroDemoMultithread Scanning dependencies of target celeroDemoFileWrite [ 68%] Building CXX object experiments/DemoFileWrite/CMakeFiles/celeroDemoFileWrite.dir/DemoFileWrite.cpp.o Linking CXX executable ../../celeroDemoFileWrite [ 68%] Built target celeroDemoFileWrite Scanning dependencies of target celeroExperimentParameterPassing [ 72%] Building CXX object experiments/ExperimentParameterPassing/CMakeFiles/celeroExperimentParameterPassing.dir/ExperimentParameterPassing.cpp.o Linking CXX executable ../../celeroExperimentParameterPassing [ 72%] Built target celeroExperimentParameterPassing Scanning dependencies of target celeroExperimentSimpleComparison [ 75%] Building CXX object experiments/ExperimentSimpleComparison/CMakeFiles/celeroExperimentSimpleComparison.dir/ExperimentSimpleComparison.cpp.o Linking CXX executable ../../celeroExperimentSimpleComparison [ 75%] Built target celeroExperimentSimpleComparison Scanning dependencies of target celeroDemoSleep [ 79%] Building CXX object experiments/DemoSleep/CMakeFiles/celeroDemoSleep.dir/DemoSleep.cpp.o Linking CXX executable ../../celeroDemoSleep [ 79%] Built target celeroDemoSleep Scanning dependencies of target celeroExperimentCostOfPimpl [ 82%] Building CXX object experiments/ExperimentCostOfPimpl/CMakeFiles/celeroExperimentCostOfPimpl.dir/ExperimentCostOfPimpl.cpp.o Linking CXX executable ../../celeroExperimentCostOfPimpl [ 82%] Built target celeroExperimentCostOfPimpl Scanning dependencies of target celeroDemoSimpleJUnit [ 86%] Building CXX object experiments/DemoSimpleJUnit/CMakeFiles/celeroDemoSimpleJUnit.dir/DemoSimpleJUnit.cpp.o Linking CXX executable ../../celeroDemoSimpleJUnit [ 86%] Built target celeroDemoSimpleJUnit Scanning dependencies of target celeroDemoDoNotOptimizeAway [ 89%] Building CXX object experiments/DemoDoNotOptimizeAway/CMakeFiles/celeroDemoDoNotOptimizeAway.dir/DemoDoNotOptimizeAway.cpp.o Linking CXX executable ../../celeroDemoDoNotOptimizeAway [ 89%] Built target celeroDemoDoNotOptimizeAway Scanning dependencies of target celeroDemoTransform [ 93%] Building CXX object experiments/DemoTransform/CMakeFiles/celeroDemoTransform.dir/DemoTransform.cpp.o Linking CXX executable ../../celeroDemoTransform [ 93%] Built target celeroDemoTransform Scanning dependencies of target celeroExperimentSortingRandomInts [ 96%] Building CXX object experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:125:48: error: wrong number of template arguments (0, should be 1) template> ^ In file included from /usr/include/c++/4.9/string:48:0, from /home/daniel/Desktop/Celero-master/include/celero/Benchmark.h:24, from /home/daniel/Desktop/Celero-master/include/celero/Celero.h:43, from /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:1: /usr/include/c++/4.9/bits/stl_function.h:367:12: error: provided for ‘template struct std::less’ struct less : public binary_function<_Tp, _Tp, bool> ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp: In member function ‘virtual void CeleroUserBenchmark_SortRandInts_QuickSort::UserBenchmark()’: /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:139:58: error: no matching function for call to ‘quickSort(std::vector::iterator, std::vector::iterator)’ quickSort(std::begin(this->array), std::end(this->array)); ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:139:58: note: candidate is: /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:126:6: note: template void quickSort(FwdIt, FwdIt, Compare) void quickSort(FwdIt first, FwdIt last, Compare cmp = Compare {}) ^ /home/daniel/Desktop/Celero-master/experiments/ExperimentSortingRandomInts/ExperimentSortingRandomInts.cpp:126:6: note: template argument deduction/substitution failed: experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/build.make:54: recipe for target 'experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o' failed make[2]: * [experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/ExperimentSortingRandomInts.cpp.o] Error 1 CMakeFiles/Makefile2:605: recipe for target 'experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/all' failed make[1]: * [experiments/ExperimentSortingRandomInts/CMakeFiles/celeroExperimentSortingRandomInts.dir/all] Error 2 Makefile:117: recipe for target 'all' failed make: *\ [all] Error 2

— Reply to this email directly or view it on GitHub.