Skip to content

Commit

Permalink
Merge pull request #250 from dhdaines/master
Browse files Browse the repository at this point in the history
Large build system and small API modernizations.  Some loose ends to tie up still, will be other PRs.
  • Loading branch information
dhdaines authored Jun 9, 2022
2 parents 5da71f0 + d4d6091 commit 4f07168
Show file tree
Hide file tree
Showing 440 changed files with 65,180 additions and 4,971 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Run Tests
on:
- push
- pull_request
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Build Dependencies
run: sudo apt-get -y install doxygen swig
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: |
mkdir build
(cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=install ..)
(cd build && make)
- name: Run tests
run: |
(cd build && make test)
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
build/
*~
.vscode/settings.json
*.egg-info
_skbuild
dist
MANIFEST
__pycache__
jsbuild
CMakeCache.txt
CMakeFiles
CTestTestfile.cmake
DartConfiguration.tcl
cmake_install.cmake

78 changes: 78 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
cmake_minimum_required(VERSION 3.14) # I like pie

project(PocketSphinx VERSION 0.9.999.0
DESCRIPTION "A small speech recognizer"
HOMEPAGE_URL "https://github.com/cmusphinx/pocketsphinx")
include(CMakePrintHelpers)
set(PACKAGE_NAME ${PROJECT_NAME})
string(TOLOWER ${PROJECT_NAME} PROJECT_SHORTNAME)
set(PACKAGE_VERSION ${PROJECT_VERSION})
set(PACKAGE_STRING "${PROJECT_NAME} ${PROJECT_VERSION}")
set(PACKAGE_TARNAME "${PROJECT_SHORTNAME}-${PROJECT_VERSION}")
set(PACKAGE_URL ${PROJECT_HOMEPAGE_URL})
set(PACKAGE_BUGREPORT [email protected])

if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)
enable_testing()
endif()

include(CheckTypeSize)
include(CheckSymbolExists)
include(CheckLibraryExists)
include(TestBigEndian)
include(GNUInstallDirs)

CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
CHECK_SYMBOL_EXISTS(snprintf stdio.h HAVE_SNPRINTF)
CHECK_SYMBOL_EXISTS(popen stdio.h HAVE_POPEN)
CHECK_TYPE_SIZE(long LONG)
CHECK_TYPE_SIZE("long long" LONG_LONG)
# OMG CMake is so incredibly awful
set(SIZEOF_LONG ${LONG})
set(SIZEOF_LONG_LONG ${LONG_LONG})
cmake_print_variables(SIZEOF_LONG SIZEOF_LONG_LONG)
test_big_endian(WORDS_BIGENDIAN)
cmake_print_variables(WORDS_BIGENDIAN)

# Don't do this
#if(CMAKE_BUILD_TYPE STREQUAL Debug)
# set(SPHINX_DEBUG 1)
#endif()

# Compiles some code as the wrong endianness in order to ensure that
# it works properly
if(DEBUG_ENDIAN)
add_definitions(-DDEBUG_ENDIAN)
endif()
cmake_print_variables(SPHINX_DEBUG DEBUG_ENDIAN)

if(MSVC)
add_compile_options(/W3)
else()
add_compile_options(-Wall)
endif()

option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
option(FIXED_POINT "Build using fixed-point math" OFF)
if(NOT DEFAULT_RADIX)
set(DEFAULT_RADIX 12)
endif()
cmake_print_variables(FIXED_POINT DEFAULT_RADIX)

configure_file(config.h.in config.h)
configure_file(sphinx_config.h.in include/sphinxbase/sphinx_config.h)
add_definitions(-DHAVE_CONFIG_H)

add_subdirectory(src)
add_subdirectory(include)
add_subdirectory(model)
add_subdirectory(programs)
add_subdirectory(doc)
add_subdirectory(test)
add_subdirectory(swig)

configure_file(pocketsphinx.pc.in pocketsphinx.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/pocketsphinx.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
19 changes: 0 additions & 19 deletions Makefile.am

This file was deleted.

90 changes: 0 additions & 90 deletions README

This file was deleted.

1 change: 0 additions & 1 deletion README.md

This file was deleted.

36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
PocketSphinx 1.0.0 prerelease
=============================

This is PocketSphinx, one of Carnegie Mellon University's open source large
vocabulary, speaker-independent continuous speech recognition engines.

Although this was at one point a research system, active development
has largely ceased and it has become very, very far from the state of
the art. I am making a release, because people are nonetheless using
it, and there are a number of historical errors in the build system
and API which needed to be corrected.

**Please see the LICENSE file for terms of use.**

Installation
------------

We now use CMake for building, which should give reasonable results
across Linux and Windows. Not certain about Mac OS X because I don't
have one of those. In addition, the audio library, which never really
built or worked correctly on any platform at all, has simply been
removed.

There is no longer any dependency on SphinxBase, because there is no
reason for SphinxBase to exist. You can just link against the
PocketSphinx library, which now includes all of its functionality.

So you can do something like this:

```
mkdir build
cd build
cmake ..
make
make install
```
112 changes: 0 additions & 112 deletions autogen.sh

This file was deleted.

Loading

0 comments on commit 4f07168

Please sign in to comment.