Duplicate symbol error upon building

I’m trying to build master on macOS with Mozilla’s r1.14 fork of Tensorflow and Bazel 0.24.1 (as recommended on the TF site for 1.14) and I’m getting the following error:

duplicate symbol __ZN10tensorflow4port20NewStringListEncoderEPNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(tensor_coding.pic.o)
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(string_coding.pic.o)
duplicate symbol __ZN10tensorflow4port20NewStringListDecoderERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in:
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(tensor_coding.pic.o)
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(string_coding.pic.o)
duplicate symbol __ZN10tensorflow23kProtobufUint64TypenameE in:
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(protobuf.pic.o)
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_proto_parsing.pic.a(protobuf.pic.o)
duplicate symbol __ZN10tensorflow22kProtobufInt64TypenameE in:
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_internal_impl.pic.a(protobuf.pic.o)
    bazel-out/darwin-opt/bin/tensorflow/core/liblib_proto_parsing.pic.a(protobuf.pic.o)
ld: 4 duplicate symbols for architecture x86_64

So it seems like it’s some issue with Tensorflow but I’m using the Mozilla r1.14 fork so I’m not sure what could be wrong here.

Anyone have any ideas?

Forgot to post my build script:

#!/bin/bash

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
export TFDIR=~/Documents/DeepSpeech/tensorflow

cd ~/Documents/DeepSpeech/tensorflow
bazel build --workspace_status_command="bash native_client/bazel_workspace_status_cmd.sh" --config=monolithic -c opt --copt=-O3 --copt="-D_GLIBCXX_USE_CXX11_ABI=0" --copt=-fvisibility=hidden //native_client:libdeepspeech.so //native_client:generate_trie

cp -f bazel-bin/native_client/libdeepspeech.so ../native_client

cd ../native_client
make clean
make deepspeech

Your setup matches what I use. I don’t remember seeing anything like that error. Does a bazel clean --expunge and then rebuilding (this will clear all cache and build everything from scratch, mind the build time) help?

Thanks, I’m still getting that error unfortunately. It took me such a long time to get everything setup initially that I’ve been reluctant to tamper with it too much and have been merging changes on top of what I already setup, but I think a clean install from scratch may be the best solution here.

I’m pretty sure this is something stale as @reuben suggested :confused:

Yes, I think you’re right. A clean install fixed the problem.