Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Redefinition of 'struct prctl_mm_map' #462

Open
sanmai-NL opened this issue May 17, 2023 · 1 comment
Open

Redefinition of 'struct prctl_mm_map' #462

sanmai-NL opened this issue May 17, 2023 · 1 comment

Comments

@sanmai-NL
Copy link

sanmai-NL commented May 17, 2023

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>

@lw
Copy link
Contributor

lw commented May 22, 2023

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants