tensorpipe icon indicating copy to clipboard operation
tensorpipe copied to clipboard

Redefinition of 'struct prctl_mm_map'

Open sanmai-NL opened this issue 2 years ago • 1 comments

When linking against musl libc (any version):

FAILED: third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/channel/cma/context_impl.cc.o 
/usr/bin/c++  -I/opt/ai/pytorch/cmake/../third_party/benchmark/include -I/opt/ai/pytorch/third_party/tensorpipe -I/opt/ai/pytorch/build/third_party/tensorpipe -I/opt/ai/pytorch/third_party/tensorpipe/third_party/libnop/include -I/opt/ai/pytorch/third_party/tensorpipe/third_party/libuv/include -isystem /opt/ai/pytorch/cmake/../third_party/googletest/googlemock/include -isystem /opt/ai/pytorch/cmake/../third_party/googletest/googletest/include -isystem /opt/ai/pytorch/third_party/protobuf/src -isystem /opt/ai/pytorch/third_party/gemmlowp -isystem /opt/ai/pytorch/third_party/neon2sse -isystem /opt/ai/pytorch/third_party/XNNPACK/include -isystem /opt/ai/pytorch/third_party/ittapi/include -isystem /opt/ai/pytorch/cmake/../third_party/eigen -Wno-error=maybe-uninitialized -Wno-error=uninitialized -Wno-error=restrict -D_GLIBCXX_USE_CXX11_ABI=1 -Wno-deprecated -fvisibility-inlines-hidden -DUSE_PTHREADPOOL -O3 -DNDEBUG -std=gnu++14 -fPIC -MD -MT third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/channel/cma/context_impl.cc.o -MF third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/channel/cma/context_impl.cc.o.d -o third_party/tensorpipe/tensorpipe/CMakeFiles/tensorpipe.dir/channel/cma/context_impl.cc.o -c /opt/ai/pytorch/third_party/tensorpipe/tensorpipe/channel/cma/context_impl.cc
In file included from /opt/ai/pytorch/third_party/tensorpipe/tensorpipe/channel/cma/context_impl.cc:12:
/usr/include/sys/prctl.h:88:8: error: redefinition of 'struct prctl_mm_map'
   88 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~
In file included from /opt/ai/pytorch/third_party/tensorpipe/tensorpipe/channel/cma/context_impl.cc:11:
/usr/include/linux/prctl.h:134:8: note: previous definition of 'struct prctl_mm_map'
  134 | struct prctl_mm_map {
      |        ^~~~~~~~~~~~

Fix

Include <sys/prctl.h> instead of <linux/prctl.h>

sanmai-NL avatar May 17 '23 16:05 sanmai-NL

Indeed I agree with your proposed fix, I don't see any reason to include linux/prctl.h over sys/prctl.h.

If you can submit a PR I'll happily merge it.

lw avatar May 22 '23 13:05 lw