gpt4 book ai didi

OpenCV 使用 TBB 为 ARM 配置(Ubuntu,3.0.63)

转载 作者:太空宇宙 更新时间:2023-11-03 21:47:36 25 4
gpt4 key购买 nike

我正在尝试编译具有 TBB 支持的 OpenCV 库 odroid U2 (使用四核 ARM Cortex-A9 MPCore)。我在没有 TBB 的情况下编译当前的 OpenCV(来自 github)没有问题。而且我从源代码编译 TBB 库也没有问题 - tbb41_20130116oss_src.tgz我已经成功构建了 TBB 库:

root@odroid:~/src/tbb41_20130116oss/build/linux_armv7l_gcc_cc4.6_libc2.15_kernel3.0.63_release# ls
arena.d concurrent_queue.o frontend.d libtbbmalloc.so.2 proxy.d scheduler.o task_v2.d tbb_thread.d
arena.o concurrent_queue_v2.d frontend.o libtbbmalloc_proxy.so proxy.o semaphore.d task_v2.o tbb_thread.o
backend.d concurrent_queue_v2.o governor.d libtbbmalloc_proxy.so.2 queuing_mutex.d semaphore.o tbb.def tbbmalloc.d
backend.o concurrent_vector.d governor.o market.d queuing_mutex.o spin_mutex.d tbb_function_replacement.d tbbmalloc.def
backref.d concurrent_vector.o itt_notify.d market.o queuing_rw_mutex.d spin_mutex.o tbb_function_replacement.o tbbmalloc.o
backref.o concurrent_vector_v2.d itt_notify.o mutex.d queuing_rw_mutex.o spin_rw_mutex.d tbb_main.d tbbmallocproxy.def
cache_aligned_allocator.d concurrent_vector_v2.o itt_notify_malloc.d mutex.o reader_writer_lock.d spin_rw_mutex.o tbb_main.o tbbvars.csh
cache_aligned_allocator.o condition_variable.d itt_notify_malloc.o observer_proxy.d reader_writer_lock.o spin_rw_mutex_v2.d tbb_misc.d tbbvars.sh
concurrent_hash_map.d condition_variable.o large_objects.d observer_proxy.o recursive_mutex.d spin_rw_mutex_v2.o tbb_misc.o version_string.ver
concurrent_hash_map.o critical_section.d large_objects.o pipeline.d recursive_mutex.o task.d tbb_misc_ex.d
concurrent_monitor.d critical_section.o libtbb.so pipeline.o rml_tbb.d task.o tbb_misc_ex.o
concurrent_monitor.o dynamic_link.d libtbb.so.2 private_server.d rml_tbb.o task_group_context.d tbb_statistics.d
concurrent_queue.d dynamic_link.o libtbbmalloc.so private_server.o scheduler.d task_group_context.o tbb_statistics.o
root@odroid:~/src/tbb41_20130116oss/build/linux_armv7l_gcc_cc4.6_libc2.15_kernel3.0.63_release#

我可以使用这个 TBB 库用 g++ 编译我自己的程序,但是我不能配置 OpenCV 来查看这个 TBB 库:

root@odroid:~/src/work/opencv/release# cmake -D CMAKE_BUILD_TYPE=RELEASE -D  WITH_TBB=ON -D CMAKE_INSTALL_PREFIX=/usr/local ..
-- Detected version of GNU GCC: 46 (406)
-- Found OpenEXR: /usr/lib/libIlmImf.so
-- checking for module 'gstreamer-app-0.10'
-- package 'gstreamer-app-0.10' not found
-- Looking for linux/videodev.h
-- Looking for linux/videodev.h - not found
-- Looking for linux/videodev2.h
-- Looking for linux/videodev2.h - found
-- Looking for sys/videoio.h
-- Looking for sys/videoio.h - not found
-- Looking for libavformat/avformat.h
-- Looking for libavformat/avformat.h - found
-- Looking for ffmpeg/avformat.h
-- Looking for ffmpeg/avformat.h - not found
-- checking for module 'tbb'
-- package 'tbb' not found
[...]

您能解释一下我该怎么做吗?谢谢!

最佳答案

尝试使用包含的 TBB 构建 (BUILD_TBB=true) 构建 opencv,适用于 odroid-x2:

cmake -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=/usr/local/opencv-2.4-ec15d6f383e0aae -DBUILD_TBB:BOOL="1" -DWITH_TBB:BOOL="1" ..
make -j 4

如果您执行 make install,请务必将 ./lib/libtbb.so 复制到可以找到它的某个地方,否则 opencv 只会将它留在那里。

关于OpenCV 使用 TBB 为 ARM 配置(Ubuntu,3.0.63),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14925664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com