wesyoung / pyzyre

higher level bundled pythonic bindings for Zyre
https://github.com/zeromq/zyre
Mozilla Public License 2.0
1 stars 4 forks source link

Fails to build on linux: "More than one ZMQ_USE_* defined" #15

Closed cwacekINV closed 7 years ago

cwacekINV commented 7 years ago

Platform: Linux 425c93cbeacd 4.4.27-moby #1 SMP Wed Oct 26 14:21:29 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux Distro: Ubuntu 16.04 (from Docker ubuntu:16.04 image)

Error:

root@425c93cbeacd:/build# python setup.py build_ext
running build_ext
running configure_zmq
************************************************
Using bundled libzmq
already have bundled/zeromq
already have platform.hpp
************************************************
checking for timer_create
cc -c /tmp/timer_createnBrPLU.c -o build/temp.linux-x86_64-2.7/tmp/timer_createnBrPLU.o
/tmp/timer_createnBrPLU.c:1:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main (int argc, char **argv) {
 ^
/tmp/timer_createnBrPLU.c: In function 'main':
/tmp/timer_createnBrPLU.c:2:5: warning: implicit declaration of function 'timer_create' [-Wimplicit-function-declaration]
     timer_create();
     ^
cc build/temp.linux-x86_64-2.7/tmp/timer_createnBrPLU.o -o build/temp.linux-x86_64-2.7/a.out
build/temp.linux-x86_64-2.7/tmp/timer_createnBrPLU.o: In function `main':
timer_createnBrPLU.c:(.text+0x15): undefined reference to `timer_create'
collect2: error: ld returned 1 exit status
no timer_create, linking librt
running configure_czmq
************************************************
Using bundled libczmq
already have bundled/czmq
already have platform.h
running configure
************************************************
Using bundled libzyre
already have bundled/zyre
already have platform.h
building 'czmq.libzmq' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled/zeromq/tweetnacl/src -Ibundled/zeromq/tweetnacl/contrib/randombytes -Ibundled -I/usr/include/python2.7 -c buildutils/zmq/initlibzmq.c -o build/temp.linux-x86_64-2.7/buildutils/zmq/initlibzmq.o
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled/zeromq/tweetnacl/src -Ibundled/zeromq/tweetnacl/contrib/randombytes -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/address.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/address.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled/zeromq/tweetnacl/src -Ibundled/zeromq/tweetnacl/contrib/randombytes -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/clock.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/clock.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DZMQ_HAVE_CURVE=1 -DZMQ_USE_TWEETNACL=1 -DZMQ_USE_EPOLL=1 -Ibundled/zeromq/include -Ibundled/zeromq/tweetnacl/src -Ibundled/zeromq/tweetnacl/contrib/randombytes -Ibundled -I/usr/include/python2.7 -c bundled/zeromq/src/ctx.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/ctx.o
cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
In file included from bundled/zeromq/src/socket_base.hpp:41:0,
                 from bundled/zeromq/src/ctx.cpp:42:
bundled/zeromq/src/poller.hpp:42:2: error: #error More than one of the ZMQ_USE_* macros defined
 #error More than one of the ZMQ_USE_* macros defined
  ^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
wesyoung commented 7 years ago

what does your Dockerfile look like, wondering if you're missing some apt-get stuff. my Vagrantfile looks like (and not sure why it didn't make it into the repo) .. ignore the py3 deps:

#e -*- mode: ruby -*-
# vi: set ft=ruby :

# This will setup a clean Ubuntu1404 LTS env

$script = <<SCRIPT
add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo add-apt-repository ppa:fkrull/deadsnakes
sudo add-apt-repository ppa:cython-dev/master-ppa
apt-get update
apt-get install -y python3.5 python3.5-dev python-pip python-dev python3-dev git htop virtualenvwrapper python2.7 python-virtualenv python-support cython git build-essential libtool pkg-config autotools-dev autoconf automake cmake libpcre3-dev valgrind libffi-dev zip uuid-dev
SCRIPT

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_LOCAL = 'Vagrantfile.local'

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = 'ubuntu/trusty64'
  config.vm.provision "shell", inline: $script

  config.vm.provider :virtualbox do |vb, override|
    vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "512" ]
  end

  config.vm.provider :aws do |aws|
    aws.tags = { 'Name' => 'pyzyre' }
  end

  if File.file?(VAGRANTFILE_LOCAL)
    external = File.read VAGRANTFILE_LOCAL
    eval external
  end
end
wesyoung commented 7 years ago

also, just added it.. can add a docker one too as a template..

https://github.com/wesyoung/pyzyre/blob/master/Vagrantfile

cwacekINV commented 7 years ago

Fails on 14.04 as well. Here's the Dockerfile:

FROM ubuntu:14.04

RUN apt-get update && apt-get install -y python python-dev build-essential libuuid1 uuid-dev python-pip

RUN pip install -U pip wheel setuptools

COPY . /build
RUN pip install -r build/requirements.txt

WORKDIR /build

RUN python setup.py build_ext