MNN
MNN copied to clipboard
求助!MNN编译错误
平台(如果交叉编译请再附上交叉编译目标平台):
Platform(Include target platform as well if cross-compiling):
cmake version 3.16.3 libprotoc 3.17.3 gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
执行 cmake -DMNN_BUILD_DEMO=ON -DMNN_BUILD_CONVERTER=true .. make -j4 后报错
请在这里粘贴cmake参数或使用的cmake脚本路径以及完整输出 -- The C compiler identification is GNU 9.4.0 -- The CXX compiler identification is GNU 9.4.0 -- The ASM compiler identification is GNU -- Found assembler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done
-- 3.19.0.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS
-- Performing Test protobuf_HAVE_BUILTIN_ATOMICS - Success
-- Use Threadpool, forbid openmp
-- >>>>>>>>>>>>>
-- MNN BUILD INFO:
-- System: Linux
-- Processor: armv7l
-- Version: 2.7.2
-- Metal: OFF
-- OpenCL: OFF
-- OpenGL: OFF
-- Vulkan: OFF
-- ARM82: OFF
-- oneDNN: OFF
-- TensorRT: OFF
-- CoreML: OFF
-- NNAPI: OFF
-- CUDA: OFF
-- OpenMP: OFF
-- BF16: OFF
-- ThreadPool: ON
-- Hidden: TRUE
-- Build Path: /home/orangepi/MNN/build
-- CUDA PROFILE: OFF
-- WIN_USE_ASM:
-- Enabling AArch32 Assemblies
-- Onnx:
-- MNN Depends:MNNMNN_Express
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orangepi/MNN/build
编译日志:
In file included from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/home/orangepi/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/orangepi/MNN/source/math/Vec.hpp:300:66: note: use ‘-flax-vector-conversions’ to permit conversions between vectors with differing element types or numbers of subparts
300 | vec0.value = vsetq_lane_s64(vgetq_lane_s64(m2m3.val[0], 0), vec0.value, 1);
| ^
/home/orangepi/MNN/source/math/Vec.hpp:300:62: error: cannot convert ‘int32x4_t’ {aka ‘__vector(4) int’} to ‘int64x2_t’ {aka ‘__vector(2) long long int’}
300 | vec0.value = vsetq_lane_s64(vgetq_lane_s64(m2m3.val[0], 0), vec0.value, 1);
| ~~~~~~~~~~^
| |
| int32x4_t {aka __vector(4) int}
In file included from /home/orangepi/MNN/source/math/Vec.hpp:16,
from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/usr/lib/gcc/arm-linux-gnueabihf/9/include/arm_neon.h:6307:27: note: initializing argument 1 of ‘int64_t vgetq_lane_s64(int64x2_t, int)’
6307 | vgetq_lane_s64 (int64x2_t __a, const int __b)
| ~~~~~~~~~~^~~
In file included from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/home/orangepi/MNN/source/math/Vec.hpp:301:62: error: cannot convert ‘int32x4_t’ {aka ‘__vector(4) int’} to ‘int64x2_t’ {aka ‘__vector(2) long long int’}
301 | vec1.value = vsetq_lane_s64(vgetq_lane_s64(m2m3.val[1], 0), vec1.value, 1);
| ~~~~~~~~~~^
| |
| int32x4_t {aka __vector(4) int}
In file included from /home/orangepi/MNN/source/math/Vec.hpp:16,
from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/usr/lib/gcc/arm-linux-gnueabihf/9/include/arm_neon.h:6307:27: note: initializing argument 1 of ‘int64_t vgetq_lane_s64(int64x2_t, int)’
6307 | vgetq_lane_s64 (int64x2_t __a, const int __b)
| ~~~~~~~~~~^~~
In file included from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/home/orangepi/MNN/source/math/Vec.hpp:302:62: error: cannot convert ‘int32x4_t’ {aka ‘__vector(4) int’} to ‘int64x2_t’ {aka ‘__vector(2) long long int’}
302 | vec2.value = vsetq_lane_s64(vgetq_lane_s64(m0m1.val[0], 1), vec2.value, 0);
| ~~~~~~~~~~^
| |
| int32x4_t {aka __vector(4) int}
In file included from /home/orangepi/MNN/source/math/Vec.hpp:16,
from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/usr/lib/gcc/arm-linux-gnueabihf/9/include/arm_neon.h:6307:27: note: initializing argument 1 of ‘int64_t vgetq_lane_s64(int64x2_t, int)’
6307 | vgetq_lane_s64 (int64x2_t __a, const int __b)
| ~~~~~~~~~~^~~
In file included from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/home/orangepi/MNN/source/math/Vec.hpp:303:62: error: cannot convert ‘int32x4_t’ {aka ‘__vector(4) int’} to ‘int64x2_t’ {aka ‘__vector(2) long long int’}
303 | vec3.value = vsetq_lane_s64(vgetq_lane_s64(m0m1.val[1], 1), vec3.value, 0);
| ~~~~~~~~~~^
| |
| int32x4_t {aka __vector(4) int}
In file included from /home/orangepi/MNN/source/math/Vec.hpp:16,
from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/usr/lib/gcc/arm-linux-gnueabihf/9/include/arm_neon.h:6307:27: note: initializing argument 1 of ‘int64_t vgetq_lane_s64(int64x2_t, int)’
6307 | vgetq_lane_s64 (int64x2_t __a, const int __b)
| ~~~~~~~~~~^~~
In file included from /home/orangepi/MNN/source/backend/cpu/CPUBinary.cpp:18:
/home/orangepi/MNN/source/math/Vec.hpp: In member function ‘MNN::Math::Vec<float, 4>::VecType MNN::Math::Vec<float, 4>::operator<(const VecType&) const’:
/home/orangepi/MNN/source/math/Vec.hpp:508:51: error: could not convert ‘{vbslq_s32(res, ((int32x4_t)((const MNN::Math::Vec<float, 4>)this)->MNN::Math::Vec<float, 4>::one), ((int32x4_t)((const MNN::Math::Vec<float, 4>)this)->MNN::Math::Vec<float, 4>::zero))}’ from ‘
粘贴在这里
Paste log here or pastebin
我遇到同样的问题,请问如何解决,aarch64
vec.hpp 506行开始修改为一下内容,编译通过 VecType operator<(const VecType& lr) const { uint32x4_t res = vcltq_f32(value, lr.value); VecType dst = {reinterpret_cast<float32x4_t>(vbslq_s32(res, one, zero)) }; return dst; } VecType operator>(const VecType& lr) const { uint32x4_t res = vcgtq_f32(value, lr.value); VecType dst = {reinterpret_cast<float32x4_t>(vbslq_s32(res, one, zero)) }; return dst; } VecType operator<=(const VecType& lr) const { uint32x4_t res = vcleq_f32(value, lr.value); VecType dst = {reinterpret_cast<float32x4_t>(vbslq_s32(res, one, zero)) }; return dst; } VecType operator>=(const VecType& lr) const { uint32x4_t res = vcgeq_f32(value, lr.value); VecType dst = {reinterpret_cast<float32x4_t>(vbslq_s32(res, one, zero)) }; return dst; } VecType operator==(const VecType& lr) const { uint32x4_t res = vceqq_f32(value, lr.value); VecType dst = {reinterpret_cast<float32x4_t>(vbslq_s32(res, one, zero)) }; return dst; }
MNNGelu.S 48行修改为 fmov v30.4s, #5.0 fmov v31.4s, #-5.0
MNNGelu.S 48行修改为 fmov v30.4s, #5.0 fmov v31.4s, #-5.0
把这个修改掉吗?
我遇到同样的问题,请问如何解决,aarch64
Thank you for your reply. I tried the method you provided but did not solve the compilation failure issue. I am considering whether the CPU I am using is supported by MNN
可能和你使用的MNN代码版本不同,我使用的git clone下来的master版本
该邮件从移动设备发送
------------------ 原始邮件 ------------------ 发件人: "Xiaolong @.>; 发送时间: 2023年11月6日(星期一) 下午2:43 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [alibaba/MNN] 求助!MNN编译错误 (Issue #2638)
我遇到同样的问题,请问如何解决,aarch64
Thank you for your reply. I tried the method you provided but did not solve the compilation failure issue. I am considering whether the CPU I am using is supported by MNN
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
CMakeLists.txt 中加入这一条就行了 。add_compile_options(-flax-vector-conversions)
CMakeLists.txt 中加入这一条就行了 。add_compile_options(-flax-vector-conversions)
请问这条是加在哪里呀?我尝试加入了这个,但是并没有起作用,是不是需要加入到全局变量里?
在CMakeLists.txt文件末尾中添加以下内容:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flax-vector-conversions")
完美解决!
Marking as stale. No activity in 60 days.