在 amazon linux 上安装 zmq 时出现问题(无法找到 uuid)
我正在尝试在 EC2 上组装一个 AMI,但目前在构建 0mq 方面陷入停滞。
最初,我在运行 ./configure 时遇到此错误
checking for uuid_generate in -luuid... no
configure: error: cannot link with -luuid, install uuid-dev.
,我通过 yum 安装了 e2fsprogs-devel 和 linux-utils,我相信其中包含所需的库,但仍然出现上述错误。我随后用 yum 安装了 uuid-devel,但没有进一步的进展。
然后,我创建了一个如下链接:
sudo ln -s /lib64/libuuid.so.1.3.0 /lib64/libuuid.so
现在 ./configure 愉快地完成了,但是当我运行 make 时出现错误
[...]
CXX libzmq_la-signaler.lo
CXX libzmq_la-socket_base.lo
In file included from socket_base.cpp:50:
uuid.hpp:31:23: error: uuid/uuid.h: No such file or directory
In file included from socket_base.cpp:50:
uuid.hpp:92: error: 'uuid_t' in namespace '::' does not name a type
make[2]: *** [libzmq_la-socket_base.lo] Error 1
make[2]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make: *** [all-recursive] Error 1
以下是 /usr/include/uuid.h 的开头,如果这有用的话。
#ifndef __UUID_H__
#define __UUID_H__
/* workaround conflicts with system headers */
#define uuid_t __vendor_uuid_t
#define uuid_create __vendor_uuid_create
#define uuid_compare __vendor_uuid_compare
#include <sys/types.h>
#include <unistd.h>
#undef uuid_t
#undef uuid_create
#undef uuid_compare
在这一点上我很困惑。
I'm trying to put together an AMI on EC2, and am currently stalled on building 0mq.
initially, I got this error while running ./configure
checking for uuid_generate in -luuid... no
configure: error: cannot link with -luuid, install uuid-dev.
I installed e2fsprogs-devel and linux-utils via yum, which I believe contained the required library, but still got the error above. I subsequently installed uuid-devel with yum and got no further.
Then, I created a link as below:
sudo ln -s /lib64/libuuid.so.1.3.0 /lib64/libuuid.so
and now ./configure completes happily, but I get an error when I run make
[...]
CXX libzmq_la-signaler.lo
CXX libzmq_la-socket_base.lo
In file included from socket_base.cpp:50:
uuid.hpp:31:23: error: uuid/uuid.h: No such file or directory
In file included from socket_base.cpp:50:
uuid.hpp:92: error: 'uuid_t' in namespace '::' does not name a type
make[2]: *** [libzmq_la-socket_base.lo] Error 1
make[2]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/this/infrastructure/zeromq2-2/src'
make: *** [all-recursive] Error 1
The following is the beginning of /usr/include/uuid.h, if that's useful.
#ifndef __UUID_H__
#define __UUID_H__
/* workaround conflicts with system headers */
#define uuid_t __vendor_uuid_t
#define uuid_create __vendor_uuid_create
#define uuid_compare __vendor_uuid_compare
#include <sys/types.h>
#include <unistd.h>
#undef uuid_t
#undef uuid_create
#undef uuid_compare
I'm pretty well stumped at this point.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 https://bugzilla.redhat.com/show_bug.cgi?id=576296#c0< 所指出的/a>,使用 libuuid-devel 而不是 uuid-devel,
这为我解决了丢失的 /usr/include/uuid/uuid.h 文件。
As pointed out on https://bugzilla.redhat.com/show_bug.cgi?id=576296#c0, use libuuid-devel instead of uuid-devel,
This resolved the missing /usr/include/uuid/uuid.h file for me.
最终,我通过运行满足了依赖关系
,值得注意的是,为了让 libzmq 链接到需要它的其他程序(例如 Mongrel2),我必须将该行添加
到 /etc/ldconfig.so.conf并运行
(如果您在输出中没有看到 libzmq.so 的条目,则说明有问题)
ultimately, I satisfied the dependency by running
also worth noting is that to get libzmq to link into the other programs that needed it down the line (Mongrel2, for example), I had to add the line
to /etc/ldconfig.so.conf and run
(if you don't see an entry for libzmq.so in the output, something's off)
或者,阅读有关安装 Zeromq 的文档! :)
即
确保安装了
libtool
、autoconf
、automake
。检查系统上是否安装了 uuid-dev 软件包、uuid/e2fsprogs RPM 或同等软件。
解压 .tar.gz 源存档。
运行
./configure
,然后运行make
。要在系统范围内安装ØMQ,请运行
sudo make install
。在 Linux 上,安装 ØMQ 后运行 sudo ldconfig。
如前所述,在 Amazon Linux 上,您可以通过执行以下操作来安装 deps:
注意,说明还提到了安装后的要求:
安装后。
Alternatively, read the documentation on installing zeromq! :)
i.e.
Make sure that
libtool
,autoconf
,automake
are installed.Check whether uuid-dev package, uuid/e2fsprogs RPM or equivalent on your system is installed.
Unpack the .tar.gz source archive.
Run
./configure
, followed bymake
.To install ØMQ system-wide run
sudo make install
.On Linux, run
sudo ldconfig
after installing ØMQ.As mentioned, on Amazon Linux, you'd install deps by doing:
N.B. the instructions also mention the requirement to do:
after install too.