Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

IPP 8 legacy code sample link issue

Dear all

I am trying to build a linux speech codec program based on intel IPP 8 code samples.

My code is quite simple and only include "usc.h" and "usc_objects_decl.h"

The compile is successful, but when trying to do the link, I can't find the libspeech.a library

My question is how to static link my code with intel speech codec samples library?

I had stuck on this issue for several days, and not clues to complete the linkage job, and the code is very very important to me.

Thank you very much, Sir!

I built code samples followed by below steps:

-----------------------------------------------------------------------------------------------------------------------------

! winscp copy l_ipp_8.0.0.061.tgz to /tmp

cd /tmp
tar -zxvf l_ipp_8.0.0.061.tgz
cd l_ipp_8.0.0.061

setsebool allow_execmod on
setsebool allow_execstack on

./install.sh

setsebool allow_execmod off
setsebool allow_execstack off


source /opt/intel/ipp/bin/ippvars.sh intel64
!source /opt/intel/ipp/bin/ippvars.sh ia32

-----------------------------------------------------------------------------------------------------------------------------
! winscp copy cmake-2.8.12.1.tar.gz to /tmp
cd /tmp
tar -zxvf cmake-2.8.12.1.tar.gz
cd cmake-2.8.12.1
./bootstrap
make install

-----------------------------------------------------------------------------------------------------------------------------
!winscp copy l_ipp_8.0.0.005_legacy_samples.tgz to /tmp
cd /tmp
tar -zxvf l_ipp_8.0.0.005_legacy_samples.tgz
tar -zxvf l_ipp-speech-codecs_p_8.0.0.005.tgz

cd /tmp/ipp-samples.8.0.0.005/builder/
./build.sh --sample=speech-codecs --arch=intel64 --ws=make --ipp=static --conf=release --clean
cd /tmp/ipp-samples.8.0.0.005/__cmake/speech-codecs.intel64.make.dynamic.release
make

-----------------------------------------------------------------------------------------------------------------------------

/tmp/ipp-samples.8.0.0.005/__cmake/speech-codecs.intel64.make.static.release/__lib/release
[root@centos release]# ls -la
total 1416
drwxr-xr-x 2 root root   4096 Nov 21 03:59 .
drwxr-xr-x 3 root root   4096 Nov 21 03:57 ..
-rw-r--r-- 1 root root   4078 Nov 21 03:59 libspeech_alc.a
-rw-r--r-- 1 root root  91128 Nov 21 03:58 libspeech_amrwb.a
-rw-r--r-- 1 root root 261380 Nov 21 03:59 libspeech_amrwbe.a
-rw-r--r-- 1 root root   5470 Nov 21 03:58 libspeech_common.a
-rw-r--r-- 1 root root  76976 Nov 21 03:58 libspeech_ec.a
-rw-r--r-- 1 root root  20584 Nov 21 03:58 libspeech_g711.a
-rw-r--r-- 1 root root  36342 Nov 21 03:59 libspeech_g722.1.a
-rw-r--r-- 1 root root  26746 Nov 21 03:58 libspeech_g722.a
-rw-r--r-- 1 root root  53444 Nov 21 03:58 libspeech_g723.1.a
-rw-r--r-- 1 root root   8742 Nov 21 03:59 libspeech_g726.a
-rw-r--r-- 1 root root  57260 Nov 21 03:59 libspeech_g728.a
-rw-r--r-- 1 root root 116454 Nov 21 03:59 libspeech_g729.1.a
-rw-r--r-- 1 root root 107676 Nov 21 03:59 libspeech_g729fp.a
-rw-r--r-- 1 root root 118262 Nov 21 03:59 libspeech_g729i.a
-rw-r--r-- 1 root root 101732 Nov 21 03:59 libspeech_gsmamr.a
-rw-r--r-- 1 root root  37824 Nov 21 03:59 libspeech_gsmfr.a
-rw-r--r-- 1 root root   9070 Nov 21 03:59 libspeech_nr.a
-rw-r--r-- 1 root root  20076 Nov 21 03:58 libspeech_td.a
-rw-r--r-- 1 root root  42288 Nov 21 03:58 libspeech_vad.a
-rw-r--r-- 1 root root  74002 Nov 21 03:59 libvm.a

[root@centos release]# uname -a
Linux centos 2.6.18-371.el5 #1 SMP Tue Oct 1 08:35:08 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
 

 

 

0 Kudos
6 Replies
Highlighted
Employee
9 Views

Hi Mark,

How do you link your application? Could you show the command line?

Regards,
Sergey

0 Kudos
Highlighted
Employee
9 Views

Hi Mark,

You can link the static library as the below two test cases. .  The libspeech.a is from old versions. ( archive all of *.a into speech.a).  The 8.0 use seperate codec, thus if you need one kind of codec (i.e g729fp), you can just link one libspeech_g729fp.a.

Best Regards,
Ying

/opt/intel/composer_xe_2011_sp1.11.339/bin/intel64/icpc -Wall -O2 -fPIC  -fopenmp -i-static /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/formats.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/loadcodec.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/player.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/timing.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/usccodec.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/util.o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/obj/usc_speech_codec/wavfile.o -o /home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/bin/usc_speech_codec -L/opt/intel/composer_xe_2011_sp1.10.319/ipp/lib/intel64 -L/home/yhu5/ipp-samples/speech-codecs/_bin/intel64_icc121/lib -lspeech -lcore -lippsc -lipps -lippcore -L/opt/intel/composer_xe_2011_sp1.10.319/ipp/../compiler/lib/intel64 -liomp5 -lpthread -lc -lm

 

/usr/bin/cc  -m64  -O2 -Wall    CMakeFiles/usc_nr.dir/src/nr_exmp.c.o CMakeFiles/usc_nr.dir/src/util.c.o  -o ../../__bin/release/usc_nr  -L/opt/intel/composer_xe_2013_sp1.1.106/ipp/../compiler/lib/intel64 -rdynamic -Xlinker --start-group ../../__lib/release/libvm.a ../../__lib/release/libspeech_common.a ../../__lib/release/libspeech_amrwb.a ../../__lib/release/libspeech_g723.1.a ../../__lib/release/libspeech_g729i.a ../../__lib/release/libspeech_g729fp.a ../../__lib/release/libspeech_vad.a ../../__lib/release/libspeech_alc.a ../../__lib/release/libspeech_nr.a -Xlinker -Bstatic -lippcore -lipps -lippsc -Xlinker -Bdynamic -Xlinker --end-group -lsvml -limf -lirc -lpthread

0 Kudos
Highlighted
Beginner
9 Views

Thank you very much, Sergey and Ying!

 

0 Kudos
Highlighted
Beginner
9 Views

Hi Ying

 

I know how to link now.

 

0 Kudos
Highlighted
Employee
9 Views

Hi Mark,

It can be a workaround. There should be no object files with the same names, so this extract/combine operation should be safe.

Otherwise, you need to experiment with command line to linker "g++ -static -o ...", specifying the required libraries with "-l" option.
BTW, there's something wrong with the linker command line. It must be

g++ -static -o main main.o Packets_Processing.o codec.o -L. -l$libspeech -L $ippdir $IPPLIB

i.e. "-l" (lower L) before $libspeech. Or, add "-l" to export command.

Regards,
Sergey

 

0 Kudos
Highlighted
Beginner
9 Views

Hi Sergey

-L. followed with dir + filename ==== -L dir -l library-name

It at least works for g++.

Finally, I got my link working!

Thank you very much!

0 Kudos