Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

undefined reference to `caffe2::GetEmptyStringAlreadyInited[abi:cxx11]()'  #2558

Description

@chinmayjoshi24

I am trying to cross compile caffe2 and generate a binary for my platform.
I have successfully generated libcaffe2.so.
But while compiling the code facing few issue:

/tmp/ccIOey60.o: In function caffe2::Argument::set_name(char const*)':
temp.cpp:(.text._ZN6caffe28Argument8set_nameEPKc[_ZN6caffe28Argument8set_nameEPKc]+0x24): undefined reference to caffe2::GetEmptyStringAlreadyInited[abi:cxx11]()' /tmp/ccIOey60.o: In function caffe2::OperatorDef::set_type(char const*)':
temp.cpp:(.text._ZN6caffe211OperatorDef8set_typeEPKc[_ZN6caffe211OperatorDef8set_typeEPKc]+0x24): undefined reference to caffe2::GetEmptyStringAlreadyInited[abi:cxx11]()' /tmp/ccIOey60.o: In function caffe2::NetDef::nameabi:cxx11 const':
temp.cpp:(.text._ZNK6caffe26NetDef4nameB5cxx11Ev[_ZNK6caffe26NetDef4nameB5cxx11Ev]+0x18): undefined reference to caffe2::GetEmptyStringAlreadyInited[abi:cxx11]()' /tmp/ccIOey60.o: In function caffe2::NetDef::set_name(char const*)':
temp.cpp:(.text._ZN6caffe26NetDef8set_nameEPKc[_ZN6caffe26NetDef8set_nameEPKc]+0x24): undefined reference to caffe2::GetEmptyStringAlreadyInited[abi:cxx11]()' /tmp/ccIOey60.o: In function std::default_deletecaffe2::ThreadPool::operator()(caffe2::ThreadPool*) const':
temp.cpp:(.text.ZNKSt14default_deleteIN6caffe210ThreadPoolEEclEPS1[ZNKSt14default_deleteIN6caffe210ThreadPoolEEclEPS1]+0x24): undefined reference to caffe2::ThreadPool::~ThreadPool()' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to int caffe2::ArgumentHelper::GetSingleArgument(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int const&) const'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > caffe2::ArgumentHelper::GetRepeatedArgument<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const' /homehost/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::DeviceTypeName[abi:cxx11](int const&)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to bool caffe2::ArgumentHelper::GetSingleArgument<bool>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_bind'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Axpy<float, caffe2::CPUContext>(int, float, float const*, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::MurmurHash3_x64_128(void const*, int, unsigned int, void*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > caffe2::ArgumentHelper::GetSingleArgument<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Div<float, caffe2::CPUContext>(int, float const*, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::CpuId::f7b_' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_node_of_cpu'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ArgumentHelper::ArgumentHelper(caffe2::OperatorDef const&)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ThreadPool::defaultThreadPool()'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to std::vector<float, std::allocator<float> > caffe2::ArgumentHelper::GetRepeatedArgument<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<float, std::allocator<float> > const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::ReduceMax<float, caffe2::CPUContext>(int, float const*, float*, caffe2::Tensorcaffe2::CPUContext, caffe2::CPUContext)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Scale<float, caffe2::CPUContext>(int, float, float const*, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe::GetEmptyStringAlreadyInitedabi:cxx11'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_allocate_nodemask' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to std::vector<int, std::allocator > caffe2::ArgumentHelper::GetRepeatedArgument(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::vector<int, std::allocator > const&) const'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ArgumentHelper::HasArgument(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to bool caffe2::ArgumentHelper::HasSingleArgumentOfType<std::__cxx11::basic_string<char, std::char_traits, std::allocator > >(std::_cxx11::basic_string<char, std::char_traits, std::allocator > const&) const'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Log<float, caffe2::CPUContext>(int, float const*, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Mul<float, caffe2::CPUContext>(int, float const*, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::split(char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::IsSameDevice(caffe2::DeviceOption const&, caffe2::DeviceOption const&)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_num_configured_nodes' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::CpuId::f1c
'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::SmartTensorPrinter::PrintTensor(caffe2::Tensor<caffe2::CPUContext> const&)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::ReduceMin<float, caffe2::CPUContext>(int, float const*, float*, caffe2::Tensorcaffe2::CPUContext, caffe2::CPUContext)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::TextFormat::ParseFromString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::Message*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_bitmask_setbit'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_bitmask_free' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_max_node'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::RandUniform<float, caffe2::CPUContext>(unsigned int, float, float, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Exp<float, caffe2::CPUContext>(int, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Maximum<float, caffe2::CPUContext>(int, float, float const*, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::CopyVector<float, caffe2::CPUContext>(int, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ReadProtoFromBinaryFile(char const*, google::protobuf::MessageLite*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Sqrt<float, caffe2::CPUContext>(int, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::WriteProtoToBinaryFile(google::protobuf::MessageLite const&, char const*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Sub<float, caffe2::CPUContext>(int, float const*, float const*, float*, caffe2::CPUContext*)'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to long long caffe2::ArgumentHelper::GetSingleArgument<long long>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long long const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to get_mempolicy'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Set<bool, caffe2::CPUContext>(unsigned int, bool, bool*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to mbind'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ReadProtoFromTextFile(char const*, google::protobuf::Message*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::GetCpuId()'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to void caffe2::math::Dot<float, caffe2::CPUContext>(int, float const*, float const*, float*, caffe2::CPUContext*)' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_available'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to float caffe2::ArgumentHelper::GetSingleArgument<float>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, float const&) const' /home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to numa_bitmask_clearall'
/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib/libcaffe2.so: undefined reference to caffe2::ProtoDebugString[abi:cxx11](google::protobuf::Message const&)' collect2: error: ld returned 1 exit status

Here is the command for compilation:
/home/host/usr/bin/arm-linux-gnueabihf-g++ temp.cpp -o temp -std=c++11 -I/home/chinmay/ip-cross/caffe2/build/include -L/home/host/usr/lib -L/home/host/opt/ext-toolchain/arm-linux-gnueabihf/lib -lgflags -lglog -lprotobuf -lcaffe2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions