Right uncluding in QT (linux mageia)

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; 
}

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

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...

It is clear that in your case a core IPP library was not included when building an executable.

Best regards,
Sergey

Ivan,

Look at the forum post (http://www.qtforum.org/article/32888/linking-libraries-in-qt-creator.htm...). 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-...)

Regards, Sergey

Thanks!!!

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".

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.

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?

>>...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?

?

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)

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

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

Take a look at a Common error messages section in the article I've provided.

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?

 

 

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 

Regards, Sergey

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.

 

 

 

 

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.

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 

Regards, Sergey

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.

 

 

 

 

 

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 

Regards, Sergey

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 :)

 

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.

Regards, Sergey

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'

 

 

 

 

 

 

 

 

 

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 

Regards, Sergey

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.

 

 

 

 

 

 

 

 

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 

Regards, Sergey

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!