- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我想使用 CMake 为 Visual Studio 2019 设置 OpenCV。在调试我的程序时完成所有这些过程后,我收到此错误:
yaabolfazl.exe 中 0x00007FFCF1FF2382 (opencv_world412d.dll) 处的未处理异常:0xC000001D:非法指令。发生了。
我认为这是由于我的处理器不支持 AVX(Windows 8.1,core i5 M520 2.4GHz)造成的。 (我对吗?)我发现我可以通过使用 CPU_DISPATCH
和 CPU_BASELINE
选项使用不支持 AVX 的 CMake 制作新版本的 OpenCV,但是当我改变它们的值时,我得到这个错误:
配置过程出错,工程文件可能无效。
那么如何在没有 AVX 支持的情况下使用 CMake 构建 OpenCV(例如,仅使用 SSE 支持)?
最佳答案
问题很可能是您的 CPU 不支持 OpenCV 使用的某些 CPU 功能(如 AVX)。我不确定在构建 OpenCV 时禁用这些功能的确切 CMake 标志是什么,但是还有另一种方法可以解决这个问题(蛮力方法 :D)。从 this link 下载 OpenCV 源代码并解压(目前最新版本是4.1.1)。转到 opencv-4.1.1\cmake 文件夹并在文本编辑器中打开 OpenCVCompilerOptimizations.cmake。它包含针对不同 CPU 架构的优化。问题中附带的屏幕截图显示了您的 CPU 支持的指令。在 OpenCVCompilerOptimizations.cmake 文件中,只需删除(或注释掉)您的 CPU 不支持的每个指令选项。这是我的版本(我只包括修改所在的文件的前半部分。将其与原始文件进行比较以查看差异):
# x86/x86-64 arch:
# SSE / SSE2 (always available on 64-bit CPUs)
# SSE3 / SSSE3
# SSE4_1 / SSE4_2 / POPCNT
# AVX / AVX2 / AVX_512F
# FMA3
#
# CPU features groups:
# AVX512_COMMON (Common instructions AVX-512F/CD for all CPUs that support AVX-512)
# AVX512_KNL (Knights Landing with AVX-512F/CD/ER/PF)
# AVX512_KNM (Knights Mill with AVX-512F/CD/ER/PF/4FMAPS/4VNNIW/VPOPCNTDQ)
# AVX512_SKX (Skylake-X with AVX-512F/CD/BW/DQ/VL)
# AVX512_CNL (Cannon Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI)
# AVX512_CEL (Cascade Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI)
# AVX512_ICL (Ice Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI/VBMI2/BITALG/VPOPCNTDQ/VPCLMULQDQ*/GFNI*/VAES*)
# ppc64le arch:
# VSX (always available on Power8)
# VSX3 (always available on Power9)
# CPU_{opt}_SUPPORTED=ON/OFF - compiler support (possibly with additional flag)
# CPU_{opt}_IMPLIES=<list>
# CPU_{opt}_FORCE=<list> - subset of "implies" list
# CPU_{opt}_GROUP=<list> - similar to "implies" list, but additionally merges compiler flags
# CPU_{opt}_FLAGS_ON=""
# CPU_{opt}_FEATURE_ALIAS - mapping to CV_CPU_* HWFeature enum
# Input variables:
# CPU_BASELINE=<list> - preferred list of baseline optimizations
# CPU_DISPATCH=<list> - preferred list of dispatched optimizations
# Advanced input variables:
# CPU_BASELINE_REQUIRE=<list> - list of required baseline optimizations
# CPU_DISPATCH_REQUIRE=<list> - list of required dispatched optimizations
# CPU_BASELINE_DISABLE=<list> - list of disabled baseline optimizations
# Output variables:
# CPU_BASELINE_FINAL=<list> - final list of enabled compiler optimizations
# CPU_DISPATCH_FINAL=<list> - final list of dispatched optimizations
#
# CPU_DISPATCH_FLAGS_${opt} - flags for source files compiled separately (<name>.avx2.cpp)
#
# CPU_{opt}_ENABLED_DEFAULT=ON/OFF - has compiler support without additional flag (CPU_BASELINE_DETECT=ON only)
set(CPU_ALL_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2")
##list(APPEND CPU_ALL_OPTIMIZATIONS "AVX512_COMMON;AVX512_KNL;AVX512_KNM;AVX512_SKX;AVX512_CNL;AVX512_CEL;AVX512_ICL")
##list(APPEND CPU_ALL_OPTIMIZATIONS NEON VFPV3 FP16)
##list(APPEND CPU_ALL_OPTIMIZATIONS VSX VSX3)
list(REMOVE_DUPLICATES CPU_ALL_OPTIMIZATIONS)
ocv_update(CPU_VFPV3_FEATURE_ALIAS "")
set(HELP_CPU_BASELINE "Specify list of enabled baseline CPU optimizations")
set(HELP_CPU_BASELINE_REQUIRE "Specify list of required baseline CPU optimizations")
set(HELP_CPU_BASELINE_DISABLE "Specify list of forbidden baseline CPU optimizations")
set(HELP_CPU_DISPATCH "Specify list of dispatched CPU optimizations")
set(HELP_CPU_DISPATCH_REQUIRE "Specify list of required dispatched CPU optimizations")
foreach(var CPU_BASELINE CPU_BASELINE_REQUIRE CPU_BASELINE_DISABLE CPU_DISPATCH CPU_DISPATCH_REQUIRE)
if(DEFINED ${var})
string(REPLACE "," ";" _list "${${var}}")
set(${var} "${_list}" CACHE STRING "${HELP_${var}}" FORCE)
endif()
endforeach()
# process legacy flags
macro(ocv_optimization_process_obsolete_option legacy_flag OPT legacy_warn)
if(DEFINED "${legacy_flag}")
if("${legacy_warn}")
message(STATUS "WARNING: Option ${legacy_flag}='${${legacy_flag}}' is deprecated and should not be used anymore")
message(STATUS " Behaviour of this option is not backward compatible")
message(STATUS " Refer to 'CPU_BASELINE'/'CPU_DISPATCH' CMake options documentation")
endif()
if("${${legacy_flag}}")
if(NOT ";${CPU_BASELINE_REQUIRE};" MATCHES ";${OPT};")
set(CPU_BASELINE_REQUIRE "${CPU_BASELINE_REQUIRE};${OPT}" CACHE STRING "${HELP_CPU_BASELINE_REQUIRE}" FORCE)
endif()
else()
if(NOT ";${CPU_BASELINE_DISABLE};" MATCHES ";${OPT};")
set(CPU_BASELINE_DISABLE "${CPU_BASELINE_DISABLE};${OPT}" CACHE STRING "${HELP_CPU_BASELINE_DISABLE}" FORCE)
endif()
endif()
endif()
endmacro()
ocv_optimization_process_obsolete_option(ENABLE_SSE SSE ON)
ocv_optimization_process_obsolete_option(ENABLE_SSE2 SSE2 ON)
ocv_optimization_process_obsolete_option(ENABLE_SSE3 SSE3 ON)
ocv_optimization_process_obsolete_option(ENABLE_SSSE3 SSSE3 ON)
ocv_optimization_process_obsolete_option(ENABLE_SSE41 SSE4_1 ON)
ocv_optimization_process_obsolete_option(ENABLE_SSE42 SSE4_2 ON)
# ocv_optimization_process_obsolete_option(ENABLE_POPCNT POPCNT ON)
# ocv_optimization_process_obsolete_option(ENABLE_AVX AVX OFF)
# ocv_optimization_process_obsolete_option(ENABLE_AVX2 AVX2 OFF)
#ocv_optimization_process_obsolete_option(ENABLE_FMA3 FMA3 ON)
# ocv_optimization_process_obsolete_option(ENABLE_VFPV3 VFPV3 OFF)
# ocv_optimization_process_obsolete_option(ENABLE_NEON NEON OFF)
# ocv_optimization_process_obsolete_option(ENABLE_VSX VSX ON)
macro(ocv_is_optimization_in_list resultvar check_opt)
set(__checked "")
set(__queue ${ARGN})
set(${resultvar} 0)
while(__queue AND NOT ${resultvar})
list(REMOVE_DUPLICATES __queue)
set(__queue_current ${__queue})
set(__queue "")
foreach(OPT ${__queue_current})
if("x${OPT}" STREQUAL "x${check_opt}")
set(${resultvar} 1)
break()
elseif(NOT ";${__checked};" MATCHES ";${OPT};")
list(APPEND __queue ${CPU_${OPT}_IMPLIES})
endif()
list(APPEND __checked ${OPT})
endforeach()
endwhile()
endmacro()
macro(ocv_is_optimization_in_force_list resultvar check_opt)
set(__checked "")
set(__queue ${ARGN})
set(${resultvar} 0)
while(__queue AND NOT ${resultvar})
list(REMOVE_DUPLICATES __queue)
set(__queue_current ${__queue})
set(__queue "")
foreach(OPT ${__queue_current})
if(OPT STREQUAL "${check_opt}")
set(${resultvar} 1)
break()
elseif(NOT ";${__checked};" MATCHES ";${OPT};")
list(APPEND __queue ${CPU_${OPT}_FORCE})
endif()
list(APPEND __checked ${OPT})
endforeach()
endwhile()
endmacro()
macro(ocv_append_optimization_flag var OPT)
if(CPU_${OPT}_FLAGS_CONFLICT)
string(REGEX REPLACE " ${CPU_${OPT}_FLAGS_CONFLICT}" "" ${var} " ${${var}} ")
string(REGEX REPLACE "^ +" "" ${var} "${${var}}")
endif()
set(${var} "${${var}} ${CPU_${OPT}_FLAGS_ON}")
endmacro()
# Support GCC -march=native or Intel Compiler -xHost flags
if(";${CPU_BASELINE};" MATCHES ";NATIVE;" OR ";${CPU_BASELINE};" MATCHES ";HOST;")
set(CPU_BASELINE_DETECT ON)
set(_add_native_flag ON)
elseif(";${CPU_BASELINE};" MATCHES ";DETECT;")
set(CPU_BASELINE_DETECT ON)
elseif(" ${CMAKE_CXX_FLAGS} " MATCHES " -march=native | -xHost | /QxHost ")
if(DEFINED CPU_BASELINE)
message(STATUS "CPU: Detected '-march=native' or '-xHost' compiler flag. Force CPU_BASELINE=DETECT.")
endif()
set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
set(CPU_BASELINE_DETECT ON)
endif()
if(X86 OR X86_64)
ocv_update(CPU_KNOWN_OPTIMIZATIONS "SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2")
# ocv_update(CPU_AVX512_COMMON_GROUP "AVX_512F;AVX_512CD")
# ocv_update(CPU_AVX512_KNL_GROUP "AVX512_COMMON;AVX512_KNL_EXTRA")
# ocv_update(CPU_AVX512_KNM_GROUP "AVX512_KNL;AVX512_KNM_EXTRA;AVX_512VPOPCNTDQ")
# ocv_update(CPU_AVX512_SKX_GROUP "AVX512_COMMON;AVX_512VL;AVX_512BW;AVX_512DQ")
# ocv_update(CPU_AVX512_CNL_GROUP "AVX512_SKX;AVX_512IFMA;AVX_512VBMI")
# ocv_update(CPU_AVX512_CEL_GROUP "AVX512_CNL;AVX_512VNNI")
# ocv_update(CPU_AVX512_ICL_GROUP "AVX512_CEL;AVX_512VBMI2;AVX_512BITALG;AVX_512VPOPCNTDQ") # ? VPCLMULQDQ, GFNI, VAES
ocv_update(CPU_SSE_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse.cpp")
ocv_update(CPU_SSE2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse2.cpp")
ocv_update(CPU_SSE3_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse3.cpp")
ocv_update(CPU_SSSE3_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_ssse3.cpp")
ocv_update(CPU_SSE4_1_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse41.cpp")
ocv_update(CPU_SSE4_2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_sse42.cpp")
# ocv_update(CPU_POPCNT_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_popcnt.cpp")
# ocv_update(CPU_AVX_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx.cpp")
# ocv_update(CPU_AVX2_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx2.cpp")
# ocv_update(CPU_FP16_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_fp16.cpp")
# ocv_update(CPU_AVX_512F_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512.cpp")
# ocv_update(CPU_AVX512_COMMON_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512common.cpp")
# ocv_update(CPU_AVX512_KNL_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512knl.cpp")
# ocv_update(CPU_AVX512_KNM_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512knm.cpp")
# ocv_update(CPU_AVX512_SKX_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512skx.cpp")
# ocv_update(CPU_AVX512_CNL_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512cnl.cpp")
# ocv_update(CPU_AVX512_CEL_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512cel.cpp")
# ocv_update(CPU_AVX512_ICL_TEST_FILE "${OpenCV_SOURCE_DIR}/cmake/checks/cpu_avx512icl.cpp")
if(NOT OPENCV_CPU_OPT_IMPLIES_IGNORE)
# ocv_update(CPU_AVX512_ICL_IMPLIES "AVX512_CEL")
# ocv_update(CPU_AVX512_CEL_IMPLIES "AVX512_CNL")
# ocv_update(CPU_AVX512_CNL_IMPLIES "AVX512_SKX")
# ocv_update(CPU_AVX512_SKX_IMPLIES "AVX512_COMMON")
# ocv_update(CPU_AVX512_KNM_IMPLIES "AVX512_KNL")
# ocv_update(CPU_AVX512_KNL_IMPLIES "AVX512_COMMON")
# ocv_update(CPU_AVX512_COMMON_IMPLIES "AVX_512F")
# ocv_update(CPU_AVX_512F_IMPLIES "AVX2")
# ocv_update(CPU_AVX_512F_FORCE "") # Don't force other optimizations
# ocv_update(CPU_AVX2_IMPLIES "AVX;FMA3;FP16")
# ocv_update(CPU_FMA3_IMPLIES "AVX2")
# ocv_update(CPU_FMA3_FORCE "") # Don't force other optimizations
# ocv_update(CPU_FP16_IMPLIES "AVX")
# ocv_update(CPU_FP16_FORCE "") # Don't force other optimizations
# ocv_update(CPU_AVX_IMPLIES "SSE4_2")
###ocv_update(CPU_SSE4_2_IMPLIES "SSE4_1;POPCNT")
ocv_update(CPU_SSE4_2_IMPLIES "SSE4_1")
ocv_update(CPU_POPCNT_IMPLIES "SSE4_1")
ocv_update(CPU_POPCNT_FORCE "") # Don't force other optimizations
ocv_update(CPU_SSE4_1_IMPLIES "SSE3;SSSE3")
ocv_update(CPU_SSSE3_IMPLIES "SSE3")
ocv_update(CPU_SSE3_IMPLIES "SSE2")
ocv_update(CPU_SSE2_IMPLIES "SSE")
endif()
if(CV_ICC)
macro(ocv_intel_compiler_optimization_option name unix_flags msvc_flags)
ocv_update(CPU_${name}_FLAGS_NAME "${name}")
if(MSVC)
set(enable_flags "${msvc_flags}")
set(flags_conflict "/arch:[^ ]*|/Qx:[^ ]+")
else()
set(enable_flags "${unix_flags}")
set(flags_conflict "-msse[^ ]*|-mssse3|-mavx[^ ]*|-march[^ ]*|-x[^ ]+")
endif()
ocv_update(CPU_${name}_FLAGS_ON "${enable_flags}")
if(flags_conflict)
ocv_update(CPU_${name}_FLAGS_CONFLICT "${flags_conflict}")
endif()
endmacro()
# ocv_intel_compiler_optimization_option(AVX2 "-march=core-avx2" "/arch:CORE-AVX2")
# ocv_intel_compiler_optimization_option(FP16 "-mavx" "/arch:AVX")
# ocv_intel_compiler_optimization_option(AVX "-mavx" "/arch:AVX")
# ocv_intel_compiler_optimization_option(FMA3 "" "")
# ocv_intel_compiler_optimization_option(POPCNT "" "")
ocv_intel_compiler_optimization_option(SSE4_2 "-msse4.2" "/arch:SSE4.2")
ocv_intel_compiler_optimization_option(SSE4_1 "-msse4.1" "/arch:SSE4.1")
ocv_intel_compiler_optimization_option(SSE3 "-msse3" "/arch:SSE3")
ocv_intel_compiler_optimization_option(SSSE3 "-mssse3" "/arch:SSSE3")
ocv_intel_compiler_optimization_option(SSE2 "-msse2" "/arch:SSE2")
if(NOT X86_64) # x64 compiler doesn't support /arch:sse
ocv_intel_compiler_optimization_option(SSE "-msse" "/arch:SSE")
endif()
# ocv_intel_compiler_optimization_option(AVX_512F "-xCOMMON-AVX512" "/Qx:COMMON-AVX512")
# ocv_intel_compiler_optimization_option(AVX512_COMMON "-xCOMMON-AVX512" "/Qx:COMMON-AVX512")
# ocv_intel_compiler_optimization_option(AVX512_KNL "-xKNL" "/Qx:KNL")
# ocv_intel_compiler_optimization_option(AVX512_KNM "-xKNM" "/Qx:KNM")
# ocv_intel_compiler_optimization_option(AVX512_SKX "-xSKYLAKE-AVX512" "/Qx:SKYLAKE-AVX512")
# ocv_intel_compiler_optimization_option(AVX512_CNL "-xCANNONLAKE" "/Qx:CANNONLAKE")
# ocv_intel_compiler_optimization_option(AVX512_CEL "-xCASCADELAKE" "/Qx:CASCADELAKE")
# ocv_intel_compiler_optimization_option(AVX512_ICL "-xICELAKE-CLIENT" "/Qx:ICELAKE-CLIENT")
elseif(CV_GCC OR CV_CLANG)
# ocv_update(CPU_AVX2_FLAGS_ON "-mavx2")
# ocv_update(CPU_FP16_FLAGS_ON "-mf16c")
# ocv_update(CPU_AVX_FLAGS_ON "-mavx")
# ocv_update(CPU_FMA3_FLAGS_ON "-mfma")
# ocv_update(CPU_POPCNT_FLAGS_ON "-mpopcnt")
ocv_update(CPU_SSE4_2_FLAGS_ON "-msse4.2")
ocv_update(CPU_SSE4_1_FLAGS_ON "-msse4.1")
ocv_update(CPU_SSE3_FLAGS_ON "-msse3")
ocv_update(CPU_SSSE3_FLAGS_ON "-mssse3")
ocv_update(CPU_SSE2_FLAGS_ON "-msse2")
ocv_update(CPU_SSE_FLAGS_ON "-msse")
# if(NOT (CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")) # GCC >= 5.0
# # ocv_update(CPU_AVX_512F_FLAGS_ON "-mavx512f")
# # ocv_update(CPU_AVX_512CD_FLAGS_ON "-mavx512cd")
# # ocv_update(CPU_AVX512_KNL_EXTRA_FLAGS_ON "-mavx512er -mavx512pf")
# # ocv_update(CPU_AVX512_KNM_EXTRA_FLAGS_ON "-mavx5124fmaps -mavx5124vnniw")
# # ocv_update(CPU_AVX_512BW_FLAGS_ON "-mavx512bw")
# # ocv_update(CPU_AVX_512DQ_FLAGS_ON "-mavx512dq")
# # ocv_update(CPU_AVX_512VL_FLAGS_ON "-mavx512vl")
# # ocv_update(CPU_AVX_512IFMA_FLAGS_ON "-mavx512ifma")
# # ocv_update(CPU_AVX_512VBMI_FLAGS_ON "-mavx512vbmi")
# # ocv_update(CPU_AVX_512VNNI_FLAGS_ON "-mavx512vnni")
# # ocv_update(CPU_AVX_512VBMI2_FLAGS_ON "-mavx512vbmi2")
# # ocv_update(CPU_AVX_512BITALG_FLAGS_ON "-mavx512bitalg")
# # ocv_update(CPU_AVX_512VPOPCNTDQ_FLAGS_ON "-mavx512vpopcntdq")
# else()
# ocv_update(CPU_AVX_512F_SUPPORTED OFF)
# endif()
elseif(MSVC)
# ocv_update(CPU_AVX2_FLAGS_ON "/arch:AVX2")
# ocv_update(CPU_AVX_FLAGS_ON "/arch:AVX")
# ocv_update(CPU_FP16_FLAGS_ON "/arch:AVX")
if(NOT MSVC64)
# 64-bit MSVC compiler uses SSE/SSE2 by default
ocv_update(CPU_SSE_FLAGS_ON "/arch:SSE")
ocv_update(CPU_SSE_SUPPORTED ON)
ocv_update(CPU_SSE2_FLAGS_ON "/arch:SSE2")
ocv_update(CPU_SSE2_SUPPORTED ON)
else()
ocv_update(CPU_SSE_SUPPORTED ON)
ocv_update(CPU_SSE2_SUPPORTED ON)
# ocv_update(CPU_AVX_512F_FLAGS_ON "/arch:AVX512")
endif()
# Other instruction sets are supported by default since MSVC 2008 at least
else()
message(WARNING "TODO: Unsupported compiler")
endif()
# if(NOT DEFINED CPU_DISPATCH)
# if(X86_64)
# set(CPU_DISPATCH "SSE4_1;SSE4_2;AVX;FP16;AVX2;AVX512_SKX" CACHE STRING "${HELP_CPU_DISPATCH}")
# else()
# set(CPU_DISPATCH "SSE4_1;SSE4_2;AVX;FP16" CACHE STRING "${HELP_CPU_DISPATCH}")
# endif()
# endif()
if(NOT DEFINED CPU_BASELINE)
if(APPLE)
# MacOS X has limited set of possible supported H/W, so compiler is configured well
set(CPU_BASELINE "DETECT" CACHE STRING "${HELP_CPU_BASELINE}")
elseif(X86_64)
set(CPU_BASELINE "SSE3" CACHE STRING "${HELP_CPU_BASELINE}")
else()
set(CPU_BASELINE "SSE2" CACHE STRING "${HELP_CPU_BASELINE}")
endif()
endif()
之后,您只需使用 CMake 构建 OpenCV。这是我的做法:
执行以下命令(我已禁用构建示例和测试,因为其中一些会失败)(不要忘记命令末尾的 ..!)(对于 Visual Studio 2019 替换 “Visual Studio 15 2017” 与 “Visual Studio 16 2019”):
cmake -D ENABLE_AVX=OFF -D ENABLE_AVX2=OFF -D BUILD_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -G "Visual Studio 15 2017"..
CMake 完成生成项目后,使用 Visual Studio 打开构建文件夹中的解决方案文件 (OpenCV.sln)
构建ALL_BUILD项目
一个项目会失败。如果您查看错误,它会显示类似'CV_CPU_HAS_SUPPORT_AVX512_SKX': undeclared identifier 只需将代码中的关键字 CV_CPU_HAS_SUPPORT_AVX512_SKX 替换为 false(它显示整个解决方案中的 3 次,替换所有 3) 并再次点击 build on ALL_BUILD
构建INSTALL 项目。它将在我们的构建文件夹中创建一个名为 install 的文件夹。
使用项目中 install 文件夹中新构建的 OpenCV 库、二进制文件和包含项,它应该可以工作。
关于c++ - 使用 cmake 制作一个没有 sse 支持的库(windows 版本),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58007793/
Java 库和 android 库有什么区别,各自有什么优点/缺点? 最佳答案 您可以在 Android 应用程序中包含标准 Java .jar 文件库。它们在 .apk 构建时被翻译成 Dalvik
所以,我现在的代码就像从 Java 层加载库(比如 liba.so),并在内部 liba.so 加载 libb.so。因此,如果我必须将所有库打包到 APK 中并将其安装在没有 root 访问权限的设
我想在我的系统中设置 LEDA 库。 我已经从以下链接下载了 LEDA 库 http://www.algorithmic-solutions.info/free/d5.php Instruct
我想用 autoconf 创建一个共享库。但是,我希望共享库具有“.so”扩展名,而不是以“lib”开头。基本上,我想制作一个加载 dlopen 的插件。 .是否有捷径可寻? 当我尝试使用 autoc
我需要在 Apps 脚本应用程序上修改 PDF。为此,我想使用 JS 库:PDF-LIB 我的代码: eval(UrlFetchApp.fetch("https://unpkg.com/pdf-lib
我正在构建一个使用以下 Boost header 的程序(我使用的是 Microsoft Visual C++ 10), #include #include #include #include
当我通过 cygwin 在 hadoop 上运行此命令时: $bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+' 我
我已经通过 vcpgk 成功安装了一个 C++ 库,名为:lmdb:x64-windows 我还安装了lmdb通过 Cabal 安装的 Haskell 绑定(bind)包 在尝试测试 lmdb 包时:
我该如何解决这个问题? 我刚刚将 javacv jar 文件复制到我的项目 Lib 文件夹下,但出现了这个错误! 我可以找到这个thread来自谷歌,但不幸的是,由于我国的谷歌限制政策,该页面无法打开
我有一个 Android 库项目 FooLib。 FooLib 引用 Android Context 之类的东西,但不需要任何资源文件(res/ 中的东西)所以我目前将其打包为供我的应用使用的 JAR
我正在开发一个 Android 应用程序(使用 Android Studio),它能够通过手势识别算法了解您正在进行的 Activity 。对于我使用 nickgillian ithub 帐户上可用的
关于从 .NET Framework 项目中引用 .NET Standard 类库的问题有很多类似的问题,其中 netstandard 库中的 NuGet 包依赖项不会流向 netframework
我已经从互联网上下载了 jna-4.2.2.jar,现在想将这个 jar 导入到我的项目中。但是当我试图将这个 jar 导入我的项目时,出现以下错误。 [2016-06-20 09:35:01 - F
我正在尝试通过编译在 Mac 上安装 rsync 3.2.3。但是,我想安装所有功能。为此,它需要一些库,此处 ( https://download.samba.org/pub/rsync/INSTA
进入 Web 开发有点困难。过去 5 年我一直致力于 winforms 工作。所以我正在努力从一种切换到另一种。前段时间,我使用过 JavaScript,但现在还没有大量的 JavaScript 库
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 1
我正在寻找一个用Python编写的与logstash(ruby + java)类似的工具/库。 我的目标是: 从 syslog 中解析所有系统日志 解析应用程序特定日志(apache、django、m
就目前情况而言,这个问题不太适合我们的问答形式。我们希望答案得到事实、引用资料或专业知识的支持,但这个问题可能会引发辩论、争论、民意调查或扩展讨论。如果您觉得这个问题可以改进并可能重新开放,visit
我花了几天时间试图寻找用于 JavaPOS 实现的 .jar 库,但我找不到任何可以工作的东西。我找到了很多像这样的文档:http://jpos.1045706.n5.nabble.com/file/
这个问题在这里已经有了答案: Merge multiple .so shared libraries (2 个答案) 关闭 9 年前。 我有我在代码中使用的第三方库的源代码和对象。该库附带有关如何使
我是一名优秀的程序员,十分优秀!