Error in Building IPP with CMake

Error in Building IPP with CMake

Hello,
I just built IPP 7.0.7.319_ia32 as a fresh, followed by OpenCV-2.4.2. During the compilation of OpenCV, when I turned the "USE IPP" as "ON", it can automatically detect the location of IPP. Then I tried compiling one simple ipp code with CMake and it gives me this error:

=========================================
Make Error at CMakeLists.txt:8 (FIND_PACKAGE):
Could not find module FindIPP.cmake or a configuration file for package
IPP.

Adjust CMAKE_MODULE_PATH to find FindIPP.cmake or set IPP_DIR to the
directory containing a CMake configuration file for IPP. The file will
have one of the following names:

IPPConfig.cmake
ipp-config.cmake

=========================================

I run "locate IPPConfig.cmake" and "locate ipp-config.cmake" in the terminal, but it gives nothing, seems like there is no such file. My CMakeLists.txt is as follows:
=========================================
cmake_minimum_required(VERSION 2.4)

PROJECT( TestIPP)

FIND_PACKAGE( OpenCV REQUIRED )

FIND_PACKAGE (IPP REQUIRED )

if (IPP_FOUND)
add_definitions ( -DHAVE_IPP)
include_directories ( ${IPP_INCLUDE_DIRS} )
link_directories ( $ { IPP_LIBRARY_DIRS } )
set ( OPENCV_LINKER_LIBS ${OPENCV_LINKER_LIBS} ${IPP_LIBRARIES} )
endif()

ADD_EXECUTABLE( TestIPP TestIPP.c )

TARGET_LINK_LIBRARIES( TestIPP ${OpenCV_LIBS} ${IPP_SAMPLEROOT} )

=========================================

The simple test code "TestIPP.c", which is found on the internet, is as follows:

=========================================
#include "cv.h"
#include "highgui.h"
#include "ipp.h"
#include "stdio.h"

char name[] = "images/1.jpeg";

int main ()
{
Ipp8u *gray = NULL;
IppiSize size;

IplImage* img = NULL;
CvSize sizeImg;

int i=0, j=0;

size.width = 640;
size.height = 480;
gray = (Ipp8u *) ippsMalloc_8u( size.width * size.height );

for ( i=0; i< size.height; i++)
{
for (j=0; j {
*(gray+i*size.width+j)= (Ipp8u) abs (255*cos((Ipp32f) (i*j)));
}
}

sizeImg.width = size.width;
sizeImg.height = size.height;
img = cvCreateImage ( sizeImg, 8, 1 );
cvSetImageData ( img, gray, sizeImg.width );

cvNamedWindow ( "image", 0 );
cvShowImage ( "image", img) ;

cvWaitKey (0);
cvDestroyWindow ( "image" );

ippsFree ( gray );

img->imageData = NULL;
cvReleaseImage ( & img );

return ( 0 );
}

=========================================

Could someone help me explain this?
By the way, I use Ubuntu 10.04 LTS Lucid 32 bit, with CMake 2.8.0.
Many thanks in advance.
Ederman

3 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
Best Reply

Hi Ederman,

As I understand, you can use the command FIND_PACKAGE( OpenCV REQUIRED ) to find OpenCV library because OpenCV provide such config file:

OpenCVConfig.cmake.

But the command is not suitable to find other-thirdpart library, include IPPbecause OpenCVdon't provide suchrequired file.
IPPConfig.cmake
FindIPP.cmake
ipp-config.cmake

Sothe solution could be either you createsuch config files to help to find IPP.
or use same wayas OpenCV CmakeList to find IPP (not sure if it works)
The FINDIPP related config file in OpenCV is OpenCVFindIPP.cmake

and In OpenCV CmakeList.txt
if(DEFINED WITH_IPP)
if(WITH_IPP AND IPP_FOUND)
status(" Use IPP:" "${IPP_LATEST_VERSION_STR} [${IPP_LATEST_VERSION_MAJOR}.${IPP_LATEST_VERSION_MINOR}.${IPP_LATEST_VERSION_BUILD}]")
status(" at:" "${IPP_ROOT_DIR}")
else()
status(" Use IPP:" WITH_IPP AND NOT IPP_FOUND THEN "IPP not found" ELSE NO)
endif()
endif(DEFINED WITH_IPP)

But on the other hand,as you are testing IPP and havesured the IPPwas installed,to simplify the processing, the step FIND_PACKAGEseems not needed. You may just directly set IPP_INCLUDE_DIR, IPP_LIBRARY etc. to make the test passed. (as we did for buildgenernal IPP application).

Best Regards,
Ying

Dear Ying,

Thank you very much for your detailed answer. I will try it as you said with CMake.

Best wishes,
Ederman

Faça login para deixar um comentário.