1、Ubuntu
1) INSTALL qpid-proton
</pre><pre name="code" class="plain">
sudo apt-get install openjdk-6-jdk
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install openssl
sudo apt-get install libssl-dev
sudo apt-get install swig
sudo apt-get install python-dev
sudo apt-get install ruby-dev
sudo apt-get install uuid-dev
sudo apt-get install uuid
sduo apt-get install libevent-1.4-2
wget http://mirrors.cnnic.cn/apache/qpid/proton/0.7/qpid-proton-0.7.tar.gz
tar zvxf qpid-proton-0.7.tar.gz
cd qpid-proton-0.7 && mkdir build
cd build
sudo cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DSYSINSTALL_BINDINGS=ON
cmake的时候会出现两个错误,一个是uuid虽然安装了uuid-dev,但是还是提示找不到,需要修改cmakefilelist
另一个是 ruby依赖不存在,导致cmake失败(这个是bug,后续应该有解决)
make all docs
make install
-- 错误参考ERRORS --
1) uuid api 不存在错误
sjyb@sjybPMPServer:~/workspace/openmama/soft/qpid-proton-0.7/qpid-proton-0.7/build$ sudo cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DSYSINSTALL_BINDINGS=ON
-- PN_VERSION: 0.7
CMake Error at proton-c/CMakeLists.txt:133 (message):
No Uuid API found
参考下面的解决:
http://blog.bekijkhet.com/2013/08/from-raspberry-pi-to-azure-service-bus.html
For some reason the cmake script doesn't find the uuid library. So the change below helps it to choose the right setting.
pi@raspberrypi ~/qpid-proton-0.4 $ <strong><span style="color:#ff0000;">cd proton-c</span></strong>
pi@raspberrypi ~/qpid-proton-0.4/proton-c $ vi CMakeLists.txt
replace:
CHECK_SYMBOL_EXISTS(uuid_generate "uuid/uuid.h" UUID_GENERATE_IN_LIBC)
if (UUID_GENERATE_IN_LIBC)
list(APPEND PLATFORM_DEFINITIONS "USE_UUID_GENERATE")
else (UUID_GENERATE_IN_LIBC)
CHECK_LIBRARY_EXISTS (uuid uuid_generate "" UUID_GENERATE_IN_UUID)
if (UUID_GENERATE_IN_UUID)
set (UUID_LIB uuid)
list(APPEND PLATFORM_DEFINITIONS "USE_UUID_GENERATE")
else (UUID_GENERATE_IN_UUID)
CHECK_SYMBOL_EXISTS(uuid_create "uuid.h" UUID_CREATE_IN_LIBC)
if (UUID_CREATE_IN_LIBC)
list(APPEND PLATFORM_DEFINITIONS "USE_UUID_CREATE")
else (UUID_CREATE_IN_LIBC)
CHECK_SYMBOL_EXISTS(UuidToString "rpc.h" WIN_UUID)
if (WIN_UUID)
list(APPEND PLATFORM_DEFINITIONS "USE_WIN_UUID")
else (WIN_UUID)
message(FATAL_ERROR "No Uuid API found")
endif (WIN_UUID)
endif (UUID_CREATE_IN_LIBC)
endif (UUID_GENERATE_IN_UUID)
endif (UUID_GENERATE_IN_LIBC)
with the lines:
set (UUID_LIB uuid)
list(APPEND PLATFORM_DEFINITIONS "USE_UUID_GENERATE")
save the file.
2) ruby依赖问题
CMake Error at proton-c/bindings/ruby/CMakeLists.txt:21 (message):
Ruby bindings cannot be tested while missing dependencies
sudo gem install rspec
sudo gem install simplecov
第一次会报错:
ERROR: Could not find a valid gem 'simplecov' (>= 0) in any repository
ERROR: Possible alternatives: simplecov
第二次则执行成功。
已经有bug report :https://issues.apache.org/jira/browse/PROTON-570
2) INSTALL openmama
注意执行 config/profile.mama (由于不是rpm安装,目录需要修改下)
设置了PATH、LD_LIBRARY_PATH 和WOMBAT
3) TEST openmama
[damian@openmama openmama]$ mamapublisherc -tport pub -m qpid
Starting Publisher with:
topic: MAMA_TOPIC
inbound topic: MAMA_INBOUND_TOPIC
interval 0.500000
transport: pub
2013-12-19 09:56:36:
********************************************************************************
Note: This build of the MAMA API is not enforcing entitlement checks.
Please see the Licensing file for details
**********************************************************************************
CONNECTION ERROR connection aborted
Created inbound subscription.
Publishing message 0 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,0},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 1 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,1},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 2 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,2},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 3 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,3},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 4 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,4},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 5 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,5},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 6 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,6},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 7 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,7},{PublisherTopic,10002,MAMA_TOPIC}}
Publishing message 8 to MAMA_TOPIC.
msg=({{MdMsgStatus,2,0},{MdSeqNum,10,8},{PublisherTopic,10002,MAMA_TOPIC}}
[damian@openmama openmama]$ mamasubscriberc -m qpid -tport sub
Starting Subscriber with:
topic: MAMA_TOPIC
transport: sub
2013-12-19 09:56:38:
********************************************************************************
Note: This build of the MAMA API is not enforcing entitlement checks.
Please see the Licensing file for details
**********************************************************************************
mamasubscriberc: Created inbound subscription.
mamasubscriberc: Recieved msg.
MdMsgStatus 2 I32 0
MdSeqNum 10 I32 5
PublisherTopic 10002 STRING MAMA_TOPIC
mamasubscriberc: Recieved msg.
MdMsgStatus 2 I32 0
MdSeqNum 10 I32 6
PublisherTopic 10002 STRING MAMA_TOPIC
mamasubscriberc: Recieved msg.
MdMsgStatus 2 I32 0
MdSeqNum 10 I32 7
PublisherTopic 10002 STRING MAMA_TOPIC
mamasubscriberc: Recieved msg.
MdMsgStatus 2 I32 0
MdSeqNum 10 I32 8
PublisherTopic 10002 STRING MAMA_TOPIC
2.RHEL
# required dependencies
yum install gcc cmake libuuid-devel
# dependencies needed for ssl support
yum install openssl-devel
# dependencies needed for bindings
yum install swig python-devel ruby-devel php-devel perl-devel
# dependencies needed for java (note that any non-ancient jvm will
# work, 1.8.0 is just what is current for fedora 20)
yum install java-1.8.0-openjdk-devel
# dependencies needed for python docs
yum install epydoc
From the directory where you found this README file:
mkdir build
cd build
# Set the install prefix. You may need to adjust depending on your
# system.
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DSYSINSTALL_BINDINGS=ON
# Omit the docs target if you do not wish to build or install
# documentation.
make all docs
# Note that this step will require root privileges.
make install