cmake -DPYTHON_EXECUTABLE=/usr/bin/python2.7 -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so -DCMAKE_INSTALL_PREFIX=/usr ../
So, just to be clear: this isn't a bug with the AUR package. It exists in the CMakeLists.txt of the gnuradio git source. In that file there is a line that says "find_package(PythonLibs)" which for some reason on our systems was finding the Python3 libs. This can also be changed to "find_package(PythonLibs 2.7.3)" (if that is your version of Python). This cmake file needs to test to make sure the python version is less than 3.
Anyway, I'm glad we both got it sorted!
]]>sudo pacman -Rdd python
yaourt -S gnuradio-git
sudo pacman -S python
I just used yaourt to install gnuradio-git on another machine (which is nearly fresh). I can "from gnuradio import gr" without a problem, but gnuradio-companion didn't compile. One of the main differences with this machine is that I never installed python 3 on it. I'm pretty sure that on my other machine all of the binaries and python path variables are pointing to python2, but I can't be too sure since I am brand new to arch.
This is from the machine that works.
nm -D /usr/lib/python2.7/site-packages/gnuradio/gr/_gnuradio_core_runtime.so | grep gnuradio
0001f8e0 T init_gnuradio_core_runtime
This is from the machine that doesn't
nm -D /usr/lib/python2.7/site-packages/gnuradio/gr/_gnuradio_core_runtime.so | grep gnuradio
0000000000024bf0 T PyInit_gnuradio_core_runtime
Any help would be greatly appreciated.
EDIT: Found this. http://bugs.python.org/msg90429 . It looks like PyInit_ is used in Python3 instead of init_. This means that our systems are building towards Python3 for some reason.
]]>Many thanks,
Techmeology
I've tried, to no avail:
Modifying the build file to checkout an older version of gnuradio (the version that I think was previously installed)
Downgrading swig to the previous version (2.0.7)
Googling for this error message
Setting PYTHONPATH and LD_LIBRARY_PATH
Testing gnuradio as simply as possible:
python2 -c "from gnuradio import gr"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/gnuradio/gr/__init__.py", line 43, in <module>
from gnuradio_core import *
File "/usr/lib/python2.7/site-packages/gnuradio/gr/gnuradio_core.py", line 23, in <module>
from gnuradio_core_runtime import *
File "/usr/lib/python2.7/site-packages/gnuradio/gr/gnuradio_core_runtime.py", line 26, in <module>
_gnuradio_core_runtime = swig_import_helper()
File "/usr/lib/python2.7/site-packages/gnuradio/gr/gnuradio_core_runtime.py", line 22, in swig_import_helper
_mod = imp.load_module('_gnuradio_core_runtime', fp, pathname, description)
ImportError: dynamic module does not define init function (init_gnuradio_core_runtime)
Upon inspecting the shared object that seems to be broken:
nm -D /usr/lib/python2.7/site-packages/gnuradio/gr/_gnuradio_core_runtime.so | grep gnuradio
00000000000258a0 T PyInit__gnuradio_core_runtime
On another machine (on which gnuradio was installed a few months ago), the symbol in the shared object name is init_gnuradio_core_runtime - which is what Python seems to expect.
gnuradio-companion gives an error message titles: "dynamic module does not define init function (init...":
Cannot import gnuradio.
Is the python path environment variable set correctly?
All OS: PYTHONPATH
Is the library path environment variable set correctly?
Linux: LD_LIBRARY_PATH
Windows: PATH
MacOSX: DYLD_LIBRARY_PATH