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

Having trouble linking to IPP on Linux

lkeene
Beginner
286 Views
Hi folks.

I'm trying to compile my project with ICC 11.1 and IPP (aka Compiler Suite Pro) from the command line in Linux but am having a hell-of-a-time getting it to link properly to the IPP *.a files. I've been successful doing this on my Windows machine using VS2008, but I ran into trouble when I moved over to Linux and ICC command line mode.

When I compile my project I get a bunch of compiler errors all like "undefined reference to 'ippsSVD_64f_D2'", "undefined reference to 'ippmTranspose_64f;", etc. To try to remedy these errors I've done the following:

1) "export LD_LIBRARY_PATH=/opt/intel/Compiler/11.1/059/ipp/ia32/sharedlib:$LD_LIBRARY_PATH" in command line.

2) Adding the following to the compiler invocation statement:

"-L/opt/intel/Compiler/11.1/059/ipp/ia32/lib libippsemerged.a libippsmerged.a libippsremerged.a libippsrmerged.a libippmemerged.a libippmmerged.a libippcore.a"


Upon compiling I get several errors of the following:
"icpc: error #10236: File not found: 'libippsemerged.a'"
"icpc: error #10236: File not found: 'libippsmerged.a'"
.
.
etc


I've checked and these files are in fact contained in the specified directory. What am I doing wrong? Thank you in advance,
-L




0 Kudos
6 Replies
lkeene
Beginner
286 Views
Quoting - lkeene
Hi folks.

I'm trying to compile my project with ICC 11.1 and IPP (aka Compiler Suite Pro) from the command line in Linux but am having a hell-of-a-time getting it to link properly to the IPP *.a files. I've been successful doing this on my Windows machine using VS2008, but I ran into trouble when I moved over to Linux and ICC command line mode.

When I compile my project I get a bunch of compiler errors all like "undefined reference to 'ippsSVD_64f_D2'", "undefined reference to 'ippmTranspose_64f;", etc. To try to remedy these errors I've done the following:

1) "export LD_LIBRARY_PATH=/opt/intel/Compiler/11.1/059/ipp/ia32/sharedlib:$LD_LIBRARY_PATH" in command line.

2) Adding the following to the compiler invocation statement:

"-L/opt/intel/Compiler/11.1/059/ipp/ia32/lib libippsemerged.a libippsmerged.a libippsremerged.a libippsrmerged.a libippmemerged.a libippmmerged.a libippcore.a"


Upon compiling I get several errors of the following:
"icpc: error #10236: File not found: 'libippsemerged.a'"
"icpc: error #10236: File not found: 'libippsmerged.a'"
.
.
etc


I've checked and these files are in fact contained in the specified directory. What am I doing wrong? Thank you in advance,
-L





I've made some progress by getting rid of the "-L/..." option (which I don't think I was using properly) and have instead listed the entire path prior to each lib file as in:

"/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsemerged.a /opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsmerged.a /opt/etc..."

I no longer get the "Cannot find file" errors, but now I'm getting errors of the following:

"/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsrmerged.a(ippssvd_split_g9_ippsSVD_64f_D2_I.o): In function 'g9_ippsSVD_64f_D2_I':
ippssvd_split_g9_ippsSVD_64f_D2_I.i:(text+0x6e): undefined reference to 'g9_ipp_sMalloc_64f'
ippssvd_split_g9_ippsSVD_64f_D2_I.i:(.text+0x134d): undefined reference to 'g9_ippsFree'
etc...

Anyone have any ideas what could be the problem? As always, thanks.
-L
0 Kudos
lkeene
Beginner
286 Views


