2

我正在尝试在 Linux 上使用 icc 编译 OpenCV,以便使用英特尔工具分析执行情况。

我使用默认选项安装了最新版本的 icc。我尝试了“用户”(icc 安装在我家中)和“sudo”(icc 安装在 /opt 中)安装。icc的版本是11.1 20090630

我还想获取 iccvars.sh,将所需的路径添加到 PATH 和 LD_LIBRARY_PATH

我还尝试了几个版本的 OpenCV: - 主要版本:pre1.1。configure 根本不识别 icc - 'latest_tested_snapshot' 和 'trunk' 版本: icc 被 configure 很好地识别(--enable-openmp 产生 -openmp 选项,而不是 -fopenmp)

当我制作时,一切似乎都很好,直到编译中间。然后总是有很多关于“操作员”的警告(可能有一百个)。这里有一个例子:

../include/opencv/cxcore.hpp(335): warning #597: "cv::Size_<_Tp>::operator cv::Size_<float>() const [with
_Tp=float]" will not be called for implicit or explicit conversions
      operator Size_<float>() const;
      ^
          detected during instantiation of class "cv::Size_<_Tp> [with _Tp=float]" at line 394

最后是错误:

/bin/bash ../../../libtool --tag=CXX   --mode=compile icpc -DHAVE_CONFIG_H -I. -I../../..  -I../../../include/opencv -I. -DCV_NO_BACKWARD_COMPATIBILITY  -fPIC -I/usr/include/python2.6  -g -O2 -MT _highgui_la-pyhelpers.lo -MD -MP -MF .deps/_highgui_la-pyhelpers.Tpo -c -o _highgui_la-pyhelpers.lo `test -f 'pyhelpers.cpp' || echo './'`pyhelpers.cpp
_ml.cpp(36134): error: argument of type "uchar={unsigned char} *" is incompatible with parameter of type "int *"
        result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(uchar const **)arg7); 
                                                              ^

_ml.cpp(36134): error: argument of type "const uchar={unsigned char} **" is incompatible with parameter of type "const int **"
        result = (int)(arg1)->get_ord_var_data(arg2,arg3,arg4,arg5,(float const **)arg6,(uchar const **)arg7); 
                                                                                        ^

compilation aborted for _ml.cpp (code 2)
make[4]: *** [_ml_la-_ml.lo] Erreur 1

我有人成功用 icc 编译 OpenCV,请告诉我!

4

2 回答 2

1

Ok, I finally compiled OpenCV with ICC. OpenCV is close to Intel, as Intel is highly involved in this project. Since version 1.1, OpenCV is supposed to natively support icc compiler. When you specify CC=icc in configure, there are some subtle changes as the -fopenmp (gcc style) in transformed into -openmp (icc style). However, between the release of OpenCV 1.1 (which is the latest stable) and now, icc has evolved. I think it used to compile with previous version of icc.

It comile with the latest tested version on svn: https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/tags/latest_tested_snapshot/opencv/

As the svn evolve, it could change, but at this time (27 august) it works. The warnings are still here (don't be affraid, there are a lot). Here my configure bash line:

./configure --prefix=/home/user/opencv/icc CC=icc CXX=icpc --enable-openmp --disable-apps --disable-optimization --disable-sse

I disabled optimizations and sse instructions, as it generates some conflicts with icc.

于 2009-08-27T11:57:04.887 回答
0

您的问题可能是由于使用了与用于创建该库的 ICC 不同的版本。您必须询问图书馆提供者使用哪个版本。

于 2009-08-13T21:55:26.033 回答