Install Nanomsg and Nnpy under Ubuntu

Source: Internet
Author: User

Nanomsg

NANOMSG is a socket library ZEROMQ written by the author in C, with the same usage and pattern as ZEROMQ, but with better performance and a more complete interface.

First download the source code

wget Https://github.com/nanomsg/nanomsg/archive/1.0.0.tar.gz-O nanomsg-1.0.0.tar.gz

First make sure you have installed gcc gcc-c++ python-devel cmake on Ubuntu, if not executed

Apt-get install gcc gcc-c++ python-devel cmake
Compiling and installing nanomsg
TAR-ZXVF NANOMSG-1.0.0.TAR.GZCD Nanomsg-1.0.0mkdir bulid# This step if there is a problem, you need to remove CMakeCache.txt re-CMAKECD Buildcmake: CMake--build. # Perform Test ctest-c Debug. # install CMake--build. --target Installldconfig

Installation and Commissioning

PIP3 Install Nnpy

Installation test

Import nnpypub = Nnpy. Socket (NNPY.AF_SP, Nnpy. PUB) pub.bind (' Inproc://foo ') sub = Nnpy. Socket (NNPY.AF_SP, Nnpy. SUB) sub.connect (' Inproc://foo ') sub.setsockopt (nnpy. SUB, Nnpy. Sub_subscribe, ') pub.send (' Hello, World ') print (SUB.RECV ())

If execution succeeds, you are done.

Note: If you need to install NANOMSG, you need to install, download the installation package, go to directory execution

Python setup.py Install

Can

  

  

  

  

Install Nanomsg and Nnpy under Ubuntu

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.