Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ivan_T_1
Beginner
87 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
SKost
Valued Contributor II
66 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
Sergey_K_Intel
Employee
66 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)

Ivan_T_1
Beginner
66 Views

Thanks!!!

Ivan_T_1
Beginner
66 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".

SKost
Valued Contributor II
66 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.
Ivan_T_1
Beginner
66 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?

SKost
Valued Contributor II
66 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?
Ivan_T_1
Beginner
66 Views

?

Ivan_T_1
Beginner
66 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)

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

SKost
Valued Contributor II
66 Views

>>...g++ -Wl,-O1 -o untitled1 main.o Take a look at a Common error messages section in the article I've provided.
Oleg_M_
Beginner
66 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?

 

 

Sergey_K_Intel
Employee
66 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 

Oleg_M_
Beginner
66 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.

 

 

 

 

Oleg_M_
Beginner
66 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.

Sergey_K_Intel
Employee
66 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 

Oleg_M_
Beginner
66 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.

 

 

 

 

 

Sergey_K_Intel
Employee
66 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 

Oleg_M_
Beginner
66 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 :)

 

Sergey_K_Intel
Employee
66 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.