Skip to content

Commit

Permalink
fix building release version
Browse files Browse the repository at this point in the history
  • Loading branch information
daanzu committed Jul 12, 2020
1 parent 8c0ca99 commit 4d20fc5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,15 @@ jobs:
df -h
cd kaldi/windows
cp kaldiwin_mkl.props kaldiwin.props
perl -pi -e 's/<AdditionalDependencies>.*<\/AdditionalDependencies>/<AdditionalDependencies>mkl_sequential.lib;mkl_intel_thread.lib;mkl_core.lib;mkl_intel_lp64.lib;%(AdditionalDependencies)<\/AdditionalDependencies>/g' kaldiwin.props
cp variables.props.dev variables.props
# sed -i.bak \
# -e 's%<OPENFST>.*</OPENFST>%<OPENFST>${{ github.workspace }}/openfst</OPENFST>%g' \
# -e 's%<OPENFSTLIB>.*</OPENFSTLIB>%<OPENFSTLIB>${{ github.workspace }}/openfst/build64</OPENFSTLIB>%g' \
# variables.props
perl -pi -e 's/<OPENFST>.*<\/OPENFST>/<OPENFST>$ENV{GITHUB_WORKSPACE}\\openfst<\/OPENFST>/g' variables.props
perl -pi -e 's/<OPENFSTLIB>.*<\/OPENFSTLIB>/<OPENFSTLIB>$ENV{GITHUB_WORKSPACE}\\openfst\\build_output<\/OPENFSTLIB>/g' variables.props
cat variables.props
# cat variables.props
perl generate_solution.pl --vsver vs2019 --enable-mkl --noportaudio
perl get_version.pl
cd ../..
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ build/
_skbuild/
dist/
wheelhouse/
wheels/
*.egg-info/
*.egg
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
* Refactor of passing configuration to initialization.
* `PlainDictationRecognizer.decode_utterance` can take `chunk_size` parameter.
* Smaller binaries: Windows 23MB -> 2MB, MacOS 11MB -> 7.6MB, Linux 21MB -> 18MB.
* Smaller binaries: MacOS 11MB -> 7.6MB, Linux 21MB -> 18MB.

### Fixed
* Python3 int division bug for cloud dictation.
Expand Down
6 changes: 6 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ build-docker:
docker run --rm -e KAG_BRANCH=master -e WHEEL_PLAT=manylinux2010_x86_64 -v $(pwd):/io {{docker_repo}} bash /io/building/build-wheel-manylinux.sh
# docker run --rm -e PLAT=manylinux2010_x86_64 -v .:/io {{docker_repo}} cp ../kaldi/tools/openfst/bin/{fstarcsort,fstcompile,fstinfo} ../kaldi/src/fstbin/fstaddselfloops ../kaldi/src/dragonfly/libkaldi-dragonfly.so ../kaldi/src/dragonflybin/compile-graph-agf /io/kaldi_active_grammar/exec/linux

build-linux python='python3':
mkdir -p _skbuild
rm -rf kaldi_active_grammar/exec
rm -rf _skbuild/*/cmake-install/ _skbuild/*/setuptools/
{{python}} setup.py bdist_wheel

build-dockcross:
building/dockcross-manylinux2010-x64 bash building/build-wheel-dockcross.sh manylinux2010_x86_64

Expand Down
5 changes: 3 additions & 2 deletions building/build-wheel-dockcross.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ if [ -z "$WHEEL_PLAT" ] || [ -z "$PYTHON_EXE" ]; then
fi

mkdir -p _skbuild
rm -rf _skbuild/*/cmake-install/ _skbuild/*/setuptools/
rm -rf kaldi_active_grammar/exec

pushd _skbuild
wget --no-verbose --no-clobber $MKL_URL
mkdir -p /tmp/mkl
Expand All @@ -23,8 +26,6 @@ sudo /tmp/mkl/install.sh --silent /tmp/mkl/silent.cfg
rm -rf /tmp/mkl
popd

rm -rf kaldi_active_grammar/exec
rm -rf _skbuild/*/cmake-install/ _skbuild/*/setuptools/
# $PYTHON_EXE -m pip install --upgrade setuptools wheel scikit-build cmake ninja
$PYTHON_EXE setup.py bdist_wheel

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def find_version(*file_paths):
version = find_version('kaldi_active_grammar', '__init__.py')

# Set branch for Kaldi source repository (maybe we should use commits instead?)
os.environ['KALDI_BRANCH'] = ('origin/kag-v' + version) if ('dev' not in version) else 'origin/master'
os.environ['KALDI_BRANCH'] = ('kag-v' + version) if ('dev' not in version) else 'origin/master'

# Get the long description from the README file
with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
Expand Down

0 comments on commit 4d20fc5

Please sign in to comment.