Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

Right uncluding in QT (linux mageia)

Ivan_T_1
Beginner
1,758 Views

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
SergeyKostrov
Valued Contributor II
1,594 Views
Hi Ivan, Please take a look at article ( and comments ): Article: How to build IPP application in Linux environment Web-link: http://software.intel.com/en-us/articles/how-to-build-ipp-application-in-linux-environment It is clear that in your case a core IPP library was not included when building an executable. Best regards, Sergey
0 Kudos
Sergey_K_Intel
Employee
1,594 Views

Ivan,

Look at the forum post (http://www.qtforum.org/article/32888/linking-libraries-in-qt-creator.html?s=68ffa6e4aa4639cbfbe3f25fee0277caf28978fb#post106006). It contains some hints regarding adding external libraries to Qt project.

Note, that IPP libraries are Visual Studio-style. The name of functions in the library files are Microsoft's "__stdcall" type, i.e. "_" added at the beginning of the name and "@<number>" is added to the end.

Regards,
Sergey

Oops, sorry! You are asking about Linux. Try this then (http://stackoverflow.com/questions/9563747/how-to-add-multiple-external-libraries-to-qt-creator-pro-ubuntu)

0 Kudos
Ivan_T_1
Beginner
1,594 Views

Thanks!!!

0 Kudos
Ivan_T_1
Beginner
1,594 Views

Hello! I have Error " undefined reference to `ippiSet_8u_C1R' ", and how i understand i have to do step 3 for solution, but:
I have problems with Step 3 (l_ipp_7.1.1.117_intel64). I found /opt/intel/ipp/bin/ippvars.sh and /opt/intel/ipp/bin/intel64/ippvars_intel64.sh but a Terminal wrote that both of them "can't open".

0 Kudos
SergeyKostrov
Valued Contributor II
1,594 Views
Hi, >>...I have Error " undefined reference to `ippiSet_8u_C1R' ", and how i understand i have to do step 3 for solution... It means, a right IPP library is still not used in your build process. >>I have problems with Step 3 (l_ipp_7.1.1.117_intel64). I found /opt/intel/ipp/bin/ippvars.sh and >>/opt/intel/ipp/bin/intel64/ippvars_intel64.sh but a Terminal wrote that both of them "can't open". It looks like Access Rights issue and it is not related to IPP.
0 Kudos
Ivan_T_1
Beginner
1,594 Views

Yes, but i had been doing this with SUDO SU. And if i am super user i I shouldn't have a problem with it? Or i am not right?

0 Kudos
SergeyKostrov
Valued Contributor II
1,594 Views
>>...And if i am super user i I shouldn't have a problem with it?.. Ivan, let's continue with IPP problems. >>...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'... Could you post a complete compiler and linker outputs, please?
0 Kudos
Ivan_T_1
Beginner
1,594 Views

?

0 Kudos
Ivan_T_1
Beginner
1,594 Views

This is what you want?

14:22:20: Выполняются этапы для проекта untitled1...

14:22:20: Настройки не изменились, этап qmake пропускается.

14:22:20: Запускается: «/usr/bin/make» -w

make: Entering directory `/home/ivan/untitled1-build-desktop-Qt_4_8_3___PATH___________________'

g++ -Wl,-O1 -o untitled1 main.o

main.o: In function `main':

main.cpp:(.text.startup+0x4f): undefined reference to `ippiSet_8u_C1R'

collect2: error: ld returned 1 exit status

make: Leaving directory `/home/ivan/untitled1-build-desktop-Qt_4_8_3___PATH___________________'

make: *** [untitled1] Error 1

14:22:20: Процесс «/usr/bin/make» завершился с кодом 2.

Возникла ошибка при сборке/установке проекта untitled1 (цель: Desktop)

Во время выполнения этапа «Сборка»

0 Kudos
SergeyKostrov
Valued Contributor II
1,594 Views
>>...g++ -Wl,-O1 -o untitled1 main.o Take a look at a Common error messages section in the article I've provided.
0 Kudos
Oleg_M_
Beginner
1,594 Views

Hello! 

I've Got nerely the same problem. I've installed Intel C++ composer for Linux. But I can't launch ipp libraries. Got the same error, found the article, provided here, but in the Common error messages it is written that I should run the gcc compiler like 

gcc -o main main.c -I <ipp install path>/em64t/include -L <ipp install path>/em64t/sharedlib -lippiem64t -lippsem64t -lippcoreem64t -liomp5 -lpthread -lm

but I haven't found neither the directories mentioned nor the libraries. Maybe this manual is for the older versions of ipp, or maybe I've installed them in a wrong way?

 

 

0 Kudos
Sergey_K_Intel
Employee
1,594 Views

Hi Oleg,

"-I " command line options should point to IPP include directory, "-L" should point to IPP library (architecture-specific) directory - i.e. ia32/intel64, depending on where you have IPP installed. By the way, "em64t" is not used since IPP 6.1. Now it is "intel64". Tell what version of Composer/IPP do you use, we'll check the documentation additionally.

Regards,
Sergey 

0 Kudos
Oleg_M_
Beginner
1,594 Views

Thank you, Sergey.

I've recently downloaded the 2013 composer and now I'm trying to work with it. I'll try launching the libraries as you recomended.

By the way, could you, please, give me a link on some manual for Intel Linux compiler, becuase I can't launch any "man" for it.

Thank you.

 

 

 

 

0 Kudos
Oleg_M_
Beginner
1,594 Views

Thank you, Sergey.

I'm using Intel Composer 2013. Thank you for mentioning the directories, but you didn't mention the files, that should be included in the "-L" section

 Thank you.

0 Kudos
Sergey_K_Intel
Employee
1,594 Views

Hi Oleg,

"-L" (upper case L) in Linux defines the library directory where the linker will search for particular libraries specified by "-l" (lower case L) option.

If I had to link my application I would specify "-L  /opt/intel/composer_xe_2013/ipp/lib/intel64".
For compiler I would set "-I /opt/intel/composer_xe_2013/ipp/include". This is because on server where I am hosted the composer is installed  in "/opt/intel/composer_xe_2013". In your case it may be different, but anyway "/ipp/include" and "/ipp/lib/intel64" tails are the same.

Regards,
Sergey 

0 Kudos
Oleg_M_
Beginner
1,594 Views

Thank you once again, but I've met another problem after using a command like this:

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

i got:

/usr/bin/ld: cannot find -l/opt/intel/composer_xe_2013.2.146/ipp/include

It's some kind of magic :) Or, maybe I don't understand something...

Thank you, anyway.

 

 

 

 

 

0 Kudos
Sergey_K_Intel
Employee
1,594 Views

This is a common problem of similarity of "-l" (lowercase L) and "-I" (uppercase i). Unfortunately they look similar. Uppercase i is an option for compiler to look for .h files. Lowercase L is an option for linker to link with specified library. For example, "-l pthread" (again, -<lowercase L> pthread :)) makes linker to link with "libpthread.a" library.

Regards,
Sergey 

0 Kudos
Oleg_M_
Beginner
1,594 Views

Exactly, I've tryed both of them :)

When I use lower "L" I get /usr/bin/ld: cannot find -l/opt/intel/composer_xe_2013.2.146/ipp/include

When i use upper "i" I get:

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

 This is where magic lives :)

 

0 Kudos
Sergey_K_Intel
Employee
1,594 Views

Then, you need to add signal processing library (IPPS) to linker command line:

  ... -l ipps_l (lowercase L)

to link to libipps_l.a (merged static single-thread library). "Merged" means all CPUs optimizations in one library. Or, you can use:

... -l ipps

to link to dynamic (libipps.so) library.

0 Kudos
Oleg_M_
Beginner
1,526 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'

 

 

 

 

 

 

 

 

 

0 Kudos
Reply