nvdla / sw

NVDLA SW
Other
487 stars 193 forks source link

1ae4738f umd link fail #168

Open XiaPZ opened 5 years ago

XiaPZ commented 5 years ago

hi, on commit 1ae4738f, when constructing umd with make, it throws link error as below:
linking /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler.mod.o ld -r /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/main.o /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/CompileTest.o /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/GenerateTest.o /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/ParseTest.o -o /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler.mod.o building /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler g++ /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler.mod.o -L/home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler libprotobuf.a -lnvdla_compiler -pthread -o /home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler libprotobuf.a -Wl,-rpath=. /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to google::protobuf::DescriptorPool::FindFileByName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::Delete(std::cxx11::basic_string<char, std::char_traits, std::allocator >)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream, std::cxx11::basic_string<char, std::char_traits, std::allocator >)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const, void ()(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&))' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::io::CodedOutputStream)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference togoogle::protobuf::internal::StringTypeHandlerBase::New[abi:cxx11]()' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to google::protobuf::Message::GetTypeName[abi:cxx11]() const' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference togoogle::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, unsigned char*)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to google::protobuf::Message::InitializationErrorString[abi:cxx11]() const' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference togoogle::protobuf::internal::emptystring[abi:cxx11]' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::io::CodedOutputStream)' /home/xpz/github/nvdla/sw/umd/out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, google::protobuf::io::CodedOutputStream)' collect2: error: ld returned 1 exit status Makefile:48: recipe for target '/home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler' failed make[1]: [/home/xpz/github/nvdla/sw/umd/out/apps/compiler/nvdla_compiler/nvdla_compiler] Error 1 make[1]: Leaving directory '/home/xpz/github/nvdla/sw/umd/apps/compiler' Makefile:35: recipe for target 'compiler' failed make: [compiler] Error 2

gcc version 5.4.0

Erdbeerenjanzi commented 5 years ago

Looks like the linker could not find the libprotobuf. I had the same issue and fixed it by changing the last line of /umd/apps/compiler/Makefile as follows: g++ $(ALLMODULE_OBJS) -L$(ROOT)/apps/compiler -L$(ROOT)/out/core/src/compiler/libnvdla_compiler -l:libprotobuf.a -lnvdla_compiler -pthread -o $@ -l:libprotobuf.a -Wl,-rpath=.

Scriabing commented 4 years ago

Looks like the linker could not find the libprotobuf. I had the same issue and fixed it by changing the last line of /umd/apps/compiler/Makefile as follows: g++ $(ALLMODULE_OBJS) -L$(ROOT)/apps/compiler -L$(ROOT)/out/core/src/compiler/libnvdla_compiler -l:libprotobuf.a -lnvdla_compiler -pthread -o $@ -l:libprotobuf.a -Wl,-rpath=.

using this way,i get other error:

/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::StringTypeHandlerBase::New[abi:cxx11]()'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::Message::GetTypeName[abi:cxx11]() const'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned char*)'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::Message::InitializationErrorString[abi:cxx11]() const'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::empty_string_[abi:cxx11]'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)'
/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/core/src/compiler/libnvdla_compiler/libnvdla_compiler.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, google::protobuf::io::CodedOutputStream*)'
collect2: error: ld returned 1 exit status
Makefile:48: recipe for target '/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/apps/compiler/nvdla_compiler/nvdla_compiler' failed
make[1]: *** [/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd//out/apps/compiler/nvdla_compiler/nvdla_compiler] Error 1
make[1]: Leaving directory '/home/petalinux/Downloads/nvdla_sw_ukmd/sw/umd/apps/compiler'
Makefile:35: recipe for target 'compiler' failed
make: *** [compiler] Error 2

It is not working..