'clang: error: linker command failed with exit code 1 with undefined dynamic_lookup
I am trying to execute the CVPPP code of the following github repository: https://github.com/renmengye/rec-attend-public
As they suggest in the README, first of all I run ./hungarian_build.sh. On my Mac this command leads to this error:
11 warnings generated.
Undefined symbols for architecture x86_64:
"tensorflow::DEVICE_CPU", referenced from:
___cxx_global_var_init.7 in hungarian-df3b79.o
"tensorflow::TensorShape::DestructorOutOfLine()", referenced from:
tensorflow::TensorShape::~TensorShape() in hungarian-df3b79.o
"tensorflow::TensorShape::AddDim(long long)", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
"tensorflow::TensorShape::TensorShape()", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
"tensorflow::register_op::OpDefBuilderReceiver::OpDefBuilderReceiver(tensorflow::register_op::OpDefBuilderWrapper<true> const&)", referenced from:
___cxx_global_var_init in hungarian-df3b79.o
"tensorflow::OpDefBuilder::Input(tensorflow::StringPiece)", referenced from:
tensorflow::register_op::OpDefBuilderWrapper<true>::Input(tensorflow::StringPiece) in hungarian-df3b79.o
"tensorflow::OpDefBuilder::Output(tensorflow::StringPiece)", referenced from:
tensorflow::register_op::OpDefBuilderWrapper<true>::Output(tensorflow::StringPiece) in hungarian-df3b79.o
"tensorflow::OpDefBuilder::OpDefBuilder(tensorflow::StringPiece)", referenced from:
tensorflow::register_op::OpDefBuilderWrapper<true>::OpDefBuilderWrapper(char const*) in hungarian-df3b79.o
"tensorflow::kernel_factory::OpKernelRegistrar::InitInternal(tensorflow::KernelDef const*, tensorflow::StringPiece, tensorflow::OpKernel* (*)(tensorflow::OpKernelConstruction*))", referenced from:
tensorflow::kernel_factory::OpKernelRegistrar::OpKernelRegistrar(tensorflow::KernelDef const*, tensorflow::StringPiece, tensorflow::OpKernel* (*)(tensorflow::OpKernelConstruction*)) in hungarian-df3b79.o
"tensorflow::OpKernelContext::allocate_output(int, tensorflow::TensorShape const&, tensorflow::Tensor**)", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
"tensorflow::OpKernelContext::CtxFailureWithWarning(tensorflow::Status)", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
"tensorflow::OpKernelContext::input(int)", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
"tensorflow::KernelDefBuilder::Device(char const*)", referenced from:
___cxx_global_var_init.7 in hungarian-df3b79.o
"tensorflow::KernelDefBuilder::KernelDefBuilder(char const*)", referenced from:
tensorflow::register_kernel::Name::Name(char const*) in hungarian-df3b79.o
"tensorflow::OpDef::~OpDef()", referenced from:
tensorflow::OpRegistrationData::~OpRegistrationData() in hungarian-df3b79.o
"tensorflow::OpKernel::OpKernel(tensorflow::OpKernelConstruction*)", referenced from:
HungarianOp::HungarianOp(tensorflow::OpKernelConstruction*) in hungarian-df3b79.o
"tensorflow::OpKernel::~OpKernel()", referenced from:
HungarianOp::~HungarianOp() in hungarian-df3b79.o
"tensorflow::internal::LogMessage::LogMessage(char const*, int, int)", referenced from:
HungarianOp::MinWeightedBipartiteCover(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*) in hungarian-df3b79.o
"tensorflow::internal::LogMessage::~LogMessage()", referenced from:
HungarianOp::MinWeightedBipartiteCover(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*) in hungarian-df3b79.o
"tensorflow::internal::LogMessageFatal::LogMessageFatal(char const*, int)", referenced from:
tensorflow::core::RefCounted::~RefCounted() in hungarian-df3b79.o
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
tensorflow::TensorShape::dims() const in hungarian-df3b79.o
HungarianOp::MinWeightedBipartiteCover(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*) in hungarian-df3b79.o
HungarianOp::MaxFlow(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&) in hungarian-df3b79.o
HungarianOp::Augment(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>&, Eigen::Matrix<float, -1, -1, 1, -1, -1>&) in hungarian-df3b79.o
tensorflow::KernelDefBuilder::~KernelDefBuilder() in hungarian-df3b79.o
...
"tensorflow::internal::LogMessageFatal::~LogMessageFatal()", referenced from:
tensorflow::core::RefCounted::~RefCounted() in hungarian-df3b79.o
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
tensorflow::TensorShape::dims() const in hungarian-df3b79.o
HungarianOp::MinWeightedBipartiteCover(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*, Eigen::Matrix<float, -1, -1, 1, -1, -1>*) in hungarian-df3b79.o
HungarianOp::MaxFlow(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&) in hungarian-df3b79.o
HungarianOp::Augment(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, Eigen::Matrix<float, -1, -1, 1, -1, -1>&, Eigen::Matrix<float, -1, -1, 1, -1, -1>&) in hungarian-df3b79.o
tensorflow::KernelDefBuilder::~KernelDefBuilder() in hungarian-df3b79.o
...
"tensorflow::internal::CheckOpMessageBuilder::ForVar2()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* tensorflow::internal::MakeCheckOpString<int, int>(int const&, int const&, char const*) in hungarian-df3b79.o
"tensorflow::internal::CheckOpMessageBuilder::NewString()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* tensorflow::internal::MakeCheckOpString<int, int>(int const&, int const&, char const*) in hungarian-df3b79.o
"tensorflow::internal::CheckOpMessageBuilder::CheckOpMessageBuilder(char const*)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* tensorflow::internal::MakeCheckOpString<int, int>(int const&, int const&, char const*) in hungarian-df3b79.o
"tensorflow::internal::CheckOpMessageBuilder::~CheckOpMessageBuilder()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >* tensorflow::internal::MakeCheckOpString<int, int>(int const&, int const&, char const*) in hungarian-df3b79.o
"tensorflow::TensorShape::CheckDimsEqual(int) const", referenced from:
Eigen::DSizes<long, 3> tensorflow::TensorShape::AsEigenDSizes<3>() const in hungarian-df3b79.o
Eigen::DSizes<long, 2> tensorflow::TensorShape::AsEigenDSizes<2>() const in hungarian-df3b79.o
"tensorflow::TensorShape::CheckDimsAtLeast(int) const", referenced from:
Eigen::DSizes<long, 3> tensorflow::TensorShape::AsEigenDSizesWithPadding<3>() const in hungarian-df3b79.o
Eigen::DSizes<long, 2> tensorflow::TensorShape::AsEigenDSizesWithPadding<2>() const in hungarian-df3b79.o
"tensorflow::TensorShape::dim_size(int) const", referenced from:
HungarianOp::Compute(tensorflow::OpKernelContext*) in hungarian-df3b79.o
HungarianOp::ComputeHungarianBatch(tensorflow::Tensor const&, tensorflow::Tensor*, tensorflow::Tensor*, tensorflow::Tensor*) in hungarian-df3b79.o
HungarianOp::ComputeHungarian(tensorflow::Tensor const&, tensorflow::Tensor*, tensorflow::Tensor*, tensorflow::Tensor*) in hungarian-df3b79.o
Eigen::DSizes<long, 3> tensorflow::TensorShape::AsEigenDSizesWithPadding<3>() const in hungarian-df3b79.o
HungarianOp::CopyInput(tensorflow::Tensor const&) in hungarian-df3b79.o
HungarianOp::CopyOutput(Eigen::Matrix<float, -1, -1, 1, -1, -1> const&, tensorflow::Tensor*) in hungarian-df3b79.o
Eigen::DSizes<long, 2> tensorflow::TensorShape::AsEigenDSizesWithPadding<2>() const in hungarian-df3b79.o
...
"tensorflow::Tensor::tensor_data() const", referenced from:
HungarianOp::CopyInput(tensorflow::Tensor const&) in hungarian-df3b79.o
"tensorflow::Tensor::CheckTypeAndIsAligned(tensorflow::DataType) const", referenced from:
tensorflow::TTypes<float, 3ul, long>::ConstTensor tensorflow::Tensor::tensor<float, 3ul>() const in hungarian-df3b79.o
tensorflow::TTypes<float, 3ul, long>::Tensor tensorflow::Tensor::tensor<float, 3ul>() in hungarian-df3b79.o
tensorflow::TTypes<float, 2ul, long>::Tensor tensorflow::Tensor::tensor<float, 2ul>() in hungarian-df3b79.o
"typeinfo for tensorflow::OpKernel", referenced from:
typeinfo for HungarianOp in hungarian-df3b79.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Googling and searching on their issues I have found that on Mac I need to use ./hungarian_build.sh -undefined dynamic_lookup. However, also this does not work. The error is still the same.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
