2019-03-01 14:41:55 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -xe
|
|
|
|
|
2020-01-30 12:18:58 +03:00
|
|
|
package_option=$1
|
2019-03-01 14:41:55 +03:00
|
|
|
|
2019-06-14 16:27:32 +03:00
|
|
|
source $(dirname "$0")/tc-tests-utils.sh
|
2019-03-01 14:41:55 +03:00
|
|
|
|
2020-06-25 15:44:31 +03:00
|
|
|
source $(dirname "$0")/tf_tc-vars.sh
|
2019-03-01 14:41:55 +03:00
|
|
|
|
|
|
|
BAZEL_TARGETS="
|
|
|
|
//native_client:libdeepspeech.so
|
|
|
|
"
|
|
|
|
|
2020-01-30 12:18:58 +03:00
|
|
|
if [ "${package_option}" = "--cuda" ]; then
|
2019-03-01 14:41:55 +03:00
|
|
|
BAZEL_ENV_FLAGS="TF_NEED_CUDA=1 ${TF_CUDA_FLAGS}"
|
|
|
|
BAZEL_BUILD_FLAGS="${BAZEL_CUDA_FLAGS} ${BAZEL_EXTRA_FLAGS} ${BAZEL_OPT_FLAGS}"
|
|
|
|
PROJECT_NAME="DeepSpeech-GPU"
|
2020-01-30 12:18:58 +03:00
|
|
|
elif [ "${package_option}" = "--tflite" ]; then
|
|
|
|
PROJECT_NAME="DeepSpeech-TFLite"
|
|
|
|
BAZEL_BUILD_FLAGS="--define=runtime=tflite ${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
|
|
|
|
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
|
2019-03-01 14:41:55 +03:00
|
|
|
else
|
|
|
|
PROJECT_NAME="DeepSpeech"
|
2020-01-30 12:18:58 +03:00
|
|
|
BAZEL_BUILD_FLAGS="${BAZEL_OPT_FLAGS} ${BAZEL_EXTRA_FLAGS}"
|
2019-03-01 14:41:55 +03:00
|
|
|
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
|
|
|
|
fi
|
|
|
|
|
|
|
|
SYSTEM_TARGET=host-win
|
|
|
|
|
|
|
|
do_bazel_build
|
|
|
|
|
2020-01-30 12:18:58 +03:00
|
|
|
if [ "${package_option}" = "--cuda" ]; then
|
2020-06-25 15:44:31 +03:00
|
|
|
cp ${DS_ROOT_TASK}/DeepSpeech/ds/tensorflow/bazel-bin/native_client/liblibdeepspeech.so.ifso ${DS_ROOT_TASK}/DeepSpeech/ds/tensorflow/bazel-bin/native_client/libdeepspeech.so.if.lib
|
2019-03-01 14:41:55 +03:00
|
|
|
fi
|
|
|
|
|
2019-03-20 11:16:09 +03:00
|
|
|
export PATH=$PATH:$(cygpath ${ChocolateyInstall})/bin:'/c/Program Files/nodejs/'
|
2019-03-01 14:41:55 +03:00
|
|
|
|
|
|
|
do_deepspeech_binary_build
|
|
|
|
|
2019-12-06 20:43:47 +03:00
|
|
|
if [ "${runtime}" = "tflite" ]; then
|
|
|
|
do_deepspeech_python_build "--tflite"
|
|
|
|
else
|
2020-01-30 12:18:58 +03:00
|
|
|
do_deepspeech_python_build "${package_option}"
|
2019-12-06 20:43:47 +03:00
|
|
|
fi
|
2019-04-03 17:27:07 +03:00
|
|
|
|
2020-01-30 12:18:58 +03:00
|
|
|
do_deepspeech_nodejs_build "${package_option}"
|
2019-03-20 11:16:09 +03:00
|
|
|
|
2019-03-01 14:41:55 +03:00
|
|
|
do_deepspeech_netframework_build
|
|
|
|
|
2019-08-21 22:04:20 +03:00
|
|
|
do_deepspeech_netframework_wpf_example_build
|
|
|
|
|
2019-03-01 14:41:55 +03:00
|
|
|
do_nuget_build "${PROJECT_NAME}"
|
|
|
|
|
|
|
|
shutdown_bazel
|