|
| 1 | + |
| 2 | +# CMU SphinxBase and PocketSphinx Builder |
| 3 | + |
| 4 | +> **DISCLAIMER**: TLSphinx comes with pre-bundled sphinxbase and pocketsphinx |
| 5 | +> libraries and headers, you're **strongly** encouraged to use those instead of |
| 6 | +> building them on your own. |
| 7 | +
|
| 8 | +These are the CMU sphinxbase and pocketsphinx building instructions for TLSphinx, follow the guide below to build the required libraries for TLSphinx to build. |
| 9 | + |
| 10 | +In order to build sphinxbase and pocketsphinx both packages need to be downloaded, see: [CMUSphinx Downloads](https://cmusphinx.github.io/wiki/download/). |
| 11 | + |
| 12 | +From there you need to download: |
| 13 | + |
| 14 | + * [sphinxbase-5prealpha](http://sourceforge.net/projects/cmusphinx/files/sphinxbase/5prealpha) |
| 15 | + * [pocketsphinx-5prealpha](http://sourceforge.net/projects/cmusphinx/files/pocketsphinx/5prealpha) |
| 16 | + |
| 17 | +After downloading both files copy them to `Sphinx/builder/cmusphinx` |
| 18 | + |
| 19 | +## Automatic Compilation |
| 20 | +After copying the files to the appropiate directory (*see above*) just run the install.sh script and with some luck you're done. |
| 21 | + |
| 22 | +``` |
| 23 | +cd Sphinx/builder/ |
| 24 | +./install.sh |
| 25 | +``` |
| 26 | + |
| 27 | + |
| 28 | +--- |
| 29 | +## Manual Compilation |
| 30 | +If possible please try automatic compilation when possible, manual compilation is not for the feint of heart yet it might help in scenarios where you want to build CMU Sphinx Base and Pocket Sphinx from their respective master branches. |
| 31 | + |
| 32 | +Below are sample instructions on how to manually build the **5prealpha** release, to build against the lastest source just modify each command accordingly. |
| 33 | +### Sphinxbase |
| 34 | +--- |
| 35 | +#### To prepare build environment: |
| 36 | +``` |
| 37 | +#From TLSphinx root directory |
| 38 | +cd Sphinx/builder/cmusphinx |
| 39 | +tar zxvf sphinxbase-5prealpha.tar.gz |
| 40 | +cp ../ios-build-sphinxbase.sh sphinxbase-5prealpha/ |
| 41 | +``` |
| 42 | +#### To build: |
| 43 | +``` |
| 44 | +SPHINX_VERSION_REQ=5prealpha |
| 45 | +cd sphinxbase-5prealpha |
| 46 | +./ios-build-sphinxbase.sh |
| 47 | +``` |
| 48 | +#### Install Libraries: |
| 49 | +``` |
| 50 | +cp bin/arm64/lib/libsphinx*.a ../../../lib/sphinxbase/arm64/ |
| 51 | +cp bin/armv7/lib/libsphinx*.a ../../../lib/sphinxbase/armv7/ |
| 52 | +cp bin/armv7s/lib/libsphinx*.a ../../../lib/sphinxbase/armv7s/ |
| 53 | +cp bin/i386/lib/libsphinx*.a ../../../lib/sphinxbase/i386/ |
| 54 | +cp bin/x86_64/lib/libsphinx*.a ../../../lib/sphinxbase/x86_64/ |
| 55 | +cp bin/libsphinxad.a ../../../lib/sphinxbase/ |
| 56 | +cp bin/libsphinxbase.a ../../../lib/sphinxbase/ |
| 57 | +``` |
| 58 | +#### Install Headers |
| 59 | +``` |
| 60 | +cp include/sphinxbase/ ../../../include/sphinxbase/ |
| 61 | +cp include/sphinx_config.h ../../../include/sphinxbase/ |
| 62 | +``` |
| 63 | + |
| 64 | +### PocketSphinx |
| 65 | +--- |
| 66 | +#### To prepare build environment: |
| 67 | +``` |
| 68 | +#From TLSphinx root directory |
| 69 | +cd Sphinx/builder/cmusphinx |
| 70 | +tar zxvf pocketsphinx-5prealpha.tar.gz |
| 71 | +cp ../ios-build-pocketsphinx.sh pocketsphinx-5prealpha/ |
| 72 | +``` |
| 73 | +#### To build: |
| 74 | +``` |
| 75 | +SPHINX_VERSION_REQ=5prealpha |
| 76 | +cd pocketsphinx-5prealpha |
| 77 | +./ios-build-pocketsphinx.sh |
| 78 | +``` |
| 79 | +#### Install Libraries: |
| 80 | +``` |
| 81 | +cp bin/arm64/lib/libpocketsphinx.a ../../../lib/pocketsphinx/arm64/ |
| 82 | +cp bin/armv7/lib/libpocketsphinx.a ../../../lib/pocketsphinx/armv7/ |
| 83 | +cp bin/armv7s/lib/libpocketsphinx.a ../../../lib/pocketsphinx/armv7s/ |
| 84 | +cp bin/i386/lib/libpocketsphinx.a ../../../lib/pocketsphinx/i386/ |
| 85 | +cp bin/x86_64/lib/libpocketsphinx.a ../../../lib/pocketsphinx/x86_64/ |
| 86 | +cp bin/libpocketsphinx.a ../../../lib/pocketsphinx/ |
| 87 | +``` |
| 88 | +#### Install Headers |
| 89 | +``` |
| 90 | +cp -vf include/*.h ../../../include/pocketsphinx/ |
| 91 | +``` |
0 commit comments