简体   繁体   English

opencv交叉编译失败,原因是__fp16没有命名类型

[英]opencv crosscompilation failed with __fp16 does not name type

I am trying to cross compile opencv, but it fails with cvdef.h:314:5: error: '__fp16' does not name a type. 我正在尝试交叉编译opencv,但是它失败并显示cvdef.h:314:5:错误:'__fp16'未命名类型。

The cross compiler has hf support and the fp16 extension. 交叉编译器具有hf支持和fp16扩展。

... --enable-languages=c,c++ --with-cpu=cortex-a53 --with-fpu=vfpv3-fp16 --with-float=hard --with-pkgversion='crosstool-NG crosstool-ng-1.22.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath ... ... --enable-languages = c,c ++ --with-cpu = cortex-a53 --with-fpu = vfpv3-fp16 --with-float = hard --with-pkgversion ='crosstool-NG crosstool-ng -1.22.0'--enable -__ cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath ...

I have tried to set extra flags in the cmake file: 我试图在cmake文件中设置额外的标志:

set(GCC_COMPILER_VERSION "5.2.0" CACHE STRING "GCC Compiler version") set(GNU_MACHINE "arm-linux-gnueabihf" CACHE STRING "GNU compiler triple") 设置(GCC_COMPILER_VERSION“ 5.2.0”缓存字符串“ GCC编译器版本”)设置(GNU_MACHINE“ arm-linux-gnueabihf”缓存字符串“ GNU编译器三重”)

set(CMAKE_CXX_FLAGS " -mfloat-abi=hard -mfp16-format=ieee") 设置(CMAKE_CXX_FLAGS“ -mfloat-abi = hard -mfp16-format = ieee”)
set(CMAKE_C_FLAGS " -mfloat-abi=hard -mfp16-format=ieee") 设置(CMAKE_C_FLAGS“ -mfloat-abi = hard -mfp16-format = ieee”)

include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake") include(“ $ {CMAKE_CURRENT_LIST_DIR} /arm.toolchain.cmake”)

But it looks like the flags were ignored. 但是看起来这些标志被忽略了。 cmake configuration output: cmake配置输出:

-- C++ flags (Release): -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility=hidden -fvisibility-inlines-hidden -O2 -DNDEBUG -DNDEBUG -C ++标志(发布):-fsigned-char -W -Wall -Werror =返回类型-Werror =非虚拟-tor -Werror =地址-Werror =序列点-Wformat -Werror = format-security -Wmissing -声明-Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wno-narrowing -Wno-delete-non-virtual-dtor -Wno-comment -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fvisibility =隐藏-fvisibility-inlines-隐藏-O2 -DNDEBUG -DNDEBUG

thx for your help. 谢谢您的帮助。

This issue was fixed recently: https://github.com/opencv/opencv/pull/7294 这个问题最近已修复: https : //github.com/opencv/opencv/pull/7294

Please try to use the latest master branch. 请尝试使用最新的master分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM