I got many undefine error when I compile libtorch

WangTingZheng: <p>I use this libtorch in Leveldb:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/f/2/f2f636f5fce8118c145f7e46b3b2931827b1b76f.png" data-download-href="https://discuss.pytorch.org/uploads/default/f2f636f5fce8118c145f7e46b3b2931827b1b76f" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/f/2/f2f636f5fce8118c145f7e46b3b2931827b1b76f_2_690x389.png" alt="image" data-base62-sha1="yFl3K8V5uB5CSM6DthtP5laiDvx" width="690" height="389" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/f/2/f2f636f5fce8118c145f7e46b3b2931827b1b76f_2_690x389.png, https://discuss.pytorch.org/uploads/default/optimized/3X/f/2/f2f636f5fce8118c145f7e46b3b2931827b1b76f_2_1035x583.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/f/2/f2f636f5fce8118c145f7e46b3b2931827b1b76f.png 2x" data-dominant-color="F5DCD9"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1073×606 36.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>I use C++17 for libtorch:</p>
<pre data-code-wrap="C++"><code class="lang-C++"># C++ standard can be overridden when this is used as a sub-project.
if(NOT CMAKE_CXX_STANDARD)
  # This project requires C++11.
  set(CMAKE_CXX_STANDARD 17)
  set(CMAKE_CUDA_STANDARD 14)
  set(CMAKE_CUDA_STANDARD_REQUIRED TRUE)
  set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  set(CMAKE_CXX_EXTENSIONS OFF)
