ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
2.87k stars 782 forks source link

Build of version 22.02 fails with GCC12 - `error: ‘ostream_iterator’ is not a member of ‘std’` #975

Closed ggardet closed 2 years ago

ggardet commented 2 years ago

Output of 'strings libarm_compute.so | grep arm_compute_version': 22.02

Platform: aarch64

Operating System: openSUSE Tumbleweed

Problem description: Build fails with GCC12 on openSUSE Tumbleweed aarch64:

[ 1139s] g++ -o build/utils/Utils.o -c -Wall -DARCH_ARM -Wextra -pedantic -Wdisabled-optimization -Wformat=2 -Winit-self -Wstrict-overflow=2 -Wswitch-default -std=c++14 -Woverloaded-virtual -Wformat-security -Wctor-dtor-privacy -Wsign-promo -Weffc++ -Wno-overlength-strings -Wlogical-op -Wnoexcept -Wstrict-null-sentinel -Wno-misleading-indentation -C -march=armv8-a -Wno-ignored-attributes -DENABLE_FP16_KERNELS -DENABLE_FP32_KERNELS -DENABLE_QASYMM8_KERNELS -DENABLE_QASYMM8_SIGNED_KERNELS -DENABLE_QSYMM16_KERNELS -DENABLE_INTEGER_KERNELS -DENABLE_NHWC_KERNELS -DENABLE_NCHW_KERNELS -O3 -mbranch-protection=standard -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -D_GLIBCXX_USE_NANOSLEEP -DARM_COMPUTE_CPP_SCHEDULER=1 -DENABLE_NEON -DARM_COMPUTE_ENABLE_NEON -DARM_COMPUTE_GRAPH_ENABLED -DARM_COMPUTE_CPU_ENABLED -DARM_COMPUTE_OPENCL_ENABLED -DEMBEDDED_KERNELS -Iinclude -I. -I. utils/Utils.cpp
[ 1140s] g++ -o build/utils/GraphUtils.o -c -Wall -DARCH_ARM -Wextra -pedantic -Wdisabled-optimization -Wformat=2 -Winit-self -Wstrict-overflow=2 -Wswitch-default -std=c++14 -Woverloaded-virtual -Wformat-security -Wctor-dtor-privacy -Wsign-promo -Weffc++ -Wno-overlength-strings -Wlogical-op -Wnoexcept -Wstrict-null-sentinel -Wno-misleading-indentation -C -march=armv8-a -Wno-ignored-attributes -DENABLE_FP16_KERNELS -DENABLE_FP32_KERNELS -DENABLE_QASYMM8_KERNELS -DENABLE_QASYMM8_SIGNED_KERNELS -DENABLE_QSYMM16_KERNELS -DENABLE_INTEGER_KERNELS -DENABLE_NHWC_KERNELS -DENABLE_NCHW_KERNELS -O3 -mbranch-protection=standard -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -D_GLIBCXX_USE_NANOSLEEP -DARM_COMPUTE_CPP_SCHEDULER=1 -DENABLE_NEON -DARM_COMPUTE_ENABLE_NEON -DARM_COMPUTE_GRAPH_ENABLED -DARM_COMPUTE_CPU_ENABLED -DARM_COMPUTE_OPENCL_ENABLED -DEMBEDDED_KERNELS -Iinclude -I. -I. utils/GraphUtils.cpp
[ 1141s] In file included from utils/Utils.h:39,
[ 1141s]                  from utils/Utils.cpp:24:
[ 1141s] include/libnpy/npy.hpp: In function ‘std::string npy::pyparse::write_tuple(const std::vector<T>&)’:
[ 1141s] include/libnpy/npy.hpp:298:42: error: ‘ostream_iterator’ is not a member of ‘std’
[ 1141s]   298 |     std::copy(v.begin(), v.end()-1, std::ostream_iterator<T>(ss, delimiter.c_str()));
[ 1141s]       |                                          ^~~~~~~~~~~~~~~~
[ 1141s] include/libnpy/npy.hpp:38:1: note: ‘std::ostream_iterator’ is defined in header ‘<iterator>’; did you forget to ‘#include <iterator>’?
[ 1141s]    37 | #include <unordered_map>
[ 1141s]   +++ |+#include <iterator>
[ 1141s]    38 | 
[ 1141s] include/libnpy/npy.hpp:298:60: error: expected primary-expression before ‘>’ token
[ 1141s]   298 |     std::copy(v.begin(), v.end()-1, std::ostream_iterator<T>(ss, delimiter.c_str()));
[ 1141s]       | 
morgolock commented 2 years ago

Hi @ggardet

Thanks for reporting this, please apply this patch to fix the problem:

https://review.mlplatform.org/c/ml/ComputeLibrary/+/7682