Is there no one who knows the answer to this problem? We've purchased the product but cannot get started using it! I've also posted in the compiler forum and no one has answered there either...an ominous sign indeed. :-(

-L


0 Kudos
Ying_H_Intel
Employee
286 Views
Quoting - lkeene


Is there no one who knows the answer to this problem? We've purchased the product but cannot get started using it! I've also posted in the compiler forum and no one has answered there either...an ominous sign indeed. :-(

-L



Hi -L,

You may try the link line as
"/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsremerged.a /opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsrmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmemerged.a /opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsemerged.a /opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippcore.a"

(or -L/opt/intel/Compiler/11.1/059/ipp/ia32/lib -lippsremerged -lippsrmerged -lippmemerged -lippmmerged -lippsemerged -lippsmerged -lippcore)
and see if it work?


In linux, the linker is one time linker, so the order of linked library is essential.
Thereferences like ippsMallocippsFreeare defined in ippsemerged.a. So in general, we put ippsemerged.a ippsmerged.a at the end.

Here issome articles in IPP KB talking about the library dependency and how tobuild IPP applicationin linux for your reference.
http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-library-dependencies-by-domain/

http://software.intel.com/en-us/articles/how-to-build-ipp-application/

Best Wishes,
Ying
0 Kudos
lkeene
Beginner
286 Views

Hi Ying, thanks for the reply!

Unfortunately, I am still getting the same errors even with your revised ordering. Here is what I'm entering at the command line (see if anything jumps out at you):

icpc -openmp -I/usr/local/itt/idl71/external
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsremerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsrmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmemerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsemerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippcore.a -fPIC -o CosiCorrDll.so -dynamiclib Correlator.cpp CosiCorrDll.cppFrequencyCorrelator.cpp IDL_Load.cpp NLMFilter.cpp
StaticSincResampler.cpp StatisticalCorrelator.cpp


Below is the (partial) error list:

/tmp/icpczoSpRO.o: In function `CNLMFilter::FloatFilter_SNR()':
NLMFilter.cpp:(.text+0x2eb8): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0x2fc0): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0x2ffa): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x3034): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x306a): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0x3259): undefined reference to `ippsSVD_64f_D2'
/tmp/icpczoSpRO.o: In function `CNLMFilter::FloatFilter()':
NLMFilter.cpp:(.text+0x4a99): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0x4ba1): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0x4bd6): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x4c0b): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x4c35): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0x4df9): undefined reference to `ippsSVD_64f_D2'
/tmp/icpczoSpRO.o: In function `CNLMFilter::DoubleFilter_SNR()':
NLMFilter.cpp:(.text+0x6b8a): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0x6c92): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0x6ccc): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x6d06): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x6d3c): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0x6f44): undefined reference to `ippsSVD_64f_D2'
/tmp/icpczoSpRO.o: In function `CNLMFilter::DoubleFilter()':
NLMFilter.cpp:(.text+0x87a3): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0x88ab): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0x88e0): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x8915): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0x893f): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0x8b15): undefined reference to `ippsSVD_64f_D2'
/tmp/icpczoSpRO.o: In function `CNLMFilter::ByteFilter()':
NLMFilter.cpp:(.text+0xa0b3): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0xa1b8): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0xa1f2): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0xa22c): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0xa262): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0xa72a): undefined reference to `ippsSVD_64f_D2'
/tmp/icpczoSpRO.o: In function `CNLMFilter::ShortFilter()':
NLMFilter.cpp:(.text+0xbdd4): undefined reference to `ippsSVD_64f_D2'
NLMFilter.cpp:(.text+0xbedc): undefined reference to `ippmTranspose_m_64f'
NLMFilter.cpp:(.text+0xbf16): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0xbf50): undefined reference to `ippmMul_mm_64f'
NLMFilter.cpp:(.text+0xbf86): undefined reference to `ippmMul_mv_64f'
NLMFilter.cpp:(.text+0xc46c): undefined reference to `ippsSVD_64f_D2'

Any ideas? As always, thanks.
-L
0 Kudos
Ying_H_Intel
Employee
286 Views

Hi L,

It seems stillthe order problem of linker. It resolvethe symbols by scan the obj, libraries only one time.
If put the NLMFilter.cpp at the end (before the libraries), then the symbols in it won'tbe resolved. In general, we put library at the end of command.

You may try the command
>icpc -openmp -I/usr/local/itt/idl71/external
-fPIC -o CosiCorrDll.so -dynamiclib Correlator.cpp CosiCorrDll.cppFrequencyCorrelator.cpp IDL_Load.cpp NLMFilter.cpp StaticSincResampler.cpp StatisticalCorrelator.cpp
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsremerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsrmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmemerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippmmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsemerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippsmerged.a
/opt/intel/Compiler/11.1/059/ipp/ia32/lib/libippcore.a
and see if there is somechange.

Regards,
Ying
0 Kudos
lkeene
Beginner
286 Views

That worked! The errors are gone. Thank you very much for the help Ying.

-L
0 Kudos
Reply