Paddle2ONNX icon indicating copy to clipboard operation
Paddle2ONNX copied to clipboard

Cannot build on Jetson Xavier AGX with JetPack 5.1

Open GiorgosBetsos opened this issue 1 year ago • 0 comments

I have followed the instructions found here: https://github.com/PaddlePaddle/Paddle2ONNX/blob/develop/docs/zh/compile.md

I get below error when I try to: python setup.py install

[100%] Linking CXX shared module paddle2onnx_cpp2py_export.cpython-38-aarch64-linux-gnu.so /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): in function google::protobuf::EnumDescriptor::CopyTo(google::protobuf::EnumDescriptorProto*) const': (.text+0x390c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): in function google::protobuf::Descriptor::CopyTo(google::protobuf::DescriptorProto*) const': (.text+0xdf9c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): in function google::protobuf::FileDescriptor::CopyTo(google::protobuf::FileDescriptorProto*) const': (.text+0xe1fc): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.o): in function google::protobuf::internal::ArenaStringPtr::CreateInstance(google::protobuf::Arena*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const*)': (.text._ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE[_ZN6google8protobuf8internal14ArenaStringPtr14CreateInstanceEPNS0_5ArenaEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE]+0x110): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(int128.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZNKSt5ctypeIcE8do_widenEc' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(int128.o): in function google::protobuf::operator<<(std::ostream&, google::protobuf::uint128 const&)': (.text+0xadc): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(int128.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZNKSt5ctypeIcE8do_widenEc' which may bind externally can not be used when making a shared object; recompile with -fPIC (.text+0xb14): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(int128.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZNKSt5ctypeIcE8do_widenEc' which may bind externally can not be used when making a shared object; recompile with -fPIC (.text+0xb4c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(int128.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZNKSt5ctypeIcE8do_widenEc' which may bind externally can not be used when making a shared object; recompile with -fPIC (.text+0xb78): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): in function google::protobuf::EnumDescriptorProto::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': (.text+0x1d934): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): in function google::protobuf::DescriptorProto::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': (.text+0x1ff5c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): in function google::protobuf::SourceCodeInfo_Location::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': (.text+0x209e4): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(descriptor.pb.o): in function google::protobuf::FileDescriptorProto::MergePartialFromCodedStream(google::protobuf::io::CodedInputStream*)': (.text+0x21650): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(generated_message_reflection.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(generated_message_reflection.o): in function google::protobuf::internal::GeneratedMessageReflection::AddString(google::protobuf::Message*, google::protobuf::FieldDescriptor const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const': (.text+0xc854): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(generated_message_reflection.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(generated_message_reflection.o): in function void google::protobuf::internal::RepeatedPtrFieldBase::MergeFromInnerLoop<google::protobuf::internal::GenericTypeHandler<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(void**, void**, int, int)': (.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase18MergeFromInnerLoopINS1_18GenericTypeHandlerINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEEvPPvSD_ii[_ZN6google8protobuf8internal20RepeatedPtrFieldBase18MergeFromInnerLoopINS1_18GenericTypeHandlerINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEEEEEvPPvSD_ii]+0x7c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(message.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(message.o): in function void google::protobuf::internal::RepeatedPtrFieldBase::AddAllocatedSlowWithCopy<google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::TypeHandler>(google::protobuf::RepeatedPtrField<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::TypeHandler::Type*, google::protobuf::Arena*, google::protobuf::Arena*)': (.text._ZN6google8protobuf8internal20RepeatedPtrFieldBase24AddAllocatedSlowWithCopyINS0_16RepeatedPtrFieldINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE11TypeHandlerEEEvPNT_4TypeEPNS0_5ArenaESH_[_ZN6google8protobuf8internal20RepeatedPtrFieldBase24AddAllocatedSlowWithCopyINS0_16RepeatedPtrFieldINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEE11TypeHandlerEEEvPNT_4TypeEPNS0_5ArenaESH_]+0x1e4): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(extension_set.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(extension_set.o): in function google::protobuf::internal::ExtensionSet::MutableString[abi:cxx11](int, unsigned char, google::protobuf::FieldDescriptor const*)': (.text+0xd40c): dangerous relocation: unsupported relocation /usr/bin/ld: /usr/lib/aarch64-linux-gnu/libprotobuf.a(extension_set.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against symbol _ZTINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' which may bind externally can not be used when making a shared object; recompile with -fPIC /usr/lib/aarch64-linux-gnu/libprotobuf.a(extension_set.o): in function `google::protobuf::internal::ExtensionSet::AddString[abi:cxx11](int, unsigned char, google::protobuf::FieldDescriptor const*)': (.text+0xd7a0): dangerous relocation: unsupported relocation collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/paddle2onnx_cpp2py_export.dir/build.make:1910: paddle2onnx_cpp2py_export.cpython-38-aarch64-linux-gnu.so] Error 1 make[1]: *** [CMakeFiles/Makefile2:206: CMakeFiles/paddle2onnx_cpp2py_export.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 Traceback (most recent call last): File "setup.py", line 299, in setuptools.setup( File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/init.py", line 145, in setup return distutils.core.setup(**attrs) File "/usr/lib/python3.8/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/command/install.py", line 67, in run self.do_egg_install() File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/command/install.py", line 109, in do_egg_install self.run_command('bdist_egg') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 172, in run cmd = self.call_command('install_lib', warn_dir=0) File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command self.run_command(cmdname) File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/home/nvidia/envs/paddle/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 23, in run self.build() File "/usr/lib/python3.8/distutils/command/install_lib.py", line 107, in build self.run_command('build_py') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 204, in run self.run_command('cmake_build') File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command cmd_obj.run() File "setup.py", line 198, in run subprocess.check_call(build_args) File "/usr/lib/python3.8/subprocess.py", line 364, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/home/nvidia/.local/bin/cmake', '--build', '.', '--', '-j', '8']' returned non-zero exit status 2.

GiorgosBetsos avatar May 22 '23 08:05 GiorgosBetsos