unispeech / unimrcp

Open source cross-platform implementation of MRCP protocol

Home Page:http://www.unimrcp.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/usr/local/unimrcp/bin/unimrcpserver: error while loading shared libraries: libsofia-sip-ua.so.0: cannot open shared object file: No such file or directory

evandrocoan opened this issue · comments

Created this docker file to run the example server:

FROM debian:9
LABEL purpose="Image for building/running mrcp server"

RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    automake \
    binutils \
    cmake \
    gcc \
    curl \
    zlib1g-dev \
    libssl-dev \
    libreadline6-dev \
    libbz2-dev \
    libsqlite3-dev \
    g++ \
    git \
    libexpat1-dev \
    sed \
    pkg-config \
    libpcre3-dev \
    libtool \
    libusb-1.0-0-dev \
    libusb-dev \
    libuuid1 \
    uuid-dev \
    make \
    python3 \
    python3-dev \
    python3-pip \
    wget \
    openssh-server \
    gdb \
    gdbserver \
    vim \
    && rm -rf /var/lib/apt/lists/*

RUN wget http://www.unimrcp.org/project/release-view/unimrcp-1-7-0-tar-gz/download \
    && tar -xzf download \
    && rm download \
    && wget http://www.unimrcp.org/project/release-view/unimrcp-deps-1-6-0-tar-gz/download \
    && tar -xzf download \
    && rm download \
    && cd unimrcp-deps-1.6.0 \
    && sed -i 's/sudo make install/make install/g' build-dep-libs.sh \
    && ./build-dep-libs.sh -s \
    && cd .. \
    && cd unimrcp-1.7.0 \
    && ./configure \
    && make \
    && make install

ENV TZ="America/Sao_Paulo"

CMD ["/usr/local/unimrcp/bin/unimrcpserver -r /opt/unimrcp -o 2 -w"]

But after building it, the server cannot find the libsofia library:

111 23:38:05 username@computer:/$ docker run \
>     --name unimrcpbuilderrunning \
>     --net=host \
>     --privileged=true \
>     -it unimrcp170server /bin/bash

root@computer:/# /usr/local/unimrcp/bin/unimrcpserver -h
/usr/local/unimrcp/bin/unimrcpserver: error while loading shared libraries: libsofia-sip-ua.so.0: cannot open shared object file: No such file or directory

root@computer:/# /usr/local/unimrcp/bin/unimrcpserver -r /opt/unimrcp -o 2 -w
/usr/local/unimrcp/bin/unimrcpserver: error while loading shared libraries: libsofia-sip-ua.so.0: cannot open shared object file: No such file or directory

The thing was supposed to be installed by the logs:

...
make[3]: Leaving directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua/nua'
make[2]: Leaving directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua/nua'
make[2]: Entering directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua'
make[3]: Entering directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua'
test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib"
 /bin/bash ../libtool   --mode=install /usr/bin/install -c   libsofia-sip-ua.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libsofia-sip-ua.so.0.6.0 /usr/local/lib/libsofia-sip-ua.so.0.6.0
libtool: install: (cd /usr/local/lib && { ln -s -f libsofia-sip-ua.so.0.6.0 libsofia-sip-ua.so.0 || { rm -f libsofia-sip-ua.so.0 && ln -s libsofia-sip-ua.so.0.6.0 libsofia-sip-ua.so.0; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libsofia-sip-ua.so.0.6.0 libsofia-sip-ua.so || { rm -f libsofia-sip-ua.so && ln -s libsofia-sip-ua.so.0.6.0 libsofia-sip-ua.so; }; })
libtool: install: /usr/bin/install -c .libs/libsofia-sip-ua.lai /usr/local/lib/libsofia-sip-ua.la
libtool: install: /usr/bin/install -c .libs/libsofia-sip-ua.a /usr/local/lib/libsofia-sip-ua.a
libtool: install: chmod 644 /usr/local/lib/libsofia-sip-ua.a
libtool: install: ranlib /usr/local/lib/libsofia-sip-ua.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua'
make[2]: Leaving directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua'
make[1]: Leaving directory '/unimrcp-deps-1.6.0/libs/sofia-sip/libsofia-sip-ua
...

Full logs: tmux.txt

You may need to run ldconfig after the deps are installed.

@achaloyan
Running ldconfig does work.

But I found when I run ./build-dep-libs.sh, libsofia-sip-ua.so.0 will be install to /usr/local/lib, and the install script does execute ldconfig -n /usr/local/lib which will update ld.so.cache. Why libsofia-sip-ua.so.0 cannot be found? While libapr-1.so.0 can be found.

Thank you!

Hi
I find the reason. sofia‘s default install dir is /usr/local, so libsofia-sip-ua.so.0 will be installed to /usr/local/lib. While
ldconfig -n /usr/local/lib which install script executes does NOT scan /usr/local/lib, because /usr/local/lib is default dir.