forked from mozilla/DeepSpeech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtc-build.sh
executable file
·43 lines (35 loc) · 1 KB
/
tc-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -xe
source ${HOME}/DeepSpeech/tf/tc-vars.sh
EXTRA_CUDA_CFLAGS=
EXTRA_CUDA_LDFLAGS=
if [ "$1" = "--gpu" ]; then
BAZEL_ENV_FLAGS="TF_NEED_CUDA=1 ${TF_CUDA_FLAGS}"
BAZEL_BUILD_FLAGS="${BAZEL_CUDA_FLAGS} ${BAZEL_OPT_FLAGS}"
SYSTEM_TARGET=host
EXTRA_CUDA_CFLAGS=-L${HOME}/DeepSpeech/CUDA/lib64/
EXTRA_CUDA_LDFLAGS=-lcudart
fi
if [ "$1" = "--arm" ]; then
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
BAZEL_BUILD_FLAGS="${BAZEL_ARM_FLAGS}"
SYSTEM_TARGET=rpi3
fi
if [ "$1" != "--gpu" -a "$1" != "--arm" ]; then
BAZEL_ENV_FLAGS="TF_NEED_CUDA=0"
BAZEL_BUILD_FLAGS="${BAZEL_OPT_FLAGS}"
SYSTEM_TARGET=host
fi
cd ~/DeepSpeech/tf
eval "export ${BAZEL_ENV_FLAGS}"
PATH=${HOME}/bin/:$PATH bazel \
build -c opt ${BAZEL_BUILD_FLAGS} \
//native_client:*
cd ~/DeepSpeech/ds/
make -C native_client/ \
TARGET=${SYSTEM_TARGET} \
TFDIR=${HOME}/DeepSpeech/tf \
RASPBIAN=/tmp/multistrap-raspbian-jessie \
EXTRA_CFLAGS=${EXTRA_CUDA_CFLAGS} \
EXTRA_LDFLAGS=${EXTRA_CUDA_LDFLAGS} \
deepspeech