Linking a project using IPP and MKL

Linking a project using IPP and MKL

Unfortunately I'm new to C++ compiling, and I've been thrown in at the deep end and asked to convert an Intel C++ compiled DLL on Windows into the Linux equivalent (which I believe to be a dynamically linked shared object?).

I think I have successfully altered the code so that it should compile, but it seems to be tripping up when it comes to linking. I'm getting dozens of errors in the format 'source.cpp: undefined reference to `ippsMalloc_64f' in function 'someFunction'', and ippsMalloc_64f can be replaced with ippsfree, ippsSet_64f etc...

I'm assuming that the problem lies with my arguments that I pass to the compiler. These are:

$ icpc *.cpp -I$MKLROOT/include -I$IPPROOT/include -L$IPPROOT/lib/intel64 -L$MKLROOT/lib/intel64

My environment variables: IPPROOT is /opt/intel/composer_xe_2013.5.192/ipp, and MKLROOT is /opt/intel/composer_xe_2013.5.192/mkl

O/S is Fedora 18. Each source file has #include<ipp.h> and #include<mkl.h> at the top.

What am I doing wrong, and how do I specify to output a shared object?

Thanks, and sorry for the amateur questions.
Thomas 

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

>>...I'm getting dozens of errors in the format 'source.cpp: undefined reference to `ippsMalloc_64f' in function 'someFunction''...
>>...
>>$ icpc *.cpp -I$MKLROOT/include -I$IPPROOT/include -L$IPPROOT/lib/intel64 -L$MKLROOT/lib/intel64

Since this is the error during Linking it is clear that you have Not linked some IPP libraries. Could you check $IPPROOT/lib/intel64 folder?

Hi Thomas,

You need "-l<lib_name>" (low-case L) option in your command line. This option tells Linux linker to search "lib<libname>.a" file for unresolved external references.

Look into $IPPROOT/lib/intel64 folder. ippsMalloc* (and most of ipps* functions) are part of IPPS library. If your IPP is 7.1.x you need to add
"-lipps<suffix>", where <suffix> is either blank for dynamic linking, or "_l" for static single-thread, or "_t" for static multi-thread.

Regards,
Sergey 

Regards, Sergey

in the case if you will evaluate the latest version 8.0, please take into account  the following info:

  • Intel® IPP library "_l" and "_t" suffixes removed. A new OS native convention is now implemented: Windows* static libraries now have an "mt" suffix for both single and multi-threaded libraries.
  • Threaded static and dynamic/shared libraries are now in a "threaded" subfolder.

more info about that you can find onto IPP release note page following the link:

http://software.intel.com/en-us/articles/intel-ipp-80-library-release-notes

Quote:

Sergey Kostrov wrote:

>>...I'm getting dozens of errors in the format 'source.cpp: undefined reference to `ippsMalloc_64f' in function 'someFunction''...
>>...
>>$ icpc *.cpp -I$MKLROOT/include -I$IPPROOT/include -L$IPPROOT/lib/intel64 -L$MKLROOT/lib/intel64

Since this is the error during Linking it is clear that you have Not linked some IPP libraries. Could you check $IPPROOT/lib/intel64 folder?

Quote:

Sergey Khlystov (Intel) wrote:
You need "-l<lib_name>" (low-case L) option in your command line. This option tells Linux linker to search "lib<libname>.a" file for unresolved external references.

This solved it! Using grep and the Intel Library Link Line Advisor I ended up with the command

icpc *.cpp  -I/opt/intel/composer_xe_2013.5.192/mkl/include -I/opt/intel/composer_xe_2013.5.192/ipp/include -L/opt/intel/composer_xe_2013.5.192/ipp/lib/intel64 -L/opt/intel/composer_xe_2013.5.192/mkl/lib/intel64 -lipps -lippcore -lippvm -lippm -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -lpthread -lm

No doubt I'll be back in the near future with some other amateur questions.

Thanks,
Thomas 

All libipps* libraries in the folder and I'm glad that you've managed to fix the problem. Thanks for the screenshot and update on the issue.

Login to leave a comment.