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

IPP Static Library linkage

ddavies
Beginner
835 Views
I'm fairly new to the Make/Library process, so...
I've been using IPP for a couple months, loving it, but linking to shared libraries using -L$(IPPLIB_DIR) and -lipp*em64t linux g++ options methodology.
I'm moving to a new machine and a colleague installed the IPP library, but wants me to use static libraries so I can use the code anywhere without installing all the *.so's
I can't get the g++ compiler to recognize my IPP calls. My colleague claims that I should just point -L directory to the proper place and it doesn't matter whether it's a *.so or *.a.
I've tried to follow the ipp-samples/advanced-usage/linkage/mergedlib example, but it ends up creating assembly stubs for the process I've tried using "#define IPPCALL(name) t7_##name", but get errors with 'ippsConvert_16u32f was not declared in this scope'.
What am I missing? Is there an easy way to get there?
0 Kudos
4 Replies
Pavel_B_Intel1
Employee
835 Views

You should point static libraries instead of shared libraries with full path and full names, for example:

was: -L $(IPPROOT)/sharedlib -l ippi -l ipps -l ippcore

will: $(IPPROOT)/lib/libippiemerged.a $(IPPROOT)/lib/libippimerged.a $(IPPROOT)/lib/libippsemerged.a $(IPPROOT)/lib/libippsmerged.a $(IPPROOT)/lib/libippcore.a

each ipp$ipp component have to be replaced to: libipp${ipp}emerged.a libipp${ipp}merged.a

If you want to use threaded static, than: each ipp$ipp component have to be replaced to: libipp${ipp}emerged.a libipp${ipp}merged_t.a

And very important for linker: right order of libraries (for resonving dependances): "some IPP componetnts" ippdc ippi ipps ippcore.

0 Kudos
Vinay_G_
Beginner
835 Views

Hi,

Undefined references for ippi APIs. The library is linked statically to create a .so. The so is built with UND symbols for IPPI library hence failing in build step of the test app which links the product so file. 
Sequence of linking: ${IPP_LIB_PATH}/libipps.a ${IPP_LIB_PATH}/libippi.a ${IPP_LIB_PATH}/libippcore.a 
../../../../../libaide.so: undefined reference to `y8_ippsSinOne'
../../../../../libaide.so: undefined reference to `l9_ippsSinOne'
../../../../../libaide.so: undefined reference to `m7_ippsSinOne'
../../../../../libaide.so: undefined reference to `e9_ippsFloorOne'
../../../../../libaide.so: undefined reference to `k0_ippsSinOne'
../../../../../libaide.so: undefined reference to `k0_ippsFloorOne'
../../../../../libaide.so: undefined reference to `e9_ippsSinOne'
../../../../../libaide.so: undefined reference to `n0_ippsFloorOne'
../../../../../libaide.so: undefined reference to `l9_ippsFloorOne'
../../../../../libaide.so: undefined reference to `y8_ippsFloorOne'
../../../../../libaide.so: undefined reference to `n8_ippsFloorOne'
../../../../../libaide.so: undefined reference to `m7_ippsFloorOne'
../../../../../libaide.so: undefined reference to `n0_ippsSinOne'
../../../../../libaide.so: undefined reference to `n8_ippsSinOne'
/user/unicore/i80386linux_x64/compiler/gcc4.8.2/linux3.10_64/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.2/../../../../x86_64-unknown-linux-gnu/bin/ld: link errors found, deleting executable `../../public/unix/release64/Linux/aide'

Used -z defs for removal of UND symbols but the library build fails.

0 Kudos
Pavel_B_Intel1
Employee
835 Views

Hi,

I recommend you to change the order of IPP libraries on this: 

${IPP_LIB_PATH}/libippi.a ${IPP_LIB_PATH}/libipps.a ${IPP_LIB_PATH}/libippcore.a

Linux linker is sensitive to the libraries order, ippi depends on ipps so ippi should be the first.

Pavel

0 Kudos
Vinay_G_
Beginner
835 Views

Thanks Pravel.

I added ippvm lib too and that worked. Thanks for the solution.

 

0 Kudos
Reply