Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ivan_T_1
Beginner
88 Views

Right uncluding in QT (linux mageia)

Hello. 
I downloaded "l_ipp_7.1.1.117_intel64". I installed them. But when i tried to used this library with example from "User's Guide" - "Building your first application" - i had Errors: undefined reference to 'ipplnit', 'ippiGetLibVersion', 'ippGetEnableCpuFeatures'. 
I did this in QT qreator 2.6.0. How i could include libraries right? 

P.S. Sorry for my poor english and knowlege.


#include "ipp.h" 
#include <stdio.h> 
int main(int argc, char* argv[]) 

const IppLibraryVersion *lib; 
Ipp64u fm; 
ippInit(); 
//Automatic best static dispatch 
//ippInitCpu(ippCpuSSSE3); 
//Select a specific static library level 
//Can be useful for debugging/profiling 
//Get version info 
lib = ippiGetLibVersion(); 
printf("%s %s\n", lib->Name, lib->Version); 
//Get CPU features enabled with selected library level 
fm=ippGetEnabledCpuFeatures(); 
printf("SSE2 %c\n",(fm>>2)&1?'Y':'N'); 
printf("SSE3 %c\n",(fm>>3)&1?'Y':'N'); 
printf("SSSE3 %c\n",(fm>>4)&1?'Y':'N'); 
printf("SSE41 %c\n",(fm>>6)&1?'Y':'N'); 
printf("SSE42 %c\n",(fm>>7)&1?'Y':'N'); 
printf("AVX %c OS Enabled %c\n", (fm>>8)&1 ?'Y':'N', (fm>>9)&1 ?'Y':'N'); 
printf("AES %c CLMUL %c\n", (fm>>10)&1?'Y':'N', (fm>>11)&1?'Y':'N'); 
return 0; 
}

0 Kudos
23 Replies
Oleg_M_
Beginner
23 Views

As I understand, I need to write something like this:

g++ main.cpp -o main -I(i) /opt/intel/composer_xe_2013.2.146/ipp/include -l(L) ipps -L /opt/intel/composer_xe_2013.2.146/ipp/lib/intel64

or

g++ main.cpp -o main -I(i) /opt/intel/composer_xe_2013.2.146/ipp/include -l(L) ipps_l -L /opt/intel/composer_xe_2013.2.146/ipp/lib/intel64

Then the first choice gives:

/usr/bin/ld: warning: libippcore.so.7.1, needed by /opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: warning: libiomp5.so, needed by /opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so, not found (try using -rpath or -rpath-link)
/tmp/ccKkNyWo.o: In function `main':
main.cpp:(.text+0x6b): undefined reference to `ippiSet_8u_C1R'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ownRegisterLib'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippMessageCatalogOpenI18n'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippIsCpuEnabled'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippGetMessageStatusI18n'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippMessageCatalogCloseI18n'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippSetCpuFeaturesMask'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ippGetCpuFeatures'
/opt/intel/composer_xe_2013.2.146/ipp/lib/intel64/libipps.so: undefined reference to `ownUnregisterLib'

And the second one:

/tmp/ccmI0RSZ.o: In function `main':
main.cpp:(.text+0x6b): undefined reference to `ippiSet_8u_C1R'

 

 

 

 

 

 

 

 

 

Sergey_K_Intel
Employee
23 Views

The first case requires ippcore library (libippcore*), the second asks for ippi (image processing) library. Try to add all libraries required by functions used. Look at the docs.

Regards,
Sergey 

Oleg_M_
Beginner
23 Views

Thank you once again, Sergey.

I've finally compiled a test program with the following command:

g++ main.cpp -o main -I /opt/intel/composer_xe_2013.2.146/ipp/include -l ipps_l -l ippi_l -l ippcore_l -L /opt/intel/composer_xe_2013.2.146/ipp/lib/intel64

Does it look correct?

And i still have some qestions:

You told, that it is possible to do the same, using dynamic libraries. How should I rewrite the command to do so?

And also, would it be simplier to use the native intel compiler for the same task? I guess, there should be some kinds of special commands for intel compiler, which would be much simplier to use with ipp? Am I right? And would you be so kind to show me the right usage of it? Or at least, could you give me a link on an Intel compiler user manual? :)

And thank you once again.

 

 

 

 

 

 

 

 

Sergey_K_Intel
Employee
23 Views

Hi Oleg,

I cannot say exactly if the command looks correct, because it depends on set of IPP function you use. It's ok for most image processing-related tasks. To link IPP library dynamically you should omit "_l" suffices in library names. Dynamic stub libraries have no suffix. For example, libippcore.a, libipps.a and so on. To start application linked dynamically to IPP you need to set LD_LIBRARY_PATH environment variable so, that it includes IPP dynamic objects directory too. That directory which contains libipp*.so files. According to your architecture of course. Do not mix ia32 and intel64.

Regarding if it is easier to use Intel compiler to build application, I don't know. I am not good in Linux and never had Linux with Intel Composer installed locally. Again, there can be some hints in Composer docs.

Regards,
Sergey