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

Static Link Is Failing

astrasel
Beginner
393 Views

I'm trying to link statically on Linux with v5.3 of IPP. We have a C++ object called SPXToolboxIPP that calls IPP functions. This is an enviornment that links fine when I link with the dynamic libraries (in 'sharedlib'), now I'm trying to link with the libraries in 'lib'. With lib I get many, many linker resolution errors, a sample follows:

../SPXIntel/Debug/libSPXIntel.a(SPXToolboxIPP.o): In function `SPXToolboxIPP::mtranspose(cfloat32*, cfloat32*, unsigned int, unsigned int)':
/home/spxuser/svn/spxc/SPXIntel/SPXToolboxIPP.cpp:2599: undefined reference to `ippmTranspose_m_32f'
/home/spxuser/svn/spxc/SPXIntel/SPXToolboxIPP.cpp:2602: undefined reference to `ippmTranspose_m_32f'
../SPXIntel/Debug/libSPXIntel.a(SPXToolboxIPP.o): In function `SPXToolboxIPP::mmult(float*, unsigned int, unsigned int, float*, unsigned int, unsigned int, float*)':
/home/spxuser/svn/spxc/SPXIntel/SPXToolboxIPP.cpp:2583: undefined reference to `ippmMul_mm_32f'
../SPXIntel/Debug/libSPXIntel.a(SPXToolboxIPP.o): In function `SPXToolboxIPP::szero(cfloat32*, unsigned int)':
/home/spxuser/svn/spxc/SPXIntel/SPXToolboxIPP.cpp:2569: undefined reference to `ippsZero_32fc'


This is what I use in our make file when linking dynamically (which works):

EXTRALIBS = -lippacem64t -lippchem64t -lippsem64t -lippvmem64t -lippmem64t -lguide -lippsrem64t -lippcoreem64t -lpthread
EXTRALIBDIR = -L$(IPPROOT)/sharedlib

This is what I use to link statically (which does not work - linker errors, tried to make it work by including just about every IPP library):
EXTRALIBS = -lippacemergedem64t -lippacmergedem64t -lippccemergedem64t -lippccmergedem64t -lippchemergedem64t -lippchmergedem64t -lippcvemergedem64t -lippcvmergedem64t -lippdcemergedem64t -lippdcmergedem64t -lippiemergedem64t -lippimergedem64t -lippjemergedem64t -lippjmergedem64t -lippmemergedem64t -lippmmergedem64t -lippremergedem64t -lipprmergedem64t -lippscemergedem64t -lippscmergedem64t -lippsemergedem64t -lippsmergedem64t -lippsremergedem64t -lippsrmergedem64t -lippvcemergedem64t -lippvcmergedem64t -lippvmemergedem64t -lippvmmergedem64t -lippcoreem64t -lpthread
EXTRALIBDIR = -L$(IPPROOT)/lib

This is the static link command line:
g++ -L/opt/intel/ipp/5.3.4.080/em64t/lib -o Proc Proc.o -lippacemergedem64t -lippacmergedem64t -lippccemergedem64t -lippccmergedem64t -lippchemergedem64t -ippchmergedem64t -lippcvemergedem64t -lippcvmergedem64t -lippdcemergedem64t -lippdcmergedem64t -lippiemergedem64t -lippimergedem64t -lippjemergedem64t -lippjmergedem64t -lippmemergedem64t -lippmmergedem64t -lippremergedem64t -lipprmergedem64t -lippscemergedem64t -lippscmergedem64t -lippsemergedem64t -lippsmergedem64t -lippsremergedem64t -lippsrmergedem64t -lippvcemergedem64t -lippvcmergedem64t -lippvmemergedem64t -lippvmmergedem64t -lippcoreem64t -lpthread -lrt

This is the first time I've tried to link IPP statically on Linux. I have linked both dynamically and staticly on Windows.

I believe I'm including the correct libraries in the link command. Is list a Linux library link order issue? (does that even still exist?) Is it a C++ issue? (function naming issue?)

Update: I was able to replicate this issue (failing to link) on other Linux platforms using both IPP 5.3 and the new 6.0 - I'm curious why the same approach works on Windows but not on Linux?

I believe I'm doing everything the documentation says for this and could use some help here!

0 Kudos
3 Replies
Vladimir_Dudnik
Employee
393 Views
Hello,
it seems like library order issue (yes it still exist on Linux).
You may take a look at IPP JPEGView sample to see what is the right order. The samplelink shared libraries by default but also might be linked with static libraries (you need to specify LINKAGE=static in build script.
Regards,
Vladimir

0 Kudos
astrasel
Beginner
393 Views
Turned out is was a library link order issue - it was immediately obvious because I was already linking successfully with the shared libaries. Why hasn't this been fixed in the Linux world? I don't believe it is an issue with Windows compilers (?)

0 Kudos
Vladimir_Dudnik
Employee
393 Views

Yes, on Windows, libraries order does not matter because of two-pass linker.

0 Kudos
Reply