Open baoleai opened 2 years ago
Hi, when I build as follows
$ cd tensorpipe $ mkdir build $ cd build $ cmake ../ -GNinja -DTP_BUILD_TESTING=ON $ ninja
I got the following errors:
FAILED: tensorpipe/test/channel/cma/tensorpipe_channel_cma_probe tensorpipe/libtensorpipe.a(context_impl.cc.o): In function std::thread::thread<void (tensorpipe::channel::cma::ContextImpl::*)(), tensorpipe::channel::cma::ContextImpl*>(void (tensorpipe::channel::cma::ContextImpl::*&&)(), tensorpipe::channel::cma::ContextImpl*&&)': context_impl.cc:(.text._ZNSt6threadC2IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_[_ZNSt6threadC5IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_]+0x33): undefined reference topthread_create' tensorpipe/libtensorpipe.a(system.cc.o): In function tensorpipe::setThreadName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': system.cc:(.text+0x1aa2): undefined reference topthread_setname_np' collect2: error: ld returned 1 exit status
std::thread::thread<void (tensorpipe::channel::cma::ContextImpl::*)(), tensorpipe::channel::cma::ContextImpl*>(void (tensorpipe::channel::cma::ContextImpl::*&&)(), tensorpipe::channel::cma::ContextImpl*&&)': context_impl.cc:(.text._ZNSt6threadC2IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_[_ZNSt6threadC5IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_]+0x33): undefined reference to
tensorpipe::setThreadName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': system.cc:(.text+0x1aa2): undefined reference to
My env is glibc 2.27 and g++ 7.5.
Fixed this problem by adding pthread in https://github.com/pytorch/tensorpipe/blob/main/tensorpipe/test/channel/cma/CMakeLists.txt#L12
pthread
Hi, when I build as follows
I got the following errors:
FAILED: tensorpipe/test/channel/cma/tensorpipe_channel_cma_probe tensorpipe/libtensorpipe.a(context_impl.cc.o): In function
std::thread::thread<void (tensorpipe::channel::cma::ContextImpl::*)(), tensorpipe::channel::cma::ContextImpl*>(void (tensorpipe::channel::cma::ContextImpl::*&&)(), tensorpipe::channel::cma::ContextImpl*&&)': context_impl.cc:(.text._ZNSt6threadC2IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_[_ZNSt6threadC5IMN10tensorpipe7channel3cma11ContextImplEFvvEJPS4_EEEOT_DpOT0_]+0x33): undefined reference to
pthread_create' tensorpipe/libtensorpipe.a(system.cc.o): In functiontensorpipe::setThreadName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)': system.cc:(.text+0x1aa2): undefined reference to
pthread_setname_np' collect2: error: ld returned 1 exit statusMy env is glibc 2.27 and g++ 7.5.