Error : array subscript is above array bounds [-Werror=array-bounds] in Matrix.hpp in PX4_Matrix

Helle everybody,

I am working on a project for my internship and I need to install PX4 on my PC under Ubuntu 16.04. During the installation when I enter the command make px4_sitl gazebo I have the following errors in the Matrix.hpp file.

FAILED: /usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"local_position_estimator\" -DPX4_MAIN=local_position_estimator_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -I../../src/lib/ecl -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -std=gnu++14 -MD -MT src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/baro.cpp.o -MF src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/baro.cpp.o.d -o src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/baro.cpp.o -c ../../src/modules/local_position_estimator/sensors/baro.cpp
In file included from ../../src/lib/matrix/matrix/math.hpp:9:0,
                 from ../../src/lib/controllib/BlockDelay.hpp:53,
                 from ../../src/lib/controllib/blocks.hpp:42,
                 from ../../src/modules/local_position_estimator/sensors/../BlockLocalPositionEstimator.hpp:7,
                 from ../../src/modules/local_position_estimator/sensors/baro.cpp:1:
../../src/lib/matrix/matrix/Matrix.hpp: In function ‘bool matrix::inv(const matrix::SquareMatrix<Type, M>&, matrix::SquareMatrix<Type, M>&, size_t) [with Type = float; long unsigned int M = 1ul; size_t = long unsigned int]’:
../../src/lib/matrix/matrix/Matrix.hpp:110:21: error: array subscript is above array bounds [-Werror=array-bounds]
         return _data[i][j];
                     ^
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[20/311] Building CXX object src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/lidar.cpp.o
FAILED: /usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"local_position_estimator\" -DPX4_MAIN=local_position_estimator_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -I../../src/lib/ecl -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -std=gnu++14 -MD -MT src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/lidar.cpp.o -MF src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/lidar.cpp.o.d -o src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/lidar.cpp.o -c ../../src/modules/local_position_estimator/sensors/lidar.cpp
In file included from ../../src/lib/matrix/matrix/math.hpp:9:0,
                 from ../../src/lib/controllib/BlockDelay.hpp:53,
                 from ../../src/lib/controllib/blocks.hpp:42,
                 from ../../src/modules/local_position_estimator/sensors/../BlockLocalPositionEstimator.hpp:7,
                 from ../../src/modules/local_position_estimator/sensors/lidar.cpp:1:
../../src/lib/matrix/matrix/Matrix.hpp: In function ‘bool matrix::inv(const matrix::SquareMatrix<Type, M>&, matrix::SquareMatrix<Type, M>&, size_t) [with Type = float; long unsigned int M = 1ul; size_t = long unsigned int]’:
../../src/lib/matrix/matrix/Matrix.hpp:110:21: error: array subscript is above array bounds [-Werror=array-bounds]
         return _data[i][j];
                     ^
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[20/311] Building CXX object src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/sonar.cpp.o
FAILED: /usr/bin/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"local_position_estimator\" -DPX4_MAIN=local_position_estimator_app_main -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -I../../src/lib/ecl -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -fno-exceptions -fno-rtti -fno-threadsafe-statics -Wreorder -Wno-overloaded-virtual -std=gnu++14 -MD -MT src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/sonar.cpp.o -MF src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/sonar.cpp.o.d -o src/modules/local_position_estimator/CMakeFiles/modules__local_position_estimator.dir/sensors/sonar.cpp.o -c ../../src/modules/local_position_estimator/sensors/sonar.cpp
In file included from ../../src/lib/matrix/matrix/math.hpp:9:0,
                 from ../../src/lib/controllib/BlockDelay.hpp:53,
                 from ../../src/lib/controllib/blocks.hpp:42,
                 from ../../src/modules/local_position_estimator/sensors/../BlockLocalPositionEstimator.hpp:7,
                 from ../../src/modules/local_position_estimator/sensors/sonar.cpp:1:
../../src/lib/matrix/matrix/Matrix.hpp: In function ‘bool matrix::inv(const matrix::SquareMatrix<Type, M>&, matrix::SquareMatrix<Type, M>&, size_t) [with Type = float; long unsigned int M = 1ul; size_t = long unsigned int]’:
../../src/lib/matrix/matrix/Matrix.hpp:110:21: error: array subscript is above array bounds [-Werror=array-bounds]
         return _data[i][j];
                     ^
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[20/311] Building CXX object src/modules/navigator/CMakeFiles/modules__navigator.dir/mission.cpp.o
ninja: build stopped: subcommand failed.
Makefile:226 : la recette pour la cible « px4_sitl » a échouée
make: *** [px4_sitl] Erreur 1

I have searched many sites but no results. If anyone can help me please.

Thank you.