Hi there,
I could not manage to build libzmq on my CentOS 5.9
python --version
Python 2.7.4
cat /etc/redhat-release
CentOS release 5.9 (Final)
which python
/usr/local/uvcdat/1.3.3/bin/python
pip install pyzmq
Downloading/unpacking pyzmq
Running setup.py egg_info for package pyzmq
no previously-included directories found matching 'docs/build'
no previously-included directories found matching 'docs/gh-pages'
warning: no directories found matching 'bundled/uuid'
warning: no previously-included files found matching 'bundled/uuid/Makefile*'
warning: no previously-included files found matching 'bundled/zeromq/src/Makefile*'
warning: no previously-included files found matching 'setup.cfg'
warning: no previously-included files found matching 'zmq/libzmq*'
warning: no previously-included files matching '__pycache__/*' found anywhere in distribution
warning: no previously-included files matching '.deps/*' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
warning: no previously-included files matching '.git*' found anywhere in distribution
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '.mailmap' found anywhere in distribution
Installing collected packages: pyzmq
Running setup.py install for pyzmq
already have bundled/zeromq
already have platform.hpp
************************************************
Using bundled libzmq
cc -c /tmp/timer_createRiC0i7.c -o tmp/timer_createRiC0i7.o
cc tmp/timer_createRiC0i7.o -o a.out
tmp/timer_createRiC0i7.o: In function `main':
timer_createRiC0i7.c:(.text+0x15): undefined reference to `timer_create'
collect2: ld returned 1 exit status
************************************************
building 'zmq.libzmq' extension
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c buildutils/initlibzmq.c -o build/temp.linux-x86_64-2.7/buildutils/initlibzmq.o
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/object.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/object.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/ipc_address.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/ipc_address.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/io_object.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/io_object.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/dist.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/dist.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/router.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/router.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/push.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/push.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/signaler.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/signaler.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
bundled/zeromq/src/signaler.cpp:68:25: error: sys/eventfd.h: No such file or directory
bundled/zeromq/src/signaler.cpp: In static member function ‘static int zmq::signaler_t::make_fdpair(zmq::fd_t*, zmq::fd_t*)’:
bundled/zeromq/src/signaler.cpp:229: error: ‘eventfd’ was not declared in this scope
error: command 'gcc' failed with exit status 1
Complete output from command /usr/local/uvcdat/1.3.3/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/pyzmq/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-9FT_V2-record/install-record.txt --single-version-externally-managed:
running install
running build
running build_py
running build_ext
running configure
already have bundled/zeromq
already have platform.hpp
Using bundled libzmq
cc -c /tmp/timer_createRiC0i7.c -o tmp/timer_createRiC0i7.o
cc tmp/timer_createRiC0i7.o -o a.out
tmp/timer_createRiC0i7.o: In function `main':
timer_createRiC0i7.c:(.text+0x15): undefined reference to `timer_create'
collect2: ld returned 1 exit status
building 'zmq.libzmq' extension
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c buildutils/initlibzmq.c -o build/temp.linux-x86_64-2.7/buildutils/initlibzmq.o
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/object.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/object.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/ipc_address.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/ipc_address.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/io_object.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/io_object.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/dist.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/dist.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/router.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/router.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/push.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/push.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -I/usr/local/uvcdat/1.3.3/Externals/include -L/usr/local/uvcdat/1.3.3/Externals/lib -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ibundled/zeromq/include -Ibundled -I/usr/local/uvcdat/1.3.3/include/python2.7 -c bundled/zeromq/src/signaler.cpp -o build/temp.linux-x86_64-2.7/bundled/zeromq/src/signaler.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
bundled/zeromq/src/signaler.cpp:68:25: error: sys/eventfd.h: No such file or directory
bundled/zeromq/src/signaler.cpp: In static member function ‘static int zmq::signaler_t::make_fdpair(zmq::fd_t_, zmq::fd_t_)’:
bundled/zeromq/src/signaler.cpp:229: error: ‘eventfd’ was not declared in this scope
error: command 'gcc' failed with exit status 1
Command /usr/local/uvcdat/1.3.3/bin/python -c "import setuptools;file='/tmp/pip-build-root/pyzmq/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-9FT_V2-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/pyzmq
Storing complete log in /root/.pip/pip.log
Thanks for your help
Can you install libzmq yourself prior to installing pyzmq? That's always preferable if possible. You might also try:
pip install pyzmq --install-option="fetch_libzmq"
Which should force a fresh download / configuration of libzmq for building as an extension.
Thanks for your reply. I tried the fetch_libzmq but it got the same error message.
The thing is I already have zeromq and zeromq-devel installed and libzmq.so.1 is present
yum list installed | grep zeromq
zeromq.i386 2.1.9-1.el5 installed
zeromq.x86_64 2.1.9-1.el5 installed
zeromq-devel.i386 2.1.9-1.el5 installed
zeromq-devel.x86_64 2.1.9-1.el5 installed
ls -lrt /usr/lib | grep libzmq
-rwxr-xr-x 1 root root 217124 Sep 21 2011 libzmq.so.1.0.0
lrwxrwxrwx 1 root root 15 Jul 24 20:35 libzmq.so.1 -> libzmq.so.1.0.0
lrwxrwxrwx 1 root root 15 Jul 24 20:35 libzmq.so -> libzmq.so.1.0.0
Do I need to install some more packages to be able to run: pip install pyzmq?
Thanks again for your help
try pip install pyzmq --install-option="--zmq=/usr/lib"
oh, to link against libzmq you need the zmq headers - that's typically a separate package, zeromq-devel
in yum parlance, I think.
yum install zeromq-devel and pip install pyzmq --install-option="--zmq=/usr/lib" did it for me!
Thanks a lot
Hello,
I am trying to install pyzmq with --install-option="--zmq=bundled"
and I am hitting the same issue.
I successfully installed ZeroMQ 3.2.4 and 4.0.3 from source using:
./configure --prefix=
pwd/output && make && make install
But pip install pyzmq --install-option="--zmq=bundled"
fails with:
bundled/zeromq/src/signaler.cpp:67:25: error: sys/eventfd.h: No such file or directory
bundled/zeromq/src/signaler.cpp: In static member function ‘static int zmq::signaler_t::make_fdpair(zmq::fd_t*, zmq::fd_t*)’:
bundled/zeromq/src/signaler.cpp:276: error: ‘eventfd’ was not declared in this scope
error: command 'gcc' failed with exit status 1
The environment is RHEL 5.6 64 bit. Indeed, there is no sys/eventfd.h
provided in glibc-headers package.
Of course pointing to built version by using --install-option="--zmq=/path/to/zeromq-4.0.3/output"
works well.
Additionally I see that output from building bundled ZeroMQ is different that normal one, is that expected?
The environment is RHEL 5.6 64 bit. Indeed, there is no sys/eventfd.h provided in glibc-headers package.
eventfd.h might have been added to glibc-headers in rhel 6. What is diff /path/to/zeromq-4.0.3/src/platform.hpp /path/to/pyzmq/buildutils/include_linux/platform.hpp
?
I see that output from building bundled ZeroMQ is different that normal one, is that expected?
Yes, the output should be very different because pyzmq is compiling libzmq itself, which it doesn't normally do. If you have installed zeromq already, why would you want to use bundled zeromq? The primary reason to use bundled lbizmq is if you can't / won't install libzmq in a normal manner. I would always recommend _against_ using bundled libzmq where possible.
You might try a more from-scratch build of the bundled zeromq:
pip install --no-use-wheel pyzmq --global-option='fetch_libzmq' --install-option='--zmq=bundled'
which starts from scratch, and re-runs configure on your machine.
I'm on centos6.4. I upgraded setuptools and pip is 1.5.1
I tried
$ pip install --no-use-wheel pyzmq --global-option='fetch_libzmq' --install-option='--zmq=bundled'
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_root/pyzmq/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" fetch_libzmq install --record /tmp/pip-AV3Zv9-record/install-record.txt --single-version-externally-managed --compile --zmq=bundled failed with error code 1 in /tmp/pip_build_root/pyzmq
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
sys.exit(main())
File "/usr/lib/python2.6/site-packages/pip/__init__.py", line 185, in main
return command.main(cmd_args)
File "/usr/lib/python2.6/site-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 48: ordinal not in range(128)
That looks like just a bug in pip. Does manual download and install work?
This is weird, it makes the installation of dependent packages very difficult.
For anyone trying python circus, this worked for me (ubuntu server 12.04):
sudo apt-get install libzmq-dev
sudo pip install pyzmq --install-option="--zmq=/usr/lib"
sudo pip install circus
Under normal circumstances, pyzmq finds libzmq just fine if it is in a default location, such as /usr/lib, /usr/local/lib, etc, at least as tested on every Linux or BSD I have tried.
Worked for me, :)
sudo pip install --no-use-wheel pyzmq --global-option='fetch_libzmq' --install-option='--zmq=bundled'
yum install zeromq-devel
pip install pyzmq --install-option="--zmq=/usr/lib"
Works for me, thanks.
@shymonk
I did as you wrote, and it worked! Thanks!
yum install zeromq-devel
pip install pyzmq --install-option="--zmq=/usr/lib"
also works for me ,thanks
Most helpful comment
try
pip install pyzmq --install-option="--zmq=/usr/lib"