armnn icon indicating copy to clipboard operation
armnn copied to clipboard

ArmNN 21.05 fails to build with gcc11

Open ggardet opened this issue 4 years ago • 17 comments

ArmNN 21.05 fails to build with gcc11 becauseof:

[   89s] [  2%] Building CXX object CMakeFiles/armnnUtils.dir/src/armnnUtils/FloatingPointConverter.cpp.o
[   89s] /usr/bin/c++ -DARMCOMPUTECL_ENABLED -DARMCOMPUTENEON_ENABLED -DARMNNREF_ENABLED -DARMNN_SERIALIZER -DARMNN_SERIALIZER_SCHEMA_PATH=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnSerializer/ArmnnSchema.fbs\" -DARMNN_TF_LITE_PARSER -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DDYNAMIC_BACKEND_BUILD_DIR=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/build\" -I/home/abuild/rpmbuild/BUILD/armnn-21.05/include -I/home/abuild/rpmbuild/BUILD/armnn-21.05/profiling -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends -isystem /home/abuild/rpmbuild/BUILD/armnn-21.05/third-party -isystem /usr/include/half -mbranch-protection=standard -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -pthread  -Wno-error=deprecated-copy -Wno-error=deprecated-declarations -Wno-error=implicit-fallthrough -Wno-error=unused-parameter -std=c++14 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -O2 -g  -fPIC -MD -MT CMakeFiles/armnnUtils.dir/src/armnnUtils/FloatingPointConverter.cpp.o -MF CMakeFiles/armnnUtils.dir/src/armnnUtils/FloatingPointConverter.cpp.o.d -o CMakeFiles/armnnUtils.dir/src/armnnUtils/FloatingPointConverter.cpp.o -c /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/FloatingPointConverter.cpp
[   89s] In file included from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/FloatingPointConverter.cpp:8:
[   89s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp: In member function 'float armnn::BFloat16::ToFloat32() const':
[   89s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp:89:17: error: 'u32' is used uninitialized [-Werror=uninitialized]
[   89s]    89 |         return *f32;
[   89s]       |                 ^~~
[   89s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp:87:24: note: 'u32' declared here
[   89s]    87 |         const uint32_t u32 = static_cast<uint32_t>(m_Value << 16u);
[   89s]       |                        ^~~
[   89s] cc1plus: all warnings being treated as errors
[   89s] make[2]: *** [CMakeFiles/armnnUtils.dir/build.make:177: CMakeFiles/armnnUtils.dir/src/armnnUtils/FloatingPointConverter.cpp.o] Error 1

ggardet avatar Jun 01 '21 08:06 ggardet

If I add -Wno-error=uninitialized, it fails later:

[  641s] [ 27%] Building CXX object src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/ConcatTestImpl.cpp.o
[  641s] cd /home/abuild/rpmbuild/BUILD/armnn-21.05/build/src/backends/backendsCommon/test && /usr/bin/c++ -DARMCOMPUTENEON_ENABLED -DARMNNREF_ENABLED -DARMNN_SERIALIZER -DARMNN_SERIALIZER_SCHEMA_PATH=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnSerializer/ArmnnSchema.fbs\" -DARMNN_TF_LITE_PARSER -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DDYNAMIC_BACKEND_BUILD_DIR=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/build\" -I/home/abuild/rpmbuild/BUILD/armnn-21.05/include -I/home/abuild/rpmbuild/BUILD/armnn-21.05/profiling -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnn -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/profiling -I/home/abuild/rpmbuild/BUILD/armnn-21.05/profiling/common/include -isystem /home/abuild/rpmbuild/BUILD/armnn-21.05/third-party -isystem /usr/include/half -mbranch-protection=standard -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -pthread  -Wno-error=deprecated-copy -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=implicit-fallthrough -Wno-error=unused-parameter -std=c++14 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -O2 -g  -fPIC -MD -MT src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/ConcatTestImpl.cpp.o -MF CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/ConcatTestImpl.cpp.o.d -o CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/ConcatTestImpl.cpp.o -c /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/ConcatTestImpl.cpp
[  641s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = unsigned char; _Args = {}; _Tp = unsigned char]',
[  641s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<unsigned char>; T = unsigned char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[  641s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<unsigned char>; T = unsigned char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[  641s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:548:29,
[  641s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:156:19,
[  641s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = unsigned char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5,
[  641s]     inlined from 'LayerTestResult<T, 1> Concat1dTestImpl(armnn::IWorkloadFactory&, const IMemoryManagerSharedPtr&, const armnn::ITensorHandleFactory&, float, int32_t) [with armnn::DataType ArmnnType = armnn::DataType::QAsymmU8; T = unsigned char]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/ConcatTestImpl.cpp:437:27:
[  641s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[  641s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = unsigned char; _Args = {}; _Tp = unsigned char]',
[  641s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<unsigned char>; T = unsigned char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[  642s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<unsigned char>; T = unsigned char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[  642s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:548:29,
[  642s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:156:19,
[  642s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = unsigned char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5,
[  642s]     inlined from 'LayerTestResult<T, 1> Concat1dTestImpl(armnn::IWorkloadFactory&, const IMemoryManagerSharedPtr&, const armnn::ITensorHandleFactory&, float, int32_t) [with armnn::DataType ArmnnType = armnn::DataType::QAsymmU8; T = unsigned char]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/ConcatTestImpl.cpp:437:27:
[  642s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[  642s] cc1plus: all warnings being treated as errors
[  642s] make[2]: *** [src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/build.make:415: src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/ConcatTestImpl.cpp.o] Error 1
[  642s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/armnn-21.05/build'
[  642s] make[2]: *** Waiting for unfinished jobs....

and:

[  677s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp: In constructor 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = armnn::BFloat16; long unsigned int NumDims = 1; Allocator = std::allocator<armnn::BFloat16>]':
[  677s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp:18:5: error: array subscript [-4611686018427387904, 4611686018427387903] is outside array bounds of 'armnn::BFloat16 [0]' [-Werror=array-bounds]
[  677s]    18 |     : m_Value(0)
[  677s]       |     ^
[  677s] In file included from /usr/include/c++/11/aarch64-suse-linux/bits/c++allocator.h:33,
[  677s]                  from /usr/include/c++/11/bits/allocator.h:46,
[  677s]                  from /usr/include/c++/11/string:41,
[  677s]                  from /usr/include/c++/11/bits/locale_classes.h:40,
[  677s]                  from /usr/include/c++/11/bits/ios_base.h:41,
[  677s]                  from /usr/include/c++/11/ios:42,
[  677s]                  from /usr/include/c++/11/istream:38,
[  677s]                  from /usr/include/c++/11/sstream:38,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/include/armnn/Exceptions.hpp:7,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/include/armnn/Tensor.hpp:9,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:8,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.hpp:8,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.cpp:6:
[  677s] /usr/include/c++/11/ext/new_allocator.h:127:48: note: referencing an object of size 0 allocated by 'void* operator new(std::size_t)'
[  677s]   127 |         return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
[  677s]       |                                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
[  677s] In file included from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnn/ResolveType.hpp:9,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.hpp:10,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.cpp:6:
[  677s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils/BFloat16.hpp:18:7: error: array subscript [-4611686018427387904, 4611686018427387903] is outside array bounds of 'armnn::BFloat16 [0]' [-Werror=array-bounds]
[  677s]    18 |     : m_Value(0)
[  677s]       |       ^~~~~~~~~~
[  677s] In file included from /usr/include/c++/11/aarch64-suse-linux/bits/c++allocator.h:33,
[  677s]                  from /usr/include/c++/11/bits/allocator.h:46,
[  677s]                  from /usr/include/c++/11/string:41,
[  677s]                  from /usr/include/c++/11/bits/locale_classes.h:40,
[  677s]                  from /usr/include/c++/11/bits/ios_base.h:41,
[  677s]                  from /usr/include/c++/11/ios:42,
[  677s]                  from /usr/include/c++/11/istream:38,
[  677s]                  from /usr/include/c++/11/sstream:38,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/include/armnn/Exceptions.hpp:7,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/include/armnn/Tensor.hpp:9,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:8,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.hpp:8,
[  677s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/Conv2dTestImpl.cpp:6:
[  677s] /usr/include/c++/11/ext/new_allocator.h:127:48: note: referencing an object of size 0 allocated by 'void* operator new(std::size_t)'
[  677s]   127 |         return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
[  677s]       |                                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
[  677s] cc1plus: all warnings being treated as errors
[  677s] make[2]: *** [src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/build.make:443: src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/layerTests/Conv2dTestImpl.cpp.o] Error 1
[  677s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/armnn-21.05/build'
[  677s] make[1]: *** [CMakeFiles/Makefile2:1475: src/backends/backendsCommon/test/CMakeFiles/armnnBackendsCommonUnitTests.dir/all] Error 2
[  677s] make[1]: *** Waiting for unfinished jobs....

And:

[ 1113s] In file included from /usr/include/boost/test/unit_test.hpp:19,
[ 1113s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnn/test/TensorHelpers.hpp:16,
[ 1113s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/neon/test/NeonLayerTests.cpp:8:
[ 1113s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/neon/test/NeonLayerTests.cpp: In function 'void __static_initialization_and_destruction_0(int, int)':
[ 1113s] /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/neon/test/NeonLayerTests.cpp:1500:1: note: variable tracking size limit exceeded with '-fvar-tracking-assignments', retrying without
[ 1113s]  1500 | BOOST_AUTO_TEST_SUITE_END()
[ 1113s]       | ^~~~~~~~~~~~~~~~~~~~~~~~~
[ 1113s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = signed char; _Args = {}; _Tp = signed char]',
[ 1113s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<signed char>; T = signed char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[ 1113s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<signed char>; T = signed char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[ 1113s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = signed char; long unsigned int NumDims = 1; Allocator = std::allocator<signed char>]' at /usr/include/boost/multi_array.hpp:548:29,
[ 1113s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = signed char; long unsigned int NumDims = 1; Allocator = std::allocator<signed char>]' at /usr/include/boost/multi_array.hpp:156:19,
[ 1113s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = signed char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5:
[ 1113s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[ 1113s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = signed char; _Args = {}; _Tp = signed char]',
[ 1113s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<signed char>; T = signed char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[ 1113s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<signed char>; T = signed char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[ 1113s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = signed char; long unsigned int NumDims = 1; Allocator = std::allocator<signed char>]' at /usr/include/boost/multi_array.hpp:548:29,
[ 1113s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = signed char; long unsigned int NumDims = 1; Allocator = std::allocator<signed char>]' at /usr/include/boost/multi_array.hpp:156:19,
[ 1113s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = signed char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5:
[ 1113s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[ 1113s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = unsigned char; _Args = {}; _Tp = unsigned char]',
[ 1113s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<unsigned char>; T = unsigned char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[ 1113s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<unsigned char>; T = unsigned char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[ 1113s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:548:29,
[ 1113s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:156:19,
[ 1113s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = unsigned char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5:
[ 1113s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[ 1113s] In member function 'void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = unsigned char; _Args = {}; _Tp = unsigned char]',
[ 1113s]     inlined from 'typename std::enable_if<boost::detail::alloc_has_construct<A, T, Args>::value>::type boost::allocator_construct(A&, T*, Args&& ...) [with A = std::allocator<unsigned char>; T = unsigned char; Args = {}]' at /usr/include/boost/core/allocator_access.hpp:406:16,
[ 1113s]     inlined from 'void boost::alloc_construct_n(A&, T*, std::size_t) [with A = std::allocator<unsigned char>; T = unsigned char]' at /usr/include/boost/core/alloc_construct.hpp:122:35,
[ 1113s]     inlined from 'void boost::multi_array<T, NumDims, Allocator>::allocate_space() [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:548:29,
[ 1113s]     inlined from 'boost::multi_array<T, NumDims, Allocator>::multi_array(const Allocator&) [with T = unsigned char; long unsigned int NumDims = 1; Allocator = std::allocator<unsigned char>]' at /usr/include/boost/multi_array.hpp:156:19,
[ 1113s]     inlined from 'LayerTestResult<T, n>::LayerTestResult(const armnn::TensorInfo&) [with T = unsigned char; long unsigned int n = 1]' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/backendsCommon/test/layerTests/LayerTestResult.hpp:33:5:
[ 1113s] cc1plus: error: 'void* __builtin_memset(void*, int, long unsigned int)' offset 0 is out of the bounds [0, 0] [-Werror=array-bounds]
[ 1113s] cc1plus: all warnings being treated as errors
[ 1113s] make[2]: *** [src/backends/neon/test/CMakeFiles/armnnNeonBackendUnitTests.dir/build.make:135: src/backends/neon/test/CMakeFiles/armnnNeonBackendUnitTests.dir/NeonLayerTests.cpp.o] Error 1
[ 1113s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/armnn-21.05/build'
[ 1113s] make[1]: *** [CMakeFiles/Makefile2:1979: src/backends/neon/test/CMakeFiles/armnnNeonBackendUnitTests.dir/all] Error 2
[ 1113s] make: *** [Makefile:139: all] Error 2

This is workarounded with -Wno-error=array-bounds.

ggardet avatar Jul 13 '21 07:07 ggardet

One last one is with openCL enabled:

[   33s] [  8%] Building CXX object src/backends/cl/CMakeFiles/armnnClBackend.dir/ClContextDeserializer.cpp.o
[   33s] cd /home/abuild/rpmbuild/BUILD/armnn-21.05/build/src/backends/cl && /usr/bin/c++ -DARMCOMPUTECL_ENABLED -DARMNNREF_ENABLED -DARMNN_SERIALIZER -DARMNN_SERIALIZER_SCHEMA_PATH=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnSerializer/ArmnnSchema.fbs\" -DARMNN_TF_LITE_PARSER -DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB -DDYNAMIC_BACKEND_BUILD_DIR=\"/home/abuild/rpmbuild/BUILD/armnn-21.05/build\" -I/home/abuild/rpmbuild/BUILD/armnn-21.05/include -I/home/abuild/rpmbuild/BUILD/armnn-21.05/profiling -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnn -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/armnnUtils -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends -I/home/abuild/rpmbuild/BUILD/armnn-21.05/src/profiling -I/home/abuild/rpmbuild/BUILD/armnn-21.05/profiling/common/include -isystem /home/abuild/rpmbuild/BUILD/armnn-21.05/third-party -isystem /usr/include/half -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type  -g -pthread  -Wno-error=deprecated-copy -Wno-error=deprecated-declarations -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=implicit-fallthrough -Wno-error=unused-parameter -std=c++14 -Wall -Wextra -Werror -Wold-style-cast -Wno-missing-braces -Wconversion -Wsign-conversion -O2 -g  -fPIC -MD -MT src/backends/cl/CMakeFiles/armnnClBackend.dir/ClContextDeserializer.cpp.o -MF CMakeFiles/armnnClBackend.dir/ClContextDeserializer.cpp.o.d -o CMakeFiles/armnnClBackend.dir/ClContextDeserializer.cpp.o -c /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.cpp
[   33s] In file included from /usr/include/arm_compute/core/CL/OpenCL.h:44,
[   33s]                  from /usr/include/arm_compute/core/CL/ICLArray.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLTypes.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLHelpers.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLDevice.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLCompileContext.h:27,
[   33s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.hpp:8,
[   33s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.cpp:6:
[   33s] /usr/include/CL/cl2.hpp:18:151: note: '#pragma message: cl2.hpp has been renamed to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.'
[   33s]    18 | #pragma message("cl2.hpp has been renamed to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.")
[   33s]       |                                                                                                                                                       ^
[   33s] In file included from /usr/include/c++/11/string:40,
[   33s]                  from /usr/include/arm_compute/core/CL/OpenCL.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/ICLArray.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLTypes.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLHelpers.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLDevice.h:27,
[   33s]                  from /usr/include/arm_compute/core/CL/CLCompileContext.h:27,
[   33s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.hpp:8,
[   33s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.cpp:6:
[   33s] In static member function 'static std::size_t std::char_traits<char>::length(const char_type*)',
[   33s]     inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/11/bits/basic_string.h:536:55,
[   33s]     inlined from 'void armnn::ClContextDeserializer::DeserializeFromBinary(arm_compute::CLCompileContext&, cl::Context&, cl::Device&, const std::vector<unsigned char, std::allocator<unsigned char> >&)' at /home/abuild/rpmbuild/BUILD/armnn-21.05/src/backends/cl/ClContextDeserializer.cpp:76:43:
[   33s] /usr/include/c++/11/bits/char_traits.h:371:32: error: 'long unsigned int __builtin_strlen(const char*)' reading 0 or more bytes from a region of size 0 [-Werror=stringop-overread]
[   33s]   371 |         return __builtin_strlen(__s);
[   33s]       |                ~~~~~~~~~~~~~~~~^~~~~

ggardet avatar Jul 16 '21 08:07 ggardet

This is now causing an autoremoval for armnn in Debian Testing:

"armnn 20.08-9 is marked for autoremoval from testing on 2021-10-25"

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983969

Debian Testing/Bookworm will use GCC-11, Bullseye was GCC-10 https://packages.debian.org/sid/gcc-11

FrancisMurtagh-arm avatar Oct 13 '21 09:10 FrancisMurtagh-arm

Hi @ggardet,

Does https://review.mlplatform.org/c/ml/armnn/+/6283 fix all of the above errors or do you still see this one? https://github.com/ARM-software/armnn/issues/548#issuecomment-881268218

I still get that one in Ubuntu Impish.

Regards, Francis.

FrancisMurtagh-arm avatar Oct 20 '21 13:10 FrancisMurtagh-arm

@FrancisMurtagh-arm Here is the changelog:

- Add '-Wno-error=stringop-overread' to workaround build error
  with GCC11 with openCL enabled

- Add '-Wno-error=uninitialized -Wno-error=array-bounds' to
  workaround build issues with GCC11 - https://github.com/ARM-software/armnn/issues/548

ggardet avatar Oct 20 '21 13:10 ggardet

Hi @ggardet,

Would you be able to attempt a build with the patch https://review.mlplatform.org/c/ml/armnn/+/6283 and without the -Wno-error flags just to see are all errors from 1 commit?

It could help us removing them warnings, as we're seeing conflicting results here, it doesn't occur in cross compile for example.

Regards, Francis.

FrancisMurtagh-arm avatar Oct 20 '21 14:10 FrancisMurtagh-arm

Current version is 21.08, not 21.05 anymore. Would that be ok for you? EDIT: also, I have multiple -Wno-error* flags accumulated. If you want to see all warnings/errors, you should use GCC11.

ggardet avatar Oct 20 '21 14:10 ggardet

Hi @ggardet,

21.08 would be fine yes, I'm using Ubuntu Impish which is using GCC-11 too.

Thanks, Francis.

FrancisMurtagh-arm avatar Oct 21 '21 12:10 FrancisMurtagh-arm

I added https://review.mlplatform.org/c/ml/armnn/+/6283 on top of 21.08 and removed all -Wno-error* flags. Now, the errors I get are only when openCL is enabled.

  • 1st error:
[  158s] In file included from /usr/include/arm_compute/core/CL/OpenCL.h:44,
[  158s]                  from /usr/include/arm_compute/core/CL/ICLArray.h:27,
[  158s]                  from /usr/include/arm_compute/core/CL/CLTypes.h:27,
[  158s]                  from /usr/include/arm_compute/core/CL/ICLTensor.h:29,
[  158s]                  from /usr/include/arm_compute/runtime/CL/CLTensor.h:27,
[  158s]                  from /usr/include/arm_compute/runtime/CL/functions/CLConvolutionLayer.h:27,
[  158s]                  from /usr/include/arm_compute/runtime/CL/functions/CLDirectDeconvolutionLayer.h:27,
[  158s]                  from /usr/include/arm_compute/runtime/CL/functions/CLDeconvolutionLayer.h:27,
[  158s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.08/src/backends/cl/workloads/ClTransposeConvolution2dWorkload.hpp:13,
[  158s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.08/src/backends/cl/workloads/ClTransposeConvolution2dWorkload.cpp:6:
[  158s] /usr/include/CL/cl2.hpp:18:151: note: '#pragma message: cl2.hpp has been renamed to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.'
[  158s]    18 | #pragma message("cl2.hpp has been renamed to opencl.hpp to make it clear that it supports all versions of OpenCL. Please include opencl.hpp directly.")
[  158s]       |                                                                                                                                                       ^

This can be ignored with -Wno-error=deprecated-declarations flag.

  • 2nd error:
[   41s] In file included from /usr/include/c++/11/string:40,
[   41s]                  from /usr/include/arm_compute/core/CL/OpenCL.h:27,
[   41s]                  from /usr/include/arm_compute/core/CL/ICLArray.h:27,
[   41s]                  from /usr/include/arm_compute/core/CL/CLTypes.h:27,
[   41s]                  from /usr/include/arm_compute/core/CL/CLHelpers.h:27,
[   41s]                  from /usr/include/arm_compute/core/CL/CLDevice.h:27,
[   41s]                  from /usr/include/arm_compute/core/CL/CLCompileContext.h:27,
[   41s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.08/src/backends/cl/ClContextDeserializer.hpp:8,
[   41s]                  from /home/abuild/rpmbuild/BUILD/armnn-21.08/src/backends/cl/ClContextDeserializer.cpp:6:
[   41s] In static member function 'static std::size_t std::char_traits<char>::length(const char_type*)',
[   41s]     inlined from 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::basic_string(const _CharT*, const _Alloc&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]' at /usr/include/c++/11/bits/basic_string.h:536:55,
[   42s]     inlined from 'void armnn::ClContextDeserializer::DeserializeFromBinary(arm_compute::CLCompileContext&, cl::Context&, cl::Device&, const std::vector<unsigned char, std::allocator<unsigned char> >&)' at /home/abuild/rpmbuild/BUILD/armnn-21.08/src/backends/cl/ClContextDeserializer.cpp:76:43:
[   42s] /usr/include/c++/11/bits/char_traits.h:371:32: error: 'long unsigned int __builtin_strlen(const char*)' reading 0 or more bytes from a region of size 0 [-Werror=stringop-overread]
[   42s]   371 |         return __builtin_strlen(__s);
[   42s]       |                ~~~~~~~~~~~~~~~~^~~~~

Workaround: -Wno-error=stringop-overread

ggardet avatar Oct 21 '21 15:10 ggardet

Hi @ggardet,

Thanks for confirming, that's the same result I am seeing in Ubuntu Impish.

Cheers, Francis.

FrancisMurtagh-arm avatar Oct 22 '21 09:10 FrancisMurtagh-arm

Hi @ggardet,

This patch fixes the -Wno-error=stringop-overread based on the bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

https://review.mlplatform.org/c/ml/armnn/+/6504

Also I'm not sure -Wno-error=deprecated-declarations is required as I built successfully on Ubuntu Impish without it, it appears to be something to "note" rather than treat as a warning :thinking:

Thanks, Francis.

FrancisMurtagh-arm avatar Oct 22 '21 17:10 FrancisMurtagh-arm

Indeed, -Wno-error=deprecated-declarations is not required as it is just a note. But the include path needs to be updated to be future proof.

ggardet avatar Oct 25 '21 07:10 ggardet

Hi @ggardet,

I pushed a patch for the pragma: https://review.mlplatform.org/c/ml/armnn/+/6516

However would it be possible we are using teo different cl2.hpp files in our packaging?

I found references to the pragm here: https://github.com/KhronosGroup/OpenCL-CLHPP/blob/master/include/CL/cl2.hpp

Whereas the ACL cl2.hpp header doesn't look to have it. https://github.com/ARM-software/ComputeLibrary/blob/master/include/CL/cl2.hpp

Would the khronos header have been installed in your system includes from some other package?

Thanks, Francis.

FrancisMurtagh-arm avatar Oct 27 '21 11:10 FrancisMurtagh-arm

I pushed a patch for the pragma: https://review.mlplatform.org/c/ml/armnn/+/6516

You switch from CL/CL2.hpp to CL/opencl.h. I think it should be CL/opencl.hpp.

However would it be possible we are using teo different cl2.hpp files in our packaging?

I found references to the pragm here: https://github.com/KhronosGroup/OpenCL-CLHPP/blob/master/include/CL/cl2.hpp

Whereas the ACL cl2.hpp header doesn't look to have it. https://github.com/ARM-software/ComputeLibrary/blob/master/include/CL/cl2.hpp

Would the khronos header have been installed in your system includes from some other package?

I indeed use opencl-headers/opencl-cpp-headers from the distribution, with -DOPENCL_INCLUDE=%{_includedir}.

ggardet avatar Oct 27 '21 11:10 ggardet

Hi @ggardet,

Yes so the difference in name was what made me look into it a bit more. We build-depend on ComputeLibrary packaging whose include/CL folder looks like this:

https://github.com/ARM-software/ComputeLibrary/tree/master/include/CL opencl.h

I had assumed openSuse had a similar package but the contents of the .rpm seem to be more like sampledata and for x86 https://software.opensuse.org/package/ComputeLibrary

I've asked ACL to see do they know more about the significance of the differing names.

Francis.

FrancisMurtagh-arm avatar Oct 27 '21 12:10 FrancisMurtagh-arm

Clearly, ACL should not package those header files and should depend on opencl-headers package instead. Latest packages for Arm can be found here: https://build.opensuse.org/package/binaries/openSUSE:Factory:ARM/ComputeLibrary/standard

*.h vs *.hpp are C vs C++ headers

ggardet avatar Oct 27 '21 12:10 ggardet

Thanks, I realise they're c vs c++ more so the reason why ACL provides one over the other.

I see that debian also have those headers so we better look into it on our side: https://packages.debian.org/bullseye/all/opencl-clhpp-headers/filelist

Francis.

FrancisMurtagh-arm avatar Oct 27 '21 12:10 FrancisMurtagh-arm

Closing due to inactivity

keidav01 avatar Oct 10 '22 10:10 keidav01