错误信息
/***/MNN/source/math/Vec.hpp: In static member function ‘static void MNN::Math::Vec<int, 4>::transpose4(MNN::Math::Vec<int, 4>::VecType&, MNN::Math::Vec<int, 4>::VecType&, MNN::Math::Vec<int, 4>::VecType&, MNN::Math::Vec<int, 4>::VecType&)’:
/home/crz/MNN/source/math/Vec.hpp:298:94: note: use -flax-vector-conversions to permit conversions between vectors with differing element types or numbers of subparts
vec0.value = reinterpret_cast<int32x4_t>(vsetq_lane_s64(vgetq_lane_s64(m2m3.val[0], 0), vec0.value, 1));
^
/home/crz/MNN/source/math/Vec.hpp:298:94: error: cannot convert ‘int32x4_t {aka __vector(4) __builtin_neon_si}’ to ‘int64x2_t {aka __vector(2) __builtin_neon_di}’ for argument ‘1’ to ‘int64_t vgetq_lane_s64(int64x2_t, int)’
/home/crz/MNN/source/math/Vec.hpp:299:94: error: cannot convert ‘int32x4_t {aka __vector(4) __builtin_neon_si}’ to ‘int64x2_t {aka __vector(2) __builtin_neon_di}’ for argument ‘1’ to ‘int64_t vgetq_lane_s64(int64x2_t, int)’
解决方案
在CMakeLists.txt文件末尾中添加以下内容:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flax-vector-conversions")