endif(NOT CMAKE_CXX_STANDARD)
</code></pre>
<p>and leveldb can be built and all unit test and db_bench is passed</p>
<p>But when I linked leveldb to ycsb-cpp, I got a lots of undefine error just like this:</p>
<pre><code class="lang-auto">/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(times_collecter.cc.o): in function `leveldb::TimesCollecter::~TimesCollecter()':
times_collecter.cc:(.text+0x2e9): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: times_collecter.cc:(.text+0x3cc): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: times_collecter.cc:(.text+0x518): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: times_collecter.cc:(.text+0x541): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: times_collecter.cc:(.text+0x595): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(times_collecter.cc.o):times_collecter.cc:(.text+0x5bd): more undefined references to `c10::UndefinedTensorImpl::_singleton' follow
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `leveldb::Module::Module(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)':
module.cc:(.text+0x181): undefined reference to `torch::cuda::is_available()'
/usr/bin/ld: module.cc:(.text+0x1b5): undefined reference to `torch::jit::load(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, std::optional&lt;c10::Device&gt;, bool)'
/usr/bin/ld: module.cc:(.text+0x2a8): undefined reference to `torch::jit::Module::to(c10::Device, bool)'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `leveldb::Module::forward(std::deque&lt;float, std::allocator&lt;float&gt; &gt;)':
module.cc:(.text+0x730): undefined reference to `c10::impl::ExcludeDispatchKeyGuard::ExcludeDispatchKeyGuard(c10::DispatchKeySet)'
/usr/bin/ld: module.cc:(.text+0x7d3): undefined reference to `at::_ops::ones::call(c10::ArrayRef&lt;c10::SymInt&gt;, std::optional&lt;c10::ScalarType&gt;, std::optional&lt;c10::Layout&gt;, std::optional&lt;c10::Device&gt;, std::optional&lt;bool&gt;)'
/usr/bin/ld: module.cc:(.text+0x817): undefined reference to `c10::impl::ExcludeDispatchKeyGuard::~ExcludeDispatchKeyGuard()'
/usr/bin/ld: module.cc:(.text+0x88d): undefined reference to `at::_ops::mean::call(at::Tensor const&amp;, std::optional&lt;c10::ScalarType&gt;)'
/usr/bin/ld: module.cc:(.text+0x8d3): undefined reference to `at::_ops::std_correction::call(at::Tensor const&amp;, c10::OptionalArrayRef&lt;long&gt;, std::optional&lt;c10::Scalar&gt; const&amp;, bool)'
/usr/bin/ld: module.cc:(.text+0x90f): undefined reference to `at::_ops::sub__Tensor::call(at::Tensor&amp;, at::Tensor const&amp;, c10::Scalar const&amp;)'
/usr/bin/ld: module.cc:(.text+0x91e): undefined reference to `at::_ops::div__Tensor::call(at::Tensor&amp;, at::Tensor const&amp;)'
/usr/bin/ld: module.cc:(.text+0x942): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text+0xb59): undefined reference to `torch::jit::Object::find_method(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;) const'
/usr/bin/ld: module.cc:(.text+0xbb7): undefined reference to `vtable for torch::jit::Method'
/usr/bin/ld: module.cc:(.text+0xc41): undefined reference to `torch::jit::Method::operator()(std::vector&lt;c10::IValue, std::allocator&lt;c10::IValue&gt; &gt;, std::unordered_map&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, c10::IValue, std::hash&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::equal_to&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; &gt;, std::allocator&lt;std::pair&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const, c10::IValue&gt; &gt; &gt; const&amp;) const'
/usr/bin/ld: module.cc:(.text+0xf0f): undefined reference to `at::_ops::mul__Tensor::call(at::Tensor&amp;, at::Tensor const&amp;)'
/usr/bin/ld: module.cc:(.text+0xf36): undefined reference to `at::_ops::add__Tensor::call(at::Tensor&amp;, at::Tensor const&amp;, c10::Scalar const&amp;)'
/usr/bin/ld: module.cc:(.text+0xf99): undefined reference to `at::_ops::mean::call(at::Tensor const&amp;, std::optional&lt;c10::ScalarType&gt;)'
/usr/bin/ld: module.cc:(.text+0xfea): undefined reference to `at::_ops::item::call(at::Tensor const&amp;)'
/usr/bin/ld: module.cc:(.text+0x1054): undefined reference to `c10::SymBool::guard_bool(char const*, long) const'
/usr/bin/ld: module.cc:(.text+0x108a): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x10eb): undefined reference to `at::_ops::select_int::call(at::Tensor const&amp;, long, c10::SymInt)'
/usr/bin/ld: module.cc:(.text+0x112a): undefined reference to `at::_ops::select_int::call(at::Tensor const&amp;, long, c10::SymInt)'
/usr/bin/ld: module.cc:(.text+0x114f): undefined reference to `at::_ops::fill__Scalar::call(at::Tensor&amp;, c10::Scalar const&amp;)'
/usr/bin/ld: module.cc:(.text+0x115d): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text+0x117c): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text+0x13cc): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)'
/usr/bin/ld: module.cc:(.text+0x16f5): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x1b1f): undefined reference to `c10::SymInt::guard_int(char const*, long) const'
/usr/bin/ld: module.cc:(.text+0x1b52): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x1ba1): undefined reference to `c10::IValue::reportToTensorTypeError() const'
/usr/bin/ld: module.cc:(.text+0x1c29): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x1c83): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x1cae): undefined reference to `c10::SymFloat::guard_float(char const*, long) const'
/usr/bin/ld: module.cc:(.text+0x1cea): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text+0x1d55): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text+0x1dc6): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;)'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::IValue::destroy()':
module.cc:(.text._ZN3c106IValue7destroyEv[_ZN3c106IValue7destroyEv]+0x26): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::IValue::IValue(c10::IValue::Payload const&amp;, c10::IValue::Tag)':
module.cc:(.text._ZN3c106IValueC2ERKNS0_7PayloadENS0_3TagE[_ZN3c106IValueC5ERKNS0_7PayloadENS0_3TagE]+0x23): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::IValue::IValue(c10::IValue const&amp;)':
module.cc:(.text._ZN3c106IValueC2ERKS0_[_ZN3c106IValueC5ERKS0_]+0x27): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `ska_ordered::detailv3::sherwood_v3_table&lt;std::pair&lt;c10::IValue, c10::IValue&gt;, c10::IValue, c10::detail::DictKeyHash, ska_ordered::detailv3::KeyOrValueHasher&lt;c10::IValue, std::pair&lt;c10::IValue, c10::IValue&gt;, c10::detail::DictKeyHash&gt;, c10::detail::DictKeyEqualTo, ska_ordered::detailv3::KeyOrValueEquality&lt;c10::IValue, std::pair&lt;c10::IValue, c10::IValue&gt;, c10::detail::DictKeyEqualTo&gt;, std::allocator&lt;std::pair&lt;c10::IValue, c10::IValue&gt; &gt;, std::allocator&lt;ska_ordered::detailv3::sherwood_v3_entry&lt;std::pair&lt;c10::IValue, c10::IValue&gt; &gt; &gt; &gt;::~sherwood_v3_table()':
module.cc:(.text._ZN11ska_ordered8detailv317sherwood_v3_tableISt4pairIN3c106IValueES4_ES4_NS3_6detail11DictKeyHashENS0_16KeyOrValueHasherIS4_S5_S7_EENS6_14DictKeyEqualToENS0_18KeyOrValueEqualityIS4_S5_SA_EESaIS5_ESaINS0_17sherwood_v3_entryIS5_EEEED2Ev[_ZN11ska_ordered8detailv317sherwood_v3_tableISt4pairIN3c106IValueES4_ES4_NS3_6detail11DictKeyHashENS0_16KeyOrValueHasherIS4_S5_S7_EENS6_14DictKeyEqualToENS0_18KeyOrValueEqualityIS4_S5_SA_EESaIS5_ESaINS0_17sherwood_v3_entryIS5_EEEED5Ev]+0x3c): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `std::vector&lt;c10::IValue, std::allocator&lt;c10::IValue&gt; &gt;::~vector()':
module.cc:(.text._ZNSt6vectorIN3c106IValueESaIS1_EED2Ev[_ZNSt6vectorIN3c106IValueESaIS1_EED5Ev]+0x24): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o):module.cc:(.text._ZNSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3c106IValueEESaISA_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSC_18_Mod_range_hashingENSC_20_Default_ranged_hashENSC_20_Prime_rehash_policyENSC_17_Hashtable_traitsILb1ELb0ELb1EEEED2Ev[_ZNSt10_HashtableINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt4pairIKS5_N3c106IValueEESaISA_ENSt8__detail10_Select1stESt8equal_toIS5_ESt4hashIS5_ENSC_18_Mod_range_hashingENSC_20_Default_ranged_hashENSC_20_Prime_rehash_policyENSC_17_Hashtable_traitsILb1ELb0ELb1EEEED5Ev]+0x21): more undefined references to `c10::UndefinedTensorImpl::_singleton' follow
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::Scalar::toSymFloat() const':
module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0xd5): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x142): undefined reference to `c10::SymBool::guard_bool(char const*, long) const'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x172): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x1a3): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x2cd): undefined reference to `c10::SymInt::guard_int(char const*, long) const'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x300): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar10toSymFloatEv[_ZNK3c106Scalar10toSymFloatEv]+0x367): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::Scalar::toSymInt() const':
module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0x46): undefined reference to `c10::SymInt::SymInt(c10::intrusive_ptr&lt;c10::SymNodeImpl, c10::detail::intrusive_target_default_null_type&lt;c10::SymNodeImpl&gt; &gt;)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0xb6): undefined reference to `c10::report_overflow(char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0xe0): undefined reference to `c10::SymInt::promote_to_negative()'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0x132): undefined reference to `c10::SymBool::guard_bool(char const*, long) const'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0x215): undefined reference to `c10::SymFloat::guard_float(char const*, long) const'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar8toSymIntEv[_ZNK3c106Scalar8toSymIntEv]+0x24d): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::Scalar::toSymBool() const':
module.cc:(.text._ZNK3c106Scalar9toSymBoolEv[_ZNK3c106Scalar9toSymBoolEv]+0xcc): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar9toSymBoolEv[_ZNK3c106Scalar9toSymBoolEv]+0x11b): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar9toSymBoolEv[_ZNK3c106Scalar9toSymBoolEv]+0x14d): undefined reference to `c10::SymFloat::guard_float(char const*, long) const'
/usr/bin/ld: module.cc:(.text._ZNK3c106Scalar9toSymBoolEv[_ZNK3c106Scalar9toSymBoolEv]+0x18d): undefined reference to `c10::SymInt::guard_int(char const*, long) const'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::intrusive_ptr&lt;c10::TensorImpl, c10::UndefinedTensorImpl&gt;::reset_()':
module.cc:(.text._ZN3c1013intrusive_ptrINS_10TensorImplENS_19UndefinedTensorImplEE6reset_Ev[_ZN3c1013intrusive_ptrINS_10TensorImplENS_19UndefinedTensorImplEE6reset_Ev]+0xa): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `std::_MakeUniq&lt;torch::autograd::AutogradMeta&gt;::__single_object std::make_unique&lt;torch::autograd::AutogradMeta, c10::TensorImpl*, bool&amp;&gt;(c10::TensorImpl*&amp;&amp;, bool&amp;)':
module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x29): undefined reference to `vtable for torch::autograd::AutogradMeta'
/usr/bin/ld: module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x34): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x153): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x17b): undefined reference to `c10::detail::torchCheckFail(char const*, char const*, unsigned int, char const*)'
/usr/bin/ld: module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x180): undefined reference to `caffe2::TypeMeta::error_unsupported_typemeta(caffe2::TypeMeta)'
/usr/bin/ld: module.cc:(.text._ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_[_ZSt11make_uniqueIN5torch8autograd12AutogradMetaEJPN3c1010TensorImplERbEENSt9_MakeUniqIT_E15__single_objectEDpOT0_]+0x20e): undefined reference to `c10::AutogradMetaInterface::~AutogradMetaInterface()'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `std::_Optional_payload_base&lt;torch::jit::Method&gt;::_M_reset()':
module.cc:(.text._ZNSt22_Optional_payload_baseIN5torch3jit6MethodEE8_M_resetEv[_ZNSt22_Optional_payload_baseIN5torch3jit6MethodEE8_M_resetEv]+0x13): undefined reference to `vtable for torch::jit::Method'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `torch::autograd::make_variable(at::Tensor, bool, bool)':
module.cc:(.text._ZN5torch8autograd13make_variableEN2at6TensorEbb[_ZN5torch8autograd13make_variableEN2at6TensorEbb]+0x14): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text._ZN5torch8autograd13make_variableEN2at6TensorEbb[_ZN5torch8autograd13make_variableEN2at6TensorEbb]+0xbf): undefined reference to `c10::TensorImpl::set_autograd_meta(std::unique_ptr&lt;c10::AutogradMetaInterface, std::default_delete&lt;c10::AutogradMetaInterface&gt; &gt;)'
/usr/bin/ld: module.cc:(.text._ZN5torch8autograd13make_variableEN2at6TensorEbb[_ZN5torch8autograd13make_variableEN2at6TensorEbb]+0x183): undefined reference to `c10::TensorImpl::set_autograd_meta(std::unique_ptr&lt;c10::AutogradMetaInterface, std::default_delete&lt;c10::AutogradMetaInterface&gt; &gt;)'
/usr/bin/ld: module.cc:(.text._ZN5torch8autograd13make_variableEN2at6TensorEbb[_ZN5torch8autograd13make_variableEN2at6TensorEbb]+0x29e): undefined reference to `c10::TensorImpl::set_autograd_meta(std::unique_ptr&lt;c10::AutogradMetaInterface, std::default_delete&lt;c10::AutogradMetaInterface&gt; &gt;)'
/usr/bin/ld: module.cc:(.text._ZN5torch8autograd13make_variableEN2at6TensorEbb[_ZN5torch8autograd13make_variableEN2at6TensorEbb]+0x2dd): undefined reference to `c10::TensorImpl::set_autograd_meta(std::unique_ptr&lt;c10::AutogradMetaInterface, std::default_delete&lt;c10::AutogradMetaInterface&gt; &gt;)'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `c10::Dict&lt;std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;, c10::List&lt;c10::IValue&gt; &gt;::Dict()':
module.cc:(.text._ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC2Ev[_ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC5Ev]+0x2c): undefined reference to `c10::StringType::get()'
/usr/bin/ld: module.cc:(.text._ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC2Ev[_ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC5Ev]+0x513): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text._ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC2Ev[_ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC5Ev]+0x613): undefined reference to `c10::UndefinedTensorImpl::_singleton'
/usr/bin/ld: module.cc:(.text._ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC2Ev[_ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC5Ev]+0x7d1): undefined reference to `c10::ListType::get(std::__cxx11::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt; const&amp;, c10::Type::SingletonOrSharedTypePtr&lt;c10::Type&gt;)'
/usr/bin/ld: module.cc:(.text._ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC2Ev[_ZN3c104DictINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEENS_4ListINS_6IValueEEEEC5Ev]+0x9d1): undefined reference to `c10::AnyType::get()'
/usr/bin/ld: /home/wangtingzheng_21/system/RallyDB/build/libleveldb.a(module.cc.o): in function `leveldb::Module::forward(std::deque&lt;float, std::allocator&lt;float&gt; &gt;) [clone .cold]':
module.cc:(.text.unlikely+0xff): undefined reference to `c10::impl::ExcludeDispatchKeyGuard::~ExcludeDispatchKeyGuard()'
collect2: error: ld returned 1 exit status
make: *** [Makefile:88: ycsb] Error 1
</code></pre>
<p>I try to use pre_cxx11 abi version, and add</p>
<pre data-code-wrap="C++"><code class="lang-C++">CXXFLAGS += -D_GLIBCXX_USE_CXX11_ABI=0 -g
</code></pre>
<p>to ycsb-cpp</p>
<p>add</p>
<pre><code class="lang-auto">set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=1")
</code></pre>
<p>to leveldb, but still build failed, why? And How can I passed the build?</p>