Add -gpu prefix to CUDA enabled packages
This commit is contained in:
parent
f1d89c02be
commit
92e53a7a06
@ -35,7 +35,7 @@ MANIFEST.in:
|
||||
|
||||
bindings-package: MANIFEST.in
|
||||
cat MANIFEST.in
|
||||
$(NUMPY_INCLUDE) python ./setup.py bdist_wheel $(PYTHON_PLATFORM_NAME)
|
||||
$(NUMPY_INCLUDE) python ./setup.py bdist_wheel $(PYTHON_PLATFORM_NAME) $(SETUP_FLAGS)
|
||||
|
||||
bindings: bindings-build bindings-package
|
||||
|
||||
|
@ -5,6 +5,7 @@ from distutils.command.build import build
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
try:
|
||||
import numpy
|
||||
@ -18,6 +19,13 @@ except ImportError:
|
||||
|
||||
numpy_include = os.getenv('NUMPY_INCLUDE', numpy_include)
|
||||
|
||||
project_name = 'deepspeech'
|
||||
if '--project_name' in sys.argv:
|
||||
project_name_idx = sys.argv.index('--project_name')
|
||||
project_name = sys.argv[project_name_idx + 1]
|
||||
sys.argv.remove('--project_name')
|
||||
sys.argv.pop(project_name_idx)
|
||||
|
||||
class BuildExtFirst(build):
|
||||
sub_commands = [('build_ext', build.has_ext_modules),
|
||||
('build_py', build.has_pure_modules),
|
||||
@ -34,7 +42,7 @@ utils = Extension('_utils',
|
||||
include_dirs = [numpy_include],
|
||||
libraries = ['deepspeech_utils'])
|
||||
|
||||
setup(name = 'deepspeech',
|
||||
setup(name = project_name,
|
||||
description = 'A library for running inference on a DeepSpeech model',
|
||||
author = 'Chris Lord',
|
||||
author_email='chrislord.net@gmail.com',
|
||||
|
@ -23,6 +23,6 @@ do_bazel_build
|
||||
|
||||
do_deepspeech_binary_build
|
||||
|
||||
do_deepspeech_python_build
|
||||
do_deepspeech_python_build rename_to_gpu
|
||||
|
||||
do_deepspeech_nodejs_build
|
||||
do_deepspeech_nodejs_build rename_to_gpu
|
||||
|
@ -245,6 +245,8 @@ do_deepspeech_binary_build()
|
||||
|
||||
do_deepspeech_python_build()
|
||||
{
|
||||
rename_to_gpu=$1
|
||||
|
||||
unset PYTHON_BIN_PATH
|
||||
unset PYTHONPATH
|
||||
export PYENV_ROOT="${DS_ROOT_TASK}/DeepSpeech/.pyenv"
|
||||
@ -255,6 +257,11 @@ do_deepspeech_python_build()
|
||||
|
||||
mkdir -p wheels
|
||||
|
||||
SETUP_FLAGS=""
|
||||
if [ "${rename_to_gpu}" ]; then
|
||||
SETUP_FLAGS="--project_name deepspeech-gpu"
|
||||
fi
|
||||
|
||||
for pyver in ${SUPPORTED_PYTHON_VERSIONS}; do
|
||||
pyenv install ${pyver}
|
||||
pyenv virtualenv ${pyver} deepspeech
|
||||
@ -264,9 +271,10 @@ do_deepspeech_python_build()
|
||||
TARGET=${SYSTEM_TARGET} \
|
||||
RASPBIAN=/tmp/multistrap-raspbian-jessie \
|
||||
TFDIR=${DS_TFDIR} \
|
||||
SETUP_FLAGS="${SETUP_FLAGS}" \
|
||||
bindings-clean bindings
|
||||
|
||||
cp native_client/dist/deepspeech-*.whl wheels
|
||||
cp native_client/dist/*.whl wheels
|
||||
|
||||
make -C native_client/ bindings-clean
|
||||
|
||||
@ -277,6 +285,8 @@ do_deepspeech_python_build()
|
||||
|
||||
do_deepspeech_nodejs_build()
|
||||
{
|
||||
rename_to_gpu=$1
|
||||
|
||||
npm update && npm install node-gyp node-pre-gyp
|
||||
|
||||
export PATH="$(npm root)/.bin/:$PATH"
|
||||
@ -291,6 +301,11 @@ do_deepspeech_nodejs_build()
|
||||
done;
|
||||
|
||||
make -C native_client/javascript clean npm-pack
|
||||
|
||||
if [ "${rename_to_gpu}" ]; then
|
||||
pkg=(native_client/javascript/deepspeech-*.tgz)
|
||||
mv "${pkg}" "${pkg//deepspeech/deepspeech-gpu}"
|
||||
fi
|
||||
}
|
||||
|
||||
package_native_client()
|
||||
|
Loading…
x
Reference in New Issue
Block a user