views:

675

answers:

2

I am trying to compile OpenCV with icc on Linux, in order to profile the execution with intel tools.

I installed the last version of icc with default options. I tried both "user" (icc is installed in my home) and "sudo" (icc is intalled in /opt) installs. The version of icc is 11.1 20090630

I also thought to source iccvars.sh, adding needed paths to PATH and LD_LIBRARY_PATH

I also tried several versions of OpenCV: - the main one: pre1.1. configure does not recognize icc at all - the 'latest_tested_snapshot' and the 'trunk' versions: icc is well recognized by configure (--enable-openmp produce -openmp option, and not -fopenmp)

When I make, everything seems all right until the middle of the compilation. Then come a lot of warnings (maybe a hundred) always about 'operator'. Here an example:

../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

And finnally the error:

/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

I anyone succeded to compile OpenCV with icc, let me know!

A: 

Your issue may result from using a different version from ICC used to create that library. You must ask the library provider which version to use.

yves Baumes
+1  A: 

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.

Jérôme