nanomsg 在python下使用起來很是方便。並且還能直接和利用mangos(nanomsg的go語言實現)庫編寫的併發非阻塞的消息中心交互。python
python下能夠直接使用pip install nanomsg來安裝nanomsg,但安裝完成後沒法直接使用,必須安裝相應的libnanomsg.so。若是是debian系統(debian,Ubuntu 等基於debian的發行版)能夠直接經過apt-get安裝,但centos下搜索不到相應的lib(yum search nanomsg),所以只能根據官方的readme本身編譯。c++
如下是編譯的命令:git
wget https://github.com/nanomsg/nanomsg/archive/1.1.2.tar.gz
tar -zxvf 1.1.2.tar.gz
cd nanomsg-1.1.2/
mkdir bulid
yum install gcc gcc-c++ python-devel cmake
cd bulid/
cmake ..
cmake --build . --config Debug
ctest -C Debug .
cmake --build . --target install
echo "/usr/local/lib64" >> /etc/ld.so.conf
ldconfiggithub
驗證:centos
pip install -U nanomsg
python -c "import nanomsg"併發
不報錯說明編譯得沒問題ui