Missing libraries during build

c++   -std=c++11 -o deepspeech `pkg-config --cflags sox` -fopenmp client.cc  -Wl,--no-as-needed -Wl,-rpath,\$ORIGIN -L/home/ryanf/project-roambot/DeepSpeech/tensorflow/bazel-bin/native_client  -ldeepspeech  -Wl,-Bstatic `pkg-config --static --libs sox` -lgsm `pkg-config --static --libs libpng | cut -d' ' -f1` -lz -lmagic -lltdl -Wl,-Bdynamic -ldl
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux- gnu/libmagic.a(compress.o): in function `uncompressbuf':
(.text+0x63d): undefined reference to `lzma_auto_decoder'
/usr/bin/ld: (.text+0x6a0): undefined reference to `lzma_code'
/usr/bin/ld: (.text+0x6c1): undefined reference to `lzma_end'
/usr/bin/ld: (.text+0xa8d): undefined reference to `BZ2_bzDecompressInit'
/usr/bin/ld: (.text+0xae1): undefined reference to `BZ2_bzDecompress'
/usr/bin/ld: (.text+0xb03): undefined reference to `BZ2_bzDecompressEnd'
/usr/bin/ld: /usr/local/lib/libsox.a(libsox_la-alsa.o): in function `recover':
/home/ryanf/project-roambot/DeepSpeech/sox-14.4.2/src/alsa.c:172: undefined 
reference to `snd_strerror'
/usr/bin/ld: /home/ryanf/project-roambot/DeepSpeech/sox-14.4.2/src/alsa.c:173: 
undefined reference to `snd_pcm_resume'
/usr/bin/ld: /home/ryanf/project-roambot/DeepSpeech/sox-14.4.2/src/alsa.c:177: 
undefined reference to `snd_pcm_prepare'
/usr/bin/ld: /home/ryanf/project-roambot/DeepSpeech/sox-14.4.2/src/alsa.c:178: 
undefined reference to `snd_strerror'

I’m trying to build DeepSpeech from source, but I’m getting missing library errors. There are also FLAC, vorbis, ogg, and other errors. I tried editing the definitions.mk file to include many of the missing libraries, but it just kept going on.

I’m currently using DeepSpeech version 0.7.1, Tensorflow version 1.15 checkout, and Bazel v0.24.1. I have everything in one directory (~/project-roambot/DeepSpeech), including sox-14.4.2, which has been build with ./configure and make install with no visible errors.

Those deps are from sox, likely. Please verify your sox build, its deps, and the sox-related pkg-config setup: it is obvious you are missing linkage against lzma as well as bz2 and alsa.

Why are you building from source, what is wrong with our prebuilt packages ?

Maybe you should disable the features you don’t need in sox. Also, what is your goal? If you don’t really need sox, you might just want to change the C++ client and remove the dep if it makes your life easier.

I wanted to get more experience with building sources, and I wasn’t entirely sure how to access the DeepSpeech library with the python build from another C++ program; my goal is to use C++ to use STT in my project.
So sox isn’t required? Sorry, I’m still learning the inner workings of DeepSpeech, and I’m a bit new to TensorFlow.

It’s only used to make it easier for people when using the C++ frontend, but the library itself does not need it

libdeepspeech.so + the doc is all you need

Alright, I got the library and header installed from the native_client tarball for my architecture and it seems to be working. Thank you for your help!

1 Like