Hi, I'm trying to build op25 on OSX and while I can get it to build and install it doesn't work.
It sends up installing into /opt/local/lib/python2.7/site-packages instead of /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
If I add /opt/local/lib/python2.7/site-packages to sys.path or copy the files into the 'right' directory I get the following error..
In [2]: sys.path.append('/opt/local/lib/python2.7/site-packages/')
In [3]: import op25 --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-3-7d3debe9ed1a> in <module>() ----> 1 import op25
/opt/local/lib/python2.7/site-packages/op25/__init__.py in <module>() 43 44 # import swig generated symbols into the op25 namespace ---> 45 from op25_swig import * 46 47 # import any pure python here
/opt/local/lib/python2.7/site-packages/op25/op25_swig.py in <module>() 15 except ImportError: 16 return importlib.import_module('_op25_swig') ---> 17 _op25_swig = swig_import_helper() 18 del swig_import_helper 19 elif _swig_python_version_info >= (2, 6, 0):
/opt/local/lib/python2.7/site-packages/op25/op25_swig.py in swig_import_helper() 14 return importlib.import_module(mname) 15 except ImportError: ---> 16 return importlib.import_module('_op25_swig') 17 _op25_swig = swig_import_helper() 18 del swig_import_helper
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.pyc in import_module(name, package) 35 level += 1 36 name = _resolve_name(name[level:], package, level) ---> 37 __import__(name) 38 return sys.modules[name]
ImportError: No module named _op25_swig
There is a file called /opt/local/lib/python2.7/site-packages/op25/_op25_swig.so so I don't know why it can't find it :(
I tried renaming it from .so to .dylib but it still can't find it. I note that some of the GNUradio stuff is installed as a .so so..?! :)
I have GNURadio installed using Macports and that seems to work fine.
Any help appreciated, thanks.
-- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
I'm going to take a guess that the "swig" package is not installed on your system so when you ran the "cmake ../" step prior to building op25 it generated makefiles without swig support. It'll still compile and install quite happily but won't run... (ask me how I know!)
To fix the problem you need to do a "sudo apt install swig" or whatever is equivalent on OSX, then delete and re-create the op25/build directory followed by the remaining build/install steps.
On 14 Aug 2017, at 10:52, gnorbury@bondcar.com [op25-dev] op25-dev@yahoogroups.com wrote: I'm going to take a guess that the "swig" package is not installed on your system so when you ran the "cmake ../" step prior to building op25 it generated makefiles without swig support. It'll still compile and install quite happily but won't run... (ask me how I know!)
To fix the problem you need to do a "sudo apt install swig" or whatever is equivalent on OSX, then delete and re-create the op25/build directory followed by the remaining build/install steps.
I do have swig installed :( [Maelstrom 10:54] ~/projects/op25/build >cmake -D CMAKE_INSTALL_PREFIX=/opt/local .. -- The CXX compiler identification is AppleClang 8.1.0.8020042 -- The C compiler identification is AppleClang 8.1.0.8020042 -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ ... -- -- Checking for module SWIG -- Found SWIG version 3.0.12. -- Found SWIG: /opt/local/bin/swig -- Found PythonLibs: /usr/lib/libpython2.7.dylib (found suitable version "2.7.10", minimum required is "2") -- Found PythonInterp: /opt/local/bin/python2.7 (found suitable version "2.7.13", minimum required is "2") ...
Full log is at https://gist.github.com/DanielO/350abc7a51c73e0ee0810a8b75696d2d
One thing I see is.. CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning.
MACOSX_RPATH is not specified for the following targets:
gnuradio-op25 gnuradio-op25_repeater
This warning is for project developers. Use -Wno-dev to suppress it.
Which might be an issue preventing it from being found. (But I have no idea how to fix it :)
-- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Hmmm, well it that case it's probably a path issue.
On my ubuntu system, the file _op25_swig.so is found in /usr/local/lib/python2.7/dist-packages/op25/ and my python2.7/site-packages directory is empty. Not sure why yours would be different, but how about sym-linking the directory to make it appear where it should.
On 17 Aug 2017, at 06:49, gnorbury@bondcar.com [op25-dev] op25-dev@yahoogroups.com wrote: Hmmm, well it that case it's probably a path issue.
On my ubuntu system, the file _op25_swig.so is found in /usr/local/lib/python2.7/dist-packages/op25/ and my python2.7/site-packages directory is empty. Not sure why yours would be different, but how about sym-linking the directory to make it appear where it should.
I've tried copying it but it still doesn't get found, it's most strange :(
-- Daniel O'Connor "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Something must be built differently and causing issues with sys.path or PYTHONPATH. Perhaps these pages may help? https://docs.python.org/2/tutorial/modules.html#the-module-search-path https://docs.python.org/2/tutorial/modules.html#the-module-search-path https://stackoverflow.com/questions/15252040/how-does-python-find-a-module-f... https://stackoverflow.com/questions/15252040/how-does-python-find-a-module-f...