Compile nanomsg under centos7

nanomsg is very convenient to use under python. And it can directly interact with the concurrent non-blocking message center written by using the mangos (go language implementation of nanomsg) library.

Under python, you can directly use pip install nanomsg to install nanomsg, but it cannot be used directly after the installation is complete, and the corresponding libnanomsg.so must be installed. If it is a debian system (debian, Ubuntu and other debian-based distributions), it can be installed directly through apt-get, but the corresponding lib (yum search nanomsg) cannot be searched under centos, so it can only be compiled according to the official readme.

Here is the command to compile:

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
ldconfig

verify:

pip install -U nanomsg
python -c "import nanomsg"

No error is reported, it means that the compilation is ok

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326928657&siteId=291194637