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

How to statically link the threaded IPP 6.0 libraries libipp*_t.a

yellow9611
Beginner
475 Views
"gcc -m32 -o test_static_mt -DIPP_MULTITHREAD_LZO test_static.c -lippdcemerged -lippdcmerged_t -lippsemerged -lippsmerged_t -lippcore_t -liomp5 -lpthread"

How to resolve the following link errors? Thanks in advance.

/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0x577): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memset'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0x5db): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memcpy'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0x7b5): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memset'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0x82b): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memcpy'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0x984): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memset'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippdcmerged_t.a(pdclzo_split_px_ippsEncodeLZO_8u.o)(.text+0xa46): In function `ownEncodeLZO1X':
: undefined reference to `_intel_fast_memset'
/remote/vtghome1/cdhuang/intel/ipp/6.0.1.071/ia32/lib/libippsmerged_t.a(pscopyca_split_px_ownsCopy_8u.o)(.text+0x54): In function `px_ownsCopy_8u':
: undefined reference to `_intel_fast_memcpy'
collect2: ld returned 1 exit status

CPU: 2 x 2791 MHz, IntelXeon (2 socket, single core, No HT)
OS: RedHat Enterprise 3.0, Linux 2.4.21-4.ELsmp i686
gcc:
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared--enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-20)
test_static.c
#include
#include
#include
#include "ipp.h"

#define MAX_INPUT_LEN (1024 * 1024)
#define MAX_OUTPUT_LEN (MAX_INPUT_LEN + MAX_INPUT_LEN / 8 + 128 + 6)

#ifdef IPP_MULTITHREAD_LZO
#define IPP_LZO_METHOD (IppLZO1XMT)
#else
#define IPP_LZO_METHOD (IppLZO1XST)
#endif

int main(int argc, char *argv[]) {
Ipp8u *in_buf = 0;
Ipp32u in_len = MAX_INPUT_LEN;
Ipp8u *out_buf = 0;
Ipp32u out_len = MAX_OUTPUT_LEN;

Ipp32u ipp_work_mem_size = 0;
IppLZOState_8u *ipp_work_mem = 0;

in_buf = (Ipp8u *)(malloc(in_len));
memset(in_buf, 0, in_len);

out_buf = (Ipp8u *)(malloc(out_len));

ippStaticInit();

ippsEncodeLZOGetSize(IPP_LZO_METHOD, MAX_INPUT_LEN, &ipp_work_mem_size);
ipp_work_mem = (IppLZOState_8u *)(malloc(ipp_work_mem_size));
ippsEncodeLZOInit_8u(IPP_LZO_METHOD, MAX_INPUT_LEN, ipp_work_mem);

ippsEncodeLZO_8u(in_buf, in_len, out_buf, &out_len, ipp_work_mem);

fprintf(stderr, "out_len = %u\n", out_len);

free(ipp_work_mem);
free(out_buf);
free(in_buf);

return 0;
}


0 Kudos
1 Reply
Chao_Y_Intel
Moderator
475 Views
You need to add the following runtime libraries into the command line for static threaded libraries:
libimf.a libsvml.a libirc.a

For example,
-lippdcemerged -lippdcmerged_t -lippsemerged -lippsmerged_t -lippcore_t -limf -lsvml -lirc -liomp5 -lpthread

Thanks,
Chao

0 Kudos
Reply