ubuntu 12.04 编译 openvc 2.4.2 + ipp 7.1
攒了个 i 货,据说 ipp 能提速,就重新编译openvc ,装好了 ipp 7.1
按照
参考网上帖子 比如 http://opencv.willowgarage.com/wiki/Configuration
IPP
Flag |
Description |
Default value |
IPP_PATH |
IPP_PATH-NOTFOUND |
|
USE_IPP |
OFF |
cmake -D WITH_TBB=ON -D USE_IBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
不管怎么搞 结果还是
USE IPP NO
设置了 IPP_PATH 还是不行 结果还是
USE IPP NO
最后只能看 CMakeLists.txt 和 OpenCVFindIPP.cmake 了 ,
CMakeLists.txt
124 OCV_OPTION(WITH_IPP "Include Intel IPP support" OFF IF (MSVC OR X86 OR X86_64) )
-D USE_TBB=ON 这样写就不行了 , 应该是 WITH_IPP=ON
cmake -D WITH_TBB=ON -D WITH_IPP=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON ..
改了 又报了一些错误,不管怎么样,总算有点参考信息了
看了OpenCVFindIPP.cmake 文件
IPP_PATH 这个属性有时老的,新的应该是 IPPROOT
设置 export IPPROOT=/opt/intel/composer_xe_2013.1.117/ipp/
开始重新CMAKE 又出错了
CMake Error at cmake/OpenCVFindIPP.cmake:180 (message):
IPP EM64T libraries not found
Call Stack (most recent call first):
cmake/OpenCVFindIPP.cmake:306 (set_ipp_variables)
cmake/OpenCVFindLibsPerf.cmake:13 (include)
CMakeLists.txt:362 (include)
看了下 OpenCVFindIPP 这个文件 这一段 我的版本是 7.1 的 但是这里走到了低版本
if(${_LATEST_VERSION} VERSION_LESS "7.0")
# message(STATUS "old")
# set INCLUDE and LIB folders
set(IPP_INCLUDE_DIRS ${IPP_ROOT_DIR}/include PARENT_SCOPE)
set(IPP_LIBRARY_DIRS ${IPP_ROOT_DIR}/lib PARENT_SCOPE)
if (IPP_X64)
if(NOT EXISTS ${IPP_ROOT_DIR}/../em64t)
message(SEND_ERROR "IPP EM64T libraries not found")
endif()
else()
if(NOT EXISTS ${IPP_ROOT_DIR}/../ia32)
message(SEND_ERROR "IPP IA32 libraries not found")
endif()
endif()
# set IPP_LIBRARIES variable (6.x lib names)
set_ipp_old_libraries()
set(IPP_LIBRARIES ${IPP_LIBRARIES} PARENT_SCOPE)
message(STATUS "IPP libs: ${IPP_LIBRARIES}")
改了 set(IPP_VERSION_STR "5.3.0.0") # will not detect earlier versions
这行问题解决
再cmake
错误变成了这样
CMake Error at cmake/OpenCVFindIPP.cmake:73 (string):
string sub-command REGEX, mode MATCHALL needs at least 5 arguments total to
command.
Call Stack (most recent call first):
cmake/OpenCVFindIPP.cmake:243 (get_ipp_version)
cmake/OpenCVFindLibsPerf.cmake:13 (include)
CMakeLists.txt:362 (include)
OpenCVFindIPP.cmake 的73 有又了问题
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR1 REGEX "IPP_VERSION_MAJOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR2 REGEX "IPP_VERSION_MINOR")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR3 REGEX "IPP_VERSION_BUILD")
file(STRINGS ${_ROOT_DIR}/include/ippversion.h STR4 REGEX "IPP_VERSION_STR")
# extract info and assign to variables
string(REGEX MATCHALL "[0-9]+" _MAJOR ${STR1})
string(REGEX MATCHALL "[0-9]+" _MINOR ${STR2})
string(REGEX MATCHALL "[0-9]+" _BUILD ${STR3})
IPP_VERSION_BUILD 这个东西 在 ippversion.h 没有定义
/opt/intel/composer_xe_2013.1.117/ipp/include/ippversion.h 这个文件中把
#define IPP_VERSION_BUILD 1 这行加上
终于好了。
两个细节
1,装nvidia 卡驱动后 改了 X org 文件,start lightdm 后分辨率变成了 600 * 480
删掉 /etc/X11/xorg.conf 问题解决
2,ubuntu 开机进入text 模式
vim /boot/grub/grub.cfg
quiet splash 改成 quiet splash text”。
装cuda 问题还没有解决 ,纠结中
报告 None of the NVIDIA graphics adapters were initialized! 问题
但用 optirun 跑测试程序 显卡是能驱动的 ,看来 Bumblebee 这个机制要看看啦,不能只翻帖子