-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from csukuangfj/pybind11
Switch from cython to pybind11 to support installing on Windows.
- Loading branch information
Showing
14 changed files
with
1,299 additions
and
4,926 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Run test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# see https://github.com/microsoft/setup-msbuild | ||
- name: Add msbuild to PATH | ||
if: startsWith(matrix.os, 'windows') | ||
uses: microsoft/[email protected] | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install kaldialign | ||
shell: bash | ||
run: | | ||
python3 setup.py install --verbose | ||
- name: Test | ||
shell: bash | ||
run: | | ||
python3 ./tests/test_align.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
if("x${CMAKE_SOURCE_DIR}" STREQUAL "x${CMAKE_BINARY_DIR}") | ||
message(FATAL_ERROR "\ | ||
In-source build is not a good practice. | ||
Please use: | ||
mkdir build | ||
cd build | ||
cmake .. | ||
to build this project" | ||
) | ||
endif() | ||
|
||
cmake_minimum_required(VERSION 3.8 FATAL_ERROR) | ||
|
||
project(kaldialign CXX) | ||
|
||
set(KALDIALIGN_VERSION "0.3") | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) | ||
include(pybind11) | ||
|
||
pybind11_add_module(_kaldialign | ||
./extensions/kaldi_align.cpp | ||
./extensions/kaldialign.cpp | ||
) | ||
|
||
if(UNIX AND NOT APPLE) | ||
target_link_libraries(_kaldialign PUBLIC ${PYTHON_LIBRARY}) | ||
elseif(WIN32) | ||
target_link_libraries(_kaldialign PUBLIC ${PYTHON_LIBRARIES}) | ||
endif() | ||
|
||
install(TARGETS _kaldialign | ||
DESTINATION ../ | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.