Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks fail to build with C++11 #3318

Closed
msimberg opened this issue May 15, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@msimberg
Copy link
Contributor

commented May 15, 2018

The following benchmarks fail to build if HPX_WITH_CXX11=ON using gcc 8.1 and 7.3:

benchmark_remove_if
benchmark_unique
benchmark_remove

Output is:

$ make -kj1 tests.performance.parallel_algorithms.local_
[  0%] Built target hpx_init
[ 90%] Built target hpx
[ 90%] Building CXX object tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_if_exe.dir/benchmark_remove_if.cpp.o
In file included from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/char_traits.h:39:0,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ios:40,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ostream:38,
                 from include/boost/system/error_code.hpp:19,
                 from /home/simbergm/src/hpx/hpx/error.hpp:15,
                 from /home/simbergm/src/hpx/hpx/exception_fwd.hpp:13,
                 from /home/simbergm/src/hpx/hpx/hpx_finalize.hpp:12,
                 from /home/simbergm/src/hpx/hpx/hpx_init.hpp:15,
                 from /home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove_if.cpp:8:
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _IIter2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove_if.cpp:63:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: no match for call to ‘(__gnu_cxx::__normal_iterator<const int*, std::vector<int> >) (const int&, const int&)’
  if (!bool(__binary_pred(*__first1, *__first2)))
            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = const int*; _IIter2 = const int*; _BinaryPredicate = const int*]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove_if.cpp:82:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: ‘__binary_pred’ cannot be used as a function
make[3]: *** [tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_if_exe.dir/build.make:63: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_if_exe.dir/benchmark_remove_if.cpp.o] Error 1
make[3]: Target 'tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_if_exe.dir/build' not remade because of errors.
make[2]: *** [CMakeFiles/Makefile2:15631: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_if_exe.dir/all] Error 2
[ 90%] Building CXX object tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_unique_exe.dir/benchmark_unique.cpp.o
In file included from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/char_traits.h:39:0,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ios:40,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ostream:38,
                 from include/boost/system/error_code.hpp:19,
                 from /home/simbergm/src/hpx/hpx/error.hpp:15,
                 from /home/simbergm/src/hpx/hpx/exception_fwd.hpp:13,
                 from /home/simbergm/src/hpx/hpx/hpx_finalize.hpp:12,
                 from /home/simbergm/src/hpx/hpx/hpx_init.hpp:15,
                 from /home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_unique.cpp:8:
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _IIter2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_unique.cpp:63:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: no match for call to ‘(__gnu_cxx::__normal_iterator<const int*, std::vector<int> >) (const int&, const int&)’
  if (!bool(__binary_pred(*__first1, *__first2)))
            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = const int*; _IIter2 = const int*; _BinaryPredicate = const int*]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_unique.cpp:82:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: ‘__binary_pred’ cannot be used as a function
make[3]: *** [tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_unique_exe.dir/build.make:63: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_unique_exe.dir/benchmark_unique.cpp.o] Error 1
make[3]: Target 'tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_unique_exe.dir/build' not remade because of errors.
make[2]: *** [CMakeFiles/Makefile2:15240: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_unique_exe.dir/all] Error 2
[ 90%] Built target benchmark_is_heap_until_exe
[ 90%] Built target tests.performance.parallel_algorithms.local_.benchmark_is_heap_until
[ 90%] Built target benchmark_unique_copy_exe
[ 90%] Built target tests.performance.parallel_algorithms.local_.benchmark_unique_copy
[ 90%] Built target benchmark_is_heap_exe
[ 90%] Built target tests.performance.parallel_algorithms.local_.benchmark_is_heap
[ 90%] Built target benchmark_merge_exe
[ 90%] Built target tests.performance.parallel_algorithms.local_.benchmark_merge
[ 90%] Building CXX object tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_exe.dir/benchmark_remove.cpp.o
In file included from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/char_traits.h:39:0,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ios:40,
                 from /nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/ostream:38,
                 from include/boost/system/error_code.hpp:19,
                 from /home/simbergm/src/hpx/hpx/error.hpp:15,
                 from /home/simbergm/src/hpx/hpx/exception_fwd.hpp:13,
                 from /home/simbergm/src/hpx/hpx/hpx_finalize.hpp:12,
                 from /home/simbergm/src/hpx/hpx/hpx_init.hpp:15,
                 from /home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove.cpp:8:
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _IIter2 = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<const int*, std::vector<int> >]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove.cpp:63:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: no match for call to ‘(__gnu_cxx::__normal_iterator<const int*, std::vector<int> >) (const int&, const int&)’
  if (!bool(__binary_pred(*__first1, *__first2)))
            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h: In instantiation of ‘bool std::equal(_IIter1, _IIter1, _IIter2, _BinaryPredicate) [with _IIter1 = const int*; _IIter2 = const int*; _BinaryPredicate = const int*]’:
/home/simbergm/src/hpx/tests/performance/parallel_algorithms/local/benchmark_remove.cpp:82:49:   required from here
/nix/store/ng5kbr6kmh979qaachifbsbblydrcmqc-gcc-7.3.0/include/c++/7.3.0/bits/stl_algobase.h:1082:25: error: ‘__binary_pred’ cannot be used as a function
make[3]: *** [tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_exe.dir/build.make:63: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_exe.dir/benchmark_remove.cpp.o] Error 1
make[3]: Target 'tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_exe.dir/build' not remade because of errors.
make[2]: *** [CMakeFiles/Makefile2:15566: tests/performance/parallel_algorithms/local/CMakeFiles/benchmark_remove_exe.dir/all] Error 2
[100%] Built target benchmark_partition_exe
[100%] Built target tests.performance.parallel_algorithms.local_.benchmark_partition
[100%] Built target benchmark_inplace_merge_exe
[100%] Built target tests.performance.parallel_algorithms.local_.benchmark_inplace_merge
[100%] Built target benchmark_partition_copy_exe
[100%] Built target tests.performance.parallel_algorithms.local_.benchmark_partition_copy
make[2]: Target 'tests/performance/parallel_algorithms/CMakeFiles/tests.performance.parallel_algorithms.local_.dir/all' not remade because of errors.
make[1]: *** [CMakeFiles/Makefile2:14983: tests/performance/parallel_algorithms/CMakeFiles/tests.performance.parallel_algorithms.local_.dir/rule] Error 2
make[1]: Target 'tests.performance.parallel_algorithms.local_' not remade because of errors.
make: *** [Makefile:5128: tests.performance.parallel_algorithms.local_] Error 2

@msimberg msimberg added this to the 1.2.0 milestone May 15, 2018

@hkaiser

This comment has been minimized.

Copy link
Member

commented May 15, 2018

This is a genuine bug in our code. The benchmarks rely on the 4-argument overload (two ranges) of std::equal which is a C++14 feature and shouldn't be used in C++11 mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.