|
23 | 23 | # ./configure --use-cuda=no # disable CUDA detection (will build cpu-only
|
24 | 24 | # # version of kaldi even on CUDA-enabled machine
|
25 | 25 | # ./configure --use-cuda --cudatk-dir=/usr/local/cuda/ --cuda-arch=-arch=sm_70
|
26 |
| -# # Use cuda in /usr/local/cuda and set the arch to -sm_70 |
| 26 | +# # Use cuda in /usr/local/cuda and set the arch to sm_70 |
27 | 27 | # ./configure --static --fst-root=/opt/cross/armv8hf \
|
28 | 28 | # --atlas-root=/opt/cross/armv8hf --host=armv8-rpi3-linux-gnueabihf
|
29 | 29 | # # Cross compile for armv8hf, this assumes that you have openfst built
|
@@ -117,18 +117,18 @@ function rel2abs {
|
117 | 117 | fi
|
118 | 118 | }
|
119 | 119 |
|
| 120 | +function read_value { |
| 121 | + local val=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 122 | + echo $val |
| 123 | +} |
| 124 | + |
120 | 125 | function read_dirname {
|
121 |
| - local dir_name=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 126 | + local dir_name=`read_value $1` |
122 | 127 | local retval=`rel2abs $dir_name`
|
123 | 128 | [ -z $retval ] && echo "Bad option '$1': no such directory" && exit 1;
|
124 | 129 | echo $retval
|
125 | 130 | }
|
126 | 131 |
|
127 |
| -function read_value { |
128 |
| - local val=`expr "X$1" : '[^=]*=\(.*\)'`; |
129 |
| - echo $val |
130 |
| -} |
131 |
| - |
132 | 132 | function is_set {
|
133 | 133 | local myvar=${1:-notset}
|
134 | 134 | if [ "$myvar" == "notset" ]; then
|
|
949 | 949 | mkl_threading=sequential;
|
950 | 950 | shift ;;
|
951 | 951 | --mkl-threading=*)
|
952 |
| - mkl_threading=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 952 | + mkl_threading=`read_value $1`; |
953 | 953 | threaded_atlas=true;
|
954 | 954 | shift ;;
|
955 | 955 | --fst-root=*)
|
|
980 | 980 | OMPLIBDIR=`read_dirname $1`;
|
981 | 981 | shift ;;
|
982 | 982 | --mathlib=*)
|
983 |
| - MATHLIB=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 983 | + MATHLIB=`read_value $1`; |
984 | 984 | shift ;;
|
985 | 985 | --cudatk-dir=*)
|
986 | 986 | CUDATKDIR=`read_dirname $1`;
|
|
989 | 989 | CUDA_ARCH=`read_value $1`;
|
990 | 990 | shift;;
|
991 | 991 | --fst-version=*)
|
992 |
| - OPENFST_VER=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 992 | + OPENFST_VER=`read_value $1`; |
993 | 993 | shift;;
|
994 | 994 | --host=*)
|
995 | 995 | # The type of system where built programs and libraries will run.
|
996 | 996 | # It should be in the format cpu-vendor-os. If specified, this script
|
997 | 997 | # will infer the target architecture from the specified host triple.
|
998 |
| - HOST=`expr "X$1" : '[^=]*=\(.*\)'`; |
| 998 | + HOST=`read_value $1`; |
999 | 999 | shift ;;
|
1000 | 1000 | --android-incdir=*)
|
1001 | 1001 | android=true;
|
|
0 commit comments