opencv 交叉编译失败 __fp16 没有命名类型
opencv crosscompilation failed with __fp16 does not name type
我正在尝试交叉编译 opencv,但失败并显示 cvdef.h:314:5: error: '__fp16' does not name a type.
交叉编译器支持 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 ...
我尝试在 cmake 文件中设置额外的标志:
set(GCC_COMPILER_VERSION "5.2.0" CACHE STRING "GCC Compiler version")
set(GNU_MACHINE "arm-linux-gnueabihf" CACHE STRING "GNU compiler
triple")
set(CMAKE_CXX_FLAGS " -mfloat-abi=hard -mfp16-format=ieee")
set(CMAKE_C_FLAGS " -mfloat-abi=hard -mfp16-format=ieee")
include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
但看起来这些标志被忽略了。
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
谢谢你的帮助。
此问题最近已修复:https://github.com/opencv/opencv/pull/7294
请尝试使用最新的master分支
我正在尝试交叉编译 opencv,但失败并显示 cvdef.h:314:5: error: '__fp16' does not name a type.
交叉编译器支持 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 ...
我尝试在 cmake 文件中设置额外的标志:
set(GCC_COMPILER_VERSION "5.2.0" CACHE STRING "GCC Compiler version") set(GNU_MACHINE "arm-linux-gnueabihf" CACHE STRING "GNU compiler triple")
set(CMAKE_CXX_FLAGS " -mfloat-abi=hard -mfp16-format=ieee")
set(CMAKE_C_FLAGS " -mfloat-abi=hard -mfp16-format=ieee")include("${CMAKE_CURRENT_LIST_DIR}/arm.toolchain.cmake")
但看起来这些标志被忽略了。 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
谢谢你的帮助。
此问题最近已修复:https://github.com/opencv/opencv/pull/7294
请尝试使用最新的master分支