DEV Community

Cover image for Sphinx: Installing sphinxbase on the OrangePi 4B
Bruno Verachten
Bruno Verachten

Posted on • Originally published at bruno.verachten.fr

Sphinx: Installing sphinxbase on the OrangePi 4B

Originally published on June 5, 2020 at https://bruno.verachten.fr/2020/06/05/installing-sphinxbase-on-the-orangepi-4b/


This post will be part of a series regarding generating subtitles for videos with the OrangePi 4B running Armbian. We’re not yet sure of what we’ll use to generate those subtitles, so for the time being, we’ll use Sphinx, and in the following months, we’ll try to setup something that will take advantage of the NPU.

Today, we’ll install SphinxBase.

git clone https://github.com/cmusphinx/sphinxbase.git
cd sphinxbase/
./autogen.sh
Enter fullscreen mode Exit fullscreen mode

Unfortunately we get:

_Error_: You must have `libtool' installed.
Get ftp://ftp.gnu.org/pub/gnu/libtool/libtool-2.2.6b.tar.gz
(or a newer version if it is available)
Enter fullscreen mode Exit fullscreen mode

Ok, my bad:

sudo apt install libtool
Enter fullscreen mode Exit fullscreen mode

Let’s give it another try:

./autogen.sh
[...]
configure: error: in `/home/poddingue/sphinxbase':
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================

See `config.log' for more details
Enter fullscreen mode Exit fullscreen mode

I see. I may have forgotten to install Python-dev…​

sudo apt install python3-dev
[...]
./autogen.sh
[...]
configure: error: in `/home/poddingue/sphinxbase':
configure: error:
  Could not link test program to Python. Maybe the main Python library has been
  installed in some non-standard library path. If so, pass it to configure,
  via the LDFLAGS environment variable.
  Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib"
  ============================================================================
   ERROR!
   You probably have to install the development version of the Python package
   for your distribution.  The exact name of this package varies among them.
  ============================================================================
Enter fullscreen mode Exit fullscreen mode

How come? Are you still working with Python 2.x? Naaaah…​ Ok, you never know, let’s try it this way:

sudo apt install python-dev
Enter fullscreen mode Exit fullscreen mode

Yes, that was it. Now, let’s tackle this error:

checking python extra linking flags... -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions
checking consistency of all components of python development environment... yes
checking for swig... no
checking for swig2.0... no
configure: error: swig not found
Enter fullscreen mode Exit fullscreen mode

This should be solved by

sudo apt install swig
./autogen.sh
[...]
config.status: executing libtool commands
Now type `make' to compile the package.
Enter fullscreen mode Exit fullscreen mode

Bingo! Time for a good old

make -j6
make check
[...]
Testsuite summary for sphinxbase 5prealpha
============================================================================
== TOTAL: 10
== PASS:  10
== SKIP:  0
== XFAIL: 0
== FAIL:  0
== XPASS: 0
== ERROR: 0
============================================================================
Enter fullscreen mode Exit fullscreen mode

All went fine. Let’s install it then:

 sudo -E make install
Enter fullscreen mode Exit fullscreen mode

Done. Next step, install Pocket Sphinx.

Top comments (0)