ARM-software/ComputeLibrary

Compiling error on Raspberry Pi 5:

wachhu opened this issue · 3 comments

error:assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]

Platform:Raspberry Pi 5

Operating System:Linux raspberrypi 6.1.0-rpi8-rpi-2712 #1 SMP PREEMPT Debian 1:6.1.73-1+rpt1 (2024-01-25) aarch64 GNU/Linux

Problem description:
Hi, I got this error when compiling with command scons Werror=1 -j8 debug=0 neon=1 opencl=0 os=linux arch=armv8a build=native

In file included from /usr/include/c++/12/array:43,
                 from ./arm_compute/core/Error.h:27,
                 from ./arm_compute/core/Dimensions.h:27,
                 from ./arm_compute/core/Strides.h:27,
                 from ./arm_compute/core/CoreTypes.h:27,
                 from ./arm_compute/core/Types.h:39,
                 from ./arm_compute/core/utils/helpers/tensor_transform.h:27,
                 from src/core/utils/helpers/tensor_transform.cpp:24:
In function ‘constexpr const _Tp& std::min(const _Tp&, const _Tp&) [with _Tp = int]’,
    inlined from ‘DataType arm_compute::utility::clamp(const DataType&, const DataType&, const DataType&) [with DataType = int; RangeType = int]’ at ./arm_compute/core/utils/misc/Utility.h:106:20,
    inlined from ‘int arm_compute::helpers::tensor_transform::calculate_end_on_index(arm_compute::TensorShape, int, int, arm_compute::Coordinates, arm_compute::Coordinates, int32_t, int32_t)’ at src/core/utils/helpers/tensor_transform.cpp:120:41:
/usr/include/c++/12/bits/stl_algobase.h:235:7: error: assuming signed overflow does not occur when simplifying conditional to constant [-Werror=strict-overflow]
  235 |       if (__b < __a)
      |       ^~
cc1plus: all warnings being treated as errors
scons: *** [build/src/core/utils/helpers/tensor_transform.os] Error 1

Hi @wachhu

Could you please let us know

  1. What version of ACL are you compiling?
  2. What toolchain are you using? Could you please share the output of the command g++ --version or aarch64-linux-gnu-g++ --version ?

Hi @wachhu

Could you please let us know

  1. What version of ACL are you compiling?
  2. What toolchain are you using? Could you please share the output of the command g++ --version or aarch64-linux-gnu-g++ --version ?

Hi @morgolock , I think it's v24.02. and the g++ version is:
aarch64-linux-gnu-g++ (Debian 12.2.0-14) 12.2.0

Hi @wachhu

Thanks for the details, the patch below fixes the problem and will be included in 24.04.

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

Hope this helps.