tonysimpson / nanomsg-python

nanomsg wrapper for python with multiple backends (CPython and ctypes) should support 2/3 and Pypy
MIT License
382 stars 85 forks source link

Unable to install nanomsg on mac os x. #29

Open ExplorerOnTheMoon opened 9 years ago

ExplorerOnTheMoon commented 9 years ago

OS details

uname -a
<hostname>:nanomsg-python root# uname -a Darwin <hostname>.home 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 <hostname>:nanomsg-python root#

nanomsg-python Version Details

<hostname>:downloads root# git clone https://github.com/tonysimpson/nanomsg-python.git
Cloning into 'nanomsg-python'...
remote: Counting objects: 262, done.
remote: Total 262 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (262/262), 48.17 KiB | 0 bytes/s, done.
Resolving deltas: 100% (117/117), done.
Checking connectivity... done.
<hostname>:downloads root# cd nanomsg-python/
<hostname>:nanomsg-python root# git log --oneline --graph | head
* 742d39a Fixed test on 2.6
*   5fcd574 Merge branch 'jstasiak-master'
|\
| * 0b48e20 Merge
|/
*   d89104e Merge pull request #19 from vaibhavsagar/patch-1
|\
| * 3838aba Update README.md
|/
*   6ffa74d Merge pull request #16 from drewcrawford/drew-vanilla
<hostname>:nanomsg-python root#

Installation process

<host_name>:nanomsg-python root# python setup.py install --dry-run
running install
running bdist_egg
running egg_info
creating nanomsg.egg-info
writing nanomsg.egg-info/PKG-INFO
writing top-level names to nanomsg.egg-info/top_level.txt
writing dependency_links to nanomsg.egg-info/dependency_links.txt
writing manifest file 'nanomsg.egg-info/SOURCES.txt'
reading manifest file 'nanomsg.egg-info/SOURCES.txt'
writing manifest file 'nanomsg.egg-info/SOURCES.txt'
installing library code to build/bdist.macosx-10.9-intel/egg
running install_lib
running build_py
creating build
creating build/lib.macosx-10.9-intel-2.7
creating build/lib.macosx-10.9-intel-2.7/nanomsg
copying nanomsg/__init__.py -> build/lib.macosx-10.9-intel-2.7/nanomsg
copying nanomsg/version.py -> build/lib.macosx-10.9-intel-2.7/nanomsg
copying nanomsg/wrapper.py -> build/lib.macosx-10.9-intel-2.7/nanomsg
creating build/lib.macosx-10.9-intel-2.7/_nanomsg_ctypes
copying _nanomsg_ctypes/__init__.py -> build/lib.macosx-10.9-intel-2.7/_nanomsg_ctypes
creating build/lib.macosx-10.9-intel-2.7/nanomsg_wrappers
copying nanomsg_wrappers/__init__.py -> build/lib.macosx-10.9-intel-2.7/nanomsg_wrappers
running build_ext
building '_nanomsg_cpy' extension
creating build/temp.macosx-10.9-intel-2.7
creating build/temp.macosx-10.9-intel-2.7/_nanomsg_cpy
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _nanomsg_cpy/wrapper.c -o build/temp.macosx-10.9-intel-2.7/_nanomsg_cpy/wrapper.o
_nanomsg_cpy/wrapper.c:4:10: fatal error: 'nanomsg/nn.h' file not found
#include <nanomsg/nn.h>
         ^
1 error generated.

===============================================================================
WARNING : CPython API extension could not be built.

Exception was : CompileError(DistutilsExecError("command 'cc' failed with exit status 1",),)

If you need the extensions (they may be faster than alternative on some
 platforms) check you have a compiler configured with all the necessary
 headers and libraries.
===============================================================================

creating build/bdist.macosx-10.9-intel
creating build/bdist.macosx-10.9-intel/egg
creating build/bdist.macosx-10.9-intel/egg/_nanomsg_ctypes
copying build/lib.macosx-10.9-intel-2.7/_nanomsg_ctypes/__init__.py -> build/bdist.macosx-10.9-intel/egg/_nanomsg_ctypes
creating build/bdist.macosx-10.9-intel/egg/nanomsg
copying build/lib.macosx-10.9-intel-2.7/nanomsg/__init__.py -> build/bdist.macosx-10.9-intel/egg/nanomsg
copying build/lib.macosx-10.9-intel-2.7/nanomsg/version.py -> build/bdist.macosx-10.9-intel/egg/nanomsg
copying build/lib.macosx-10.9-intel-2.7/nanomsg/wrapper.py -> build/bdist.macosx-10.9-intel/egg/nanomsg
creating build/bdist.macosx-10.9-intel/egg/nanomsg_wrappers
copying build/lib.macosx-10.9-intel-2.7/nanomsg_wrappers/__init__.py -> build/bdist.macosx-10.9-intel/egg/nanomsg_wrappers
byte-compiling build/bdist.macosx-10.9-intel/egg/_nanomsg_ctypes/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.9-intel/egg/nanomsg/__init__.py to __init__.pyc
byte-compiling build/bdist.macosx-10.9-intel/egg/nanomsg/version.py to version.pyc
byte-compiling build/bdist.macosx-10.9-intel/egg/nanomsg/wrapper.py to wrapper.pyc
byte-compiling build/bdist.macosx-10.9-intel/egg/nanomsg_wrappers/__init__.py to __init__.pyc
creating build/bdist.macosx-10.9-intel/egg/EGG-INFO
copying nanomsg.egg-info/PKG-INFO -> build/bdist.macosx-10.9-intel/egg/EGG-INFO
copying nanomsg.egg-info/SOURCES.txt -> build/bdist.macosx-10.9-intel/egg/EGG-INFO
copying nanomsg.egg-info/dependency_links.txt -> build/bdist.macosx-10.9-intel/egg/EGG-INFO
copying nanomsg.egg-info/top_level.txt -> build/bdist.macosx-10.9-intel/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating dist
creating 'dist/nanomsg-1.0a2-py2.7-macosx-10.9-intel.egg' and adding 'build/bdist.macosx-10.9-intel/egg' to it
removing 'build/bdist.macosx-10.9-intel/egg' (and everything under it)
Processing nanomsg-1.0a2-py2.7-macosx-10.9-intel.egg
Removing /Library/Python/2.7/site-packages/nanomsg-1.0a2-py2.7-macosx-10.9-intel.egg
Copying nanomsg-1.0a2-py2.7-macosx-10.9-intel.egg to /Library/Python/2.7/site-packages
nanomsg 1.0a2 is already the active version in easy-install.pth

Installed /Library/Python/2.7/site-packages/nanomsg-1.0a2-py2.7-macosx-10.9-intel.egg
Processing dependencies for nanomsg==1.0a2
Finished processing dependencies for nanomsg==1.0a2
<host_name>:nanomsg-python root#

Error details :bomb:

<host_name>:nanomsg-python root# grep -ir '#include <nanomsg/nn.h>' *
_nanomsg_cpy/wrapper.c:#include <nanomsg/nn.h>
<host_name>:nanomsg-python root# find . -type f -name *nn.h* -print
<host_name>:nanomsg-python root#

Note that the repo does not have the nn.h header file. :imp:

bnewbold commented 9 years ago

@ExplorerOnTheMoon: Do you have the nanomsg C library compiled and installed on your system? It doesn't seem like nanomsg-python bundles or installs it automatically.