我想在Linux上用icc編譯OpenCV,以便用intel工具來分析執行情況。如何用ICC編譯OpenCV?
我使用默認選項安裝了icc的最新版本。我嘗試了「user」(icc安裝在我的家中)和「sudo」(icc安裝在/ opt中)安裝。國際刑事法院的版本是11.1 20090630
我也想過到源iccvars.sh,需要添加路徑PATH和LD_LIBRARY_PATH
我也嘗試過的OpenCV的幾個版本: - 主要的一個:pre1.1。配置根本不識別icc - 'latest_tested_snapshot'和'trunk'版本:icc被配置良好識別(--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
而且finnally錯誤:
/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
我的人succeded編譯OpenCV的使用ICC,讓我知道!
該庫的官方支持哪種編譯器?你是先嚐試這個嗎?我從來沒有這樣做過,但如果你想用另一個編譯器編譯它,你需要自己做一個(很難?)的工作。這兩個錯誤可能會隱藏更多的錯誤。 – 2009-08-13 13:27:48
是的,編譯器icc應該支持OpenCV。 – 2009-08-13 15:08:00