一、安装zeromq
1.下载zeromq安装包,网址为:http://download.zeromq.org/
2、上传到服务器解压
3.开始安装步骤
cd zeromq
./configure
make && make install
二、zeromq安装过程中可能出现的错误
1、缺少gcc编译器
[root@master zeromq-4.1.6]# ./configure --prefix=/usr/local/zeromq
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/zeromq-4.1.6':
configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
使用 yum install gcc 命令安装即可
2、找不到g++编译器
configure: error: Unable to find a working C++ compiler
使用命令yum instal gcc-c++安装即可
3、缺少libtool
autogen.sh: error: could not find libtool. libtool is required to run autogen.sh.
使用命令yum install libtool
三、安装jzmq
这里采用源代码方式安装
yum install git
git clone git://github.com/nathanmarz/jzmq.git
cd jzmq
./autogen.sh
./configure
make
make install
四、可能出现的错误
1.configure: error: cannot find zmq.h
解决办法:
export LDFLAGS=-L/usr/local/zeromq/lib/
export CPPFLAGS=-I/usr/local/zeromq/include/
2.
make[1]: 进入目录“/usr/local/jzmq/src”
make[1]: *** 没有规则可以创建“org/zeromq/ZMQ.class”需要的目标“classdist_noinst.stamp”。 停止。
make[1]: 离开目录“/usr/local/jzmq/src”
make: *** [all-recursive] 错误 1
解决办法:touch src/classdist_noinst.stamp
3、没有规则可以创建“all”需要的目标“org/zeromq/ZMQ$Context.class
解决办法:touch src/org/zeromq/ZMQ$Context.class
4.错误: 找不到 'org.zeromq.ZMQ' 的类文件。
make[1]: *** [org_zeromq_ZMQ.h] 错误 1
make[1]: 离开目录“/usr/local/jzmq/src”
make: *** [all-recursive] 错误 1
[root@master jzmq]# cd src/org/zeromq/
进入src目录执行命令