Unable to build manylinux1 wheel containing capnproto
I am attempting to build a manylinux1 wheel from the nupic.core project per PEP-513, which defines the manylinux1 policy. I am using the docker image quay.io/pypa/manylinux1_x86_64 created by https://github.com/pypa/manylinux to build the wheel. nupic.core builds and statically links against the capnproto library. Capnproto relies on signalfd.h by default. Per manylinux1 policy, the docker image quay.io/pypa/manylinux1_x86_64 is based on CentOS-5, which does not provide signalfd.h, so my build fails like this:
Linking CXX static library libkj.a
[ 27%] Built target kj
[ 29%] Building CXX object src/kj/CMakeFiles/kj-async.dir/async.c++.o
[ 30%] Building CXX object src/kj/CMakeFiles/kj-async.dir/async-unix.c++.o
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-unix.c++:36:26: fatal error: sys/signalfd.h: No such file or directory
#include <sys/signalfd.h>I even tried a capnproto-specific work-around to steer capnproto from using signalfd.h by setting -DKJ_USE_EPOLL=0. However, in that case, the build failed due to lack of other functions and constants in manylinux1/CentOS-5:
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++: In member function ‘int kj::{anonymous}::SocketAddress::socket(int) const’:
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++:348:13: error: ‘SOCK_NONBLOCK’ was not declared in this scope
type |= SOCK_NONBLOCK | SOCK_CLOEXEC;
^
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++:348:29: error: ‘SOCK_CLOEXEC’ was not declared in this scope
type |= SOCK_NONBLOCK | SOCK_CLOEXEC;
^
In file included from /nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++:24:0:
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++: In lambda function:
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++:648:38: error: ‘O_CLOEXEC’ was not declared in this scope
KJ_SYSCALL(pipe2(fds, O_NONBLOCK | O_CLOEXEC));
^
/nupic.core/build/scripts/ThirdParty/Source/CapnProto/src/kj/async-io.c++:648:47: error: ‘pipe2’ was not declared in this scope
KJ_SYSCALL(pipe2(fds, O_NONBLOCK | O_CLOEXEC));nupic.core doesn't make use of the async functionality. If capnproto provided a build flag to exclude async (async.c, async-io.c, async-unix.c, and friends) from compilation and linking, that would be one way to solve the problem (CAPNP_LITE excludes too much, so it doesn't help solve this problem)
Source: capnproto/capnproto