synesthesiam / voice2json

Command-line tools for speech and intent recognition on Linux
MIT License
1.09k stars 63 forks source link

Build from source - configure does not detect pocketsphinx installed #29

Closed ekawahyu closed 3 years ago

ekawahyu commented 3 years ago

Configure command:

./configure VOICE2JSON_LANGUAGE=en VOICE2JSON_SPEECH=pocketsphinx --disable-precompiled-binaries

Configure summary:

voice2json configuration summary:

architecture: x86_64/amd64
prefix: /home/ubuntu/Downloads/voice2json/.venv
virtualenv: yes
language: en

wake:
  mycroft precise: yes (x86_64, prebuilt)

speech to text:
  pocketsphinx: no
  kaldi: yes (source)
  julius: no
  deepspeech: no

training:
  opengrm: yes (source)
  phonetisaurus: yes (source)
  kenlm: no

configure: creating ./config.status
config.status: creating Makefile
config.status: creating setup.py
config.status: creating voice2json.sh
config.status: creating voice2json.spec

I am on Ubuntu 18.04 LTS with pocketsphinx, libpocketsphinx3, and libpocketsphinx-dev installed

But if I do ./configure only, the summary is as follows:

voice2json configuration summary:

architecture: x86_64/amd64
prefix: /home/ubuntu/Downloads/voice2json/.venv
virtualenv: yes
language: 

wake:
  mycroft precise: yes (x86_64, prebuilt)

speech to text:
  pocketsphinx: yes (source)
  kaldi: yes (prebuilt)
  julius: yes (prebuilt)
  deepspeech: yes (amd64, prebuilt)

training:
  opengrm: yes (prebuilt)
  phonetisaurus: yes (prebuilt)
  kenlm: yes (prebuilt)

configure: creating ./config.status
config.status: creating Makefile
config.status: creating setup.py
config.status: creating voice2json.sh
config.status: creating voice2json.spec

I wanted to build from source with pocketsphinx only and the former seems to include kaldi instead of pocketsphinx. If I remove kaldi from my system, voice2json generates error that kaldi is missing

synesthesiam commented 3 years ago

voice2json uses the pocketsphinx Python library, which includes it's own copy of pocketsphinx and supporting Sphinx library. So having it installed through apt-get won't have any effect.

You also have a typo in your command: it should be VOICE2JSON_SPEECH_SYSTEM:

./configure VOICE2JSON_LANGUAGE=en VOICE2JSON_SPEECH_SYSTEM=pocketsphinx --disable-precompiled-binaries
ekawahyu commented 3 years ago

Ok, thank you for spotting the mistake, it can now configure as expected. Unfortunately, it failed to build with the following error:

make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/ubuntu/Downloads/voice2json/build/phonetisaurus'
make[1]: Leaving directory '/home/ubuntu/Downloads/voice2json/build/phonetisaurus'
Tar-ing binary files to /home/ubuntu/Downloads/voice2json/download/phonetisaurus-2019_amd64.tar.gz
cp: target 'lib/' is not a directory
Makefile:203: recipe for target '/home/ubuntu/Downloads/voice2json/download/phonetisaurus-2019_amd64.tar.gz' failed
make: *** [/home/ubuntu/Downloads/voice2json/download/phonetisaurus-2019_amd64.tar.gz] Error 1
ekawahyu commented 3 years ago

I decided to try using precompiled binaries, it also gave with errors:

chmod +x "/home/ubuntu/Downloads/voice2json/voice2json.sh"
install -D "/home/ubuntu/Downloads/voice2json/voice2json.sh" "/home/ubuntu/Downloads/voice2json/.venv/bin/voice2json"
install -D "--target-directory=/home/ubuntu/Downloads/voice2json/.venv/share/voice2json/etc" "/home/ubuntu/Downloads/voice2json/etc/profile.defaults.yml"
install -D "--target-directory=/home/ubuntu/Downloads/voice2json/.venv/share/voice2json/etc/precise" "/home/ubuntu/Downloads/voice2json/etc/precise"/*
install -D "--target-directory=/home/ubuntu/Downloads/voice2json/.venv/share/voice2json" VERSION README.md LICENSE
cp -fR "/home/ubuntu/Downloads/voice2json/site" "/home/ubuntu/Downloads/voice2json/.venv/share/voice2json/" || true
cp: cannot stat '/home/ubuntu/Downloads/voice2json/site': No such file or directory
synesthesiam commented 3 years ago

Thanks for looking into this more! I've updated the Makefile to check for the site directory before trying the copy (it's created with scripts/build-docs.sh and shouldn't affect your install).

I also updated the phonetisaurus build script; hopefully it's fixed, but I haven't gone through the install process again to test yet.

ekawahyu commented 3 years ago

Installation for both pre-compiled or from source seem to work now. I am having issue with the training, but that's another ticket. Thank you and I am closing this now.