Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jiapei1001
Beginner
177 Views

undefined reference to 'ippiFilterMedian_8u_C3R'


No idea of why it is so.


I followed the building procedures in /doc/Getting_Started.htm


Building Procedures

Follow the steps below to build your application using the Intel IPP shared object finding libraries:

    • Note: You must link the ippcore functions statically (using libippcore.a)
    • Call ippStaticInitBest() instead to turn off the shared object finding feature (always uses statically linked code)
    • Calling ippStaticFree() releases the resources used by ippStaticInit(), and then calls the ippStaticInitBest() function
  • Include ipp.h, libippcore.a, and the appropriate libipp**emerged.a file(s) to your project and build tree.
  • Make sure the appropriate libipp**merged.a file(s) are in your build tree
  • Call ippStaticInit() before calling other Intel IPP functions
  • Call the Intel IPP functions required in your application source code


  • I added libippcore.a, and I succeeded in compiling my code, but failed to link.


    #include
    #include
    #include // only for direct call to ippiFilterMedian_8u_C3R!
    #include

    int main(int,char**)
    {
    IppStatus status = ippStaticInit();
    const int M=3;
    IppiSize msz={M,M}; IppiPoint ma={M/2,M/2};
    IplImage* img=cvLoadImage("/usr/local/share/opencv/samples/c/lena.jpg",1);
    IplImage* med1=cvCreateImage(cvGetSize(img),8,3);
    IplImage* med2=cvCloneImage(med1);
    int64 t0 = cvGetTickCount(),t1,t2;
    IppiSize sz = {img->width-M+1,img->height-M+1};
    double isz=1./(img->width*img->height);
    cvSmooth(img,med1,CV_MEDIAN,M); // use IPP via OpenCV interface
    t0=cvGetTickCount()-t0;
    cvUseOptimized(0); // unload IPP
    t1 = cvGetTickCount();
    cvSmooth(img,med1,CV_MEDIAN,M); // use C code
    t1=cvGetTickCount()-t1;
    t2=cvGetTickCount();
    ippiFilterMedian_8u_C3R( // use IPP directly
    &CV_IMAGE_ELEM(img,uchar,M/2,M/2*3), img->widthStep,
    &CV_IMAGE_ELEM(med1,uchar,M/2,M/2*3), med1->widthStep, sz, msz, ma );
    t2=cvGetTickCount()-t2;
    printf("t0=%.2f, t1=%.2f, t2=%.2f\n", (double)t0*isz,(double)t1*isz,(double)t2*isz);
    return 0;

    }



    Seriously have no idea which static libipp**merged.a should be added for link. I was considering why I can't dynamically link those .so files???

    Why IPP is so hard to use?


    Anyway, can anybody give me a clue?
    Thank you very much.


    Best Regards
    JIA



0 Kudos
4 Replies
Vladimir_Dudnik
Employee
177 Views

Hello,
IPP is not that hard to use if you find some time to look through documentation. IPP consist from set of libraries as you probably already noticed. So you need to link with ipps, ippi and ippcv libraries in your particular case.Additional libraries might be required depending onIPP functionality you use.
Please refer to IPP manual to find what library is needed to link for any particular function.
Regards,
Vladimir

jiapei1001
Beginner
177 Views

Wow, thank you so much for your prompt reply.

The problem is quite weird I think. Let me summarize as follows:

1) Enviroments:
Ubuntu 8.04
gcc (GCC) 4.2.4
OpenCV-cvs 2008-11-01, the most current version, which has exactly the same "cxswitcher.cpp" as downloaded here
IPP - 5.3.3.075

2) After Installation, what I've got:
All the "libipp**merged.a" under /opt/intel/ipp/5.3.3.075/ia32/lib
The ".so" like what you mentioned libipps.so, libippi.so and libippcv.so are under /opt/intel/ipp/5.3.3.075/ia32/sharedlib

3) I tried such a long time and found:
In order to make "IppStatus status = ippStaticInit();" successfully compiled and run, I need to link the static library "libippcore.a" , dynamic "libippcore.so" doesn't work at all.

4) With the static library "libippcore.a", I can make "ippiFilterMedian_8u_C3R(...)" successfully compiled as well, but never successfully linked.
No matter what ".so" files I tried to linked in, I got the error:
/usr/bin/ld: cannot find -lippi

However, I'm pretty sure IPP is already loaded.

Any further suggestions? I really need your help please.


Best Regards
JIA




Quoting - vdudnik
Hello,
IPP is not that hard to use if you find some time to look through documentation. IPP consist from set of libraries as you probably already noticed. So you need to link with ipps, ippi and ippcv libraries in your particular case.Additional libraries might be required depending onIPP functionality you use.
Please refer to IPP manual to find what library is needed to link for any particular function.
Regards,
Vladimir

jiapei1001
Beginner
177 Views

Finally, I made IPP work. It's seriously inconvenient I think.

Unlike OpenCV, just add some .so dynamic libraries for linking, it works.

For IPP, you must follow http://software.intel.com/en-us/forums/showpost.php?p=64060

I can't link the dynamic libraries, but I have to link the static ".a" libraries instead. No idea of why it is so.

Besides, the libraries should be linked according to a specific sequence as suggested in the above link. This is really inconvenient.

Anyway, it's working now. I just hope it really brings the efficiency at the cost of inconvenience.

Best Regards

JIA Pei

Vladimir_Dudnik
Employee
177 Views

Yes, that's correct. In OpenCV you have to use dynamic libraries only. This is OpenCV limitation not IPP.
Vladimir

Reply