Mac OS 10.9 [Mavericks] 编译支持 ZeroMQ 4.0.1 版本的 gozmq

1732 查看

下载 4.0.1 版本的 ZeroMQ 代码后解压到任意目录。

tar -xzvf zeromq-4.0.1.tar.gz
cd zeromq-4.0.1
./configure --prefix=/usr
make
make install
go get -tags zmq_4_x github.com/alecthomas/gozmq

测试程序

package main

import (
  "fmt"
  zmq "github.com/alecthomas/gozmq"
  "os"
)

func main() {
  major, minor, patch := zmq.Version()
  fmt.Printf("Current 0MQ version is %d.%d.%d\n", major, minor, patch)
  os.Exit(0)
}

运行测试程序

$ go run version.go
$ Current 0MQ version is 4.0.1