I’m trying to build libdeepspeech. For various reasons I am not using the Deepspeech Dockerfile or, the exact code from mozilla/Deepspeech but I was hoping someone would be familiar with this error and may be able to help?
I’ll attach the full log but the gist of it is multiple duplicate definition errors during the linking stage, as follows.
ERROR: /code/tensorflow/native_client/BUILD:91:1: Linking of rule '//native_client:libdeepspeech.so' failed (Exit 1)
gzlib.c:(.text.gzopen+0x0): multiple definition of `gzopen'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(gzlib.pic.o):gzlib.c:(.text.gzopen+0x0): first defined here
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(gzlib.pic.o): In function `gzopen64':
This is then repeated 101 times. Basically k8-opt/bin/external/zlib_archive
vs k8-opt/bin/external/zlib/
Anybody seen this or have any suggestions for how one would go about fixing it?
–
Can’t seem to attach files so… snippets from the build log below
root@832a3d4a38ef:/code/tensorflow# bazel --output_user_root=/code/build/.bazel_cache \
> build \
> --config=monolithic \
> --jobs 7 \
> --workspace_status_command="bash native_client/bazel_workspace_status_cmd.sh" \
> -c opt \
> --copt=-O3 \
> --copt="-D_GLIBCXX_USE_CXX11_ABI=0" \
> --copt=-fvisibility=hidden \
> //native_client:libdeepspeech.so
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
Inherited 'common' options: --isatty=1 --terminal_columns=157
INFO: Reading rc options for 'build' from /code/tensorflow/.bazelrc:
'build' options: --apple_platform_type=macos --define framework_shared_object=true --define open_source_build=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone --strategy=Genrule=standalone -c opt --announce_rc --define=grpc_no_ares=true --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include
INFO: Reading rc options for 'build' from /code/tensorflow/.tf_configure.bazelrc:
'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python --action_env PYTHON_LIB_PATH=/usr/local/lib/python3.7/dist-packages --python_path=/usr/bin/python --config=xla --action_env CUDA_TOOLKIT_PATH=/usr/local/cuda --action_env TF_CUDA_COMPUTE_CAPABILITIES=3.5,7.0 --action_env LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 --action_env GCC_HOST_COMPILER_PATH=/usr/bin/gcc --config=cuda --action_env TF_CONFIGURE_IOS=0
INFO: Found applicable config definition build:xla in file /code/tensorflow/.tf_configure.bazelrc: --define with_xla_support=true
INFO: Found applicable config definition build:cuda in file /code/tensorflow/.bazelrc: --config=using_cuda --define=using_cuda_nvcc=true
INFO: Found applicable config definition build:using_cuda in file /code/tensorflow/.bazelrc: --define=using_cuda=true --action_env TF_NEED_CUDA=1 --crosstool_top=@local_config_cuda//crosstool:toolchain
INFO: Found applicable config definition build:monolithic in file /code/tensorflow/.bazelrc: --define framework_shared_object=false
WARNING: /code/tensorflow/tensorflow/core/BUILD:647:12: in srcs attribute of cc_library rule //tensorflow/core:lib_proto_parsing: please do not import '//tensorflow/core/platform:protobuf.cc' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /code/tensorflow/tensorflow/core/BUILD:2451:12: in srcs attribute of cc_library rule //tensorflow/core:lib_internal_impl: please do not import '//tensorflow/core/platform:abi.h' directly. You should either move the file to this package or depend on an appropriate rule there
WARNING: /code/tensorflow/tensorflow/core/BUILD:2451:12: in srcs attribute of cc_library rule //tensorflow/core:lib_internal_impl: please do not import '//tensorflow/core/platform:byte_order.h' directly. You should either move the file to this package or depend on an appropriate rule there
<snip>
WARNING: /code/tensorflow/native_client/BUILD:91:1: in cc_binary rule //native_client:libdeepspeech.so: target '//native_client:libdeepspeech.so' depends on deprecated target '//tensorflow/contrib/rnn:lstm_ops_op_lib': contrib/rnn kernels and ops are now part of core TensorFlow
INFO: Analysed target //native_client:libdeepspeech.so (108 packages loaded, 6350 targets configured).
INFO: Found 1 target...
INFO: From Executing genrule //native_client:workspace_status:
++ cut '-d ' -f2
++ grep STABLE_TF_GIT_VERSION bazel-out/stable-status.txt
+ tf_git_version=v1.15.0-24-gceb46aae58
++ cut '-d ' -f2
++ grep STABLE_DS_VERSION bazel-out/stable-status.txt
+ ds_version=0.7.1
++ grep STABLE_DS_GIT_VERSION bazel-out/stable-status.txt
++ cut '-d ' -f2
+ ds_git_version=v0.7.1-7-ga6c6dc21
++ grep STABLE_DS_GRAPH_VERSION bazel-out/stable-status.txt
++ cut '-d ' -f2
+ ds_graph_version=6
+ cat
ERROR: /code/tensorflow/native_client/BUILD:91:1: Linking of rule '//native_client:libdeepspeech.so' failed (Exit 1)
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(adler32.pic.o): In function `adler32_z':
adler32.c:(.text.adler32_z+0x0): multiple definition of `adler32_z'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(adler32.pic.o):adler32.c:(.text.adler32_z+0x0): first defined here
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(adler32.pic.o): In function `adler32':
adler32.c:(.text.adler32+0x0): multiple definition of `adler32'
<snip>
zutil.c:(.text.zError+0x0): multiple definition of `zError'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(zutil.pic.o):zutil.c:(.text.zError+0x0): first defined here
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(zutil.pic.o):(.data.rel.ro.local.z_errmsg+0x0): multiple definition of `z_errmsg'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(zutil.pic.o):(.data.rel.ro.local.z_errmsg+0x0): first defined here
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(zutil.pic.o): In function `zcalloc':
zutil.c:(.text.zcalloc+0x0): multiple definition of `zcalloc'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(zutil.pic.o):zutil.c:(.text.zcalloc+0x0): first defined here
bazel-out/k8-opt/bin/external/zlib/libzlib.pic.a(zutil.pic.o): In function `zcfree':
zutil.c:(.text.zcfree+0x0): multiple definition of `zcfree'
bazel-out/k8-opt/bin/external/zlib_archive/libzlib.pic.a(zutil.pic.o):zutil.c:(.text.zcfree+0x0): first defined here
collect2: error: ld returned 1 exit status
Target //native_client:libdeepspeech.so failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 22.922s, Critical Path: 11.30s
INFO: 1 process: 1 local.
FAILED: Build did NOT complete successfully