---
title: "How to build jzmq in Mac OS X Lion"
author: "城的灯"
date: "2012-04-27T00:16:44Z"
tags: []
categories: ["开源软件"]
slug: "how-to-build-jzmq-in-mac-os-x-lion"
draft: false
lastmod: "2013-01-06T22:32:03Z"
id: 1500296
url: "https://mapserver000-gmail-com.iteye.com/blog/1500296"
---

作为一名在mac os平台上搞开发的java程序员来说，环境的配置有时候真的让人头大，虽然mac os平台跟linux有相似之处，但是毕竟不是linux。下面我主要是记录我在配置storm时遇见的一些问题，如果你在玩storm或者使用zeromq并且需要在mac os上安装jzmq的本地库，我想这篇文章对你是有一定用处的。

 

关于jzmq的安装网上文章很多了，我先不管别人是碰见神马问题，反正我在使用./configure的时候遇见如下的错误：

 

 

checking how to hardcode library paths into programs... immediate

./configure: line 15328: syntax error near unexpected token \`newline'

./configure: line 15328: \`    PKG\_CHECK\_MODULES('

 

官方给出了一个在stackoverflow的解决方案，链接如下：

http://stackoverflow.com/questions/3522248/how-do-i-compile-jzmq-for-zeromq-on-osx；

通过该篇文章我确定pkg-config是必须安装的，运行命令：

brew install pkg-config

但是由于我试过很多方案，东西也安装了不少，所以很乱，比如我开始运行./autogen.sh是可以运行的，但是我装来装去之后，发现该命令都不能运行，并且报出如下错误：

autogen.sh: error: could not find autoreconf.  autoconf and automake are required to run autogen.sh.

我靠，刚才都好好的，现在不行。一气之下不再看网上的方案，自己解决，兵来将挡，水来土掩。该错误很简单，一分析，不就是automake找不到嘛，那重新安装，命令如下：

brew install automake

一运行，还是报错，但是错误却变成下面的错误：

 

autoreconf: failed to run glibtoolize: No such file or directory

autoreconf: libtoolize is needed because this package uses Libtool

autogen.sh: error: autoreconf exited with status 0

搞错没有，一看猜测是Libtool出现问题，重装，命令如下：

brew install Libtool

重新运行./configure，过了，不错。

接着我运行make编译，错误又来了，如下：

 

Making all in src

make\[1]: \*\** No rule to make target \`classdist\_noinst.stamp', needed by \`org/zeromq/ZMQ.class'.  Stop.

make: \*\** \[all-recursive] Error 1

刚好看过两篇篇解决方案：

http://blog.sina.com.cn/s/blog\_8ae7b3fe01013yrv.html

http://tjun.jp/blog/2012/04/how-to-build-jzmq-in-mac-os-x-lion/

简单，命令如下：

touch src/classdist\_noinst.stamp

make一下，ok，搞定。

 

 

以上就是我的解决思路，由于又是凌晨了，语言组织的不是很好，口水话很多，希望对你有所帮助！