Hi All:
A question and plea for help please!
I am new to the list. I have used the rtl-sdr/osmosdr blocks in gnuradio companion before under Ubuntu, but am having problems getting them set up under Mac OS.
My gnuradio/grc install used the macports facility. Took a bit of time to get everything to compile, but grc comes up okay.
I have successfully downloaded, cmake/make, and installed the rtl-sdr and gr-osmocom packages from git.
I had to move all the installed files from /usr/local to /opt/local in order to get everything into the right place for the macports gnuradio to find it.
What works:
I can load grc and see the osmocom/rtl-sdr blocks. I can add and modify them as usual.
Here's a screen shot:
What doesn't work:
When I generate/run the flow graph, I get messages indicating that the osmosdr module cannot be found:
--- Executing: "/Users/mcquiggi/Desktop/top_block.py"
Traceback (most recent call last): File "/Users/mcquiggi/Desktop/top_block.py", line 19, in <module> import osmosdr ImportError: No module named osmosdr
Done
---
Note also that from my xterm if I enter simply:
Kevins-MacBook-Air:~ mcquiggi$ python -c "import osmosdr" Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named osmosdr Kevins-MacBook-Air:~ mcquiggi$
I get a python error.
There is an 'osmosdr' directory in /opt/local/lib/python2.7/site-packages/.
What I have tried:
- creatling a soft link called 'osmosdr' (ln -s) in /opt/local/lib/python2.7/ to /opt/local/lib/python2.7/site-packages/osmosdr - setting PYTHONPATH to /opt/local/lib/python2.7/site-packages/
Here is the contents of /opt/local/lib/python2.7/site-packages/osmosdr:
Kevins-MacBook-Air:~ mcquiggi$ ls /opt/local/lib/python2.7/site-packages/osmosdr __init__.py _osmosdr_swig.so osmosdr_swig.pyo __init__.pyc osmosdr_swig.py __init__.pyo osmosdr_swig.pyc Kevins-MacBook-Air:~ mcquiggi$
So it looks like it -may- be a simple problem to solve, but I lack the necessary knowledge of how osmosdr integrates with gnuradio.
Any help appreciated,
Kevin
I had to move all the installed files from /usr/local to /opt/local in order to get everything into the right place for the macports gnuradio to find it.
I'm not sure whether this is the problem here, but this in itself is bad. When you compile from source, often the paths get hard-coded into the executables. Once you move them, the hard-coded paths are no longer valid and all sorts of strange 'not found' errors can appear.
I would suggest recompiling, but changing the installation path to /opt/local instead of the default /usr/local, so that any hard-coded paths remain valid after installation.
Cheers, Adam.
On Dec 2, 2012, at 3:44 AM, Adam Nielsen a.nielsen@shikadi.net wrote:
I had to move all the installed files from /usr/local to /opt/local []
I would suggest recompiling, []
To facilitate the process, you may use the gnuradio+osmo+rtlsdr+uhd build script. I've customized it to allow for a custom destdir.
Find it here:
https://gist.github.com/3565794
HTH,
~Marcello
Hi All:
Thanks for the suggestions!
I rebuilt both gr-osmosdr and rtl-sdr from scratch, with the addition of changing the install directory to /opt/local in the cmake_install script. I also ensured that all parts of the old installs in /usr/local were deleted.
Steps:
1) go to the build directory of both packages and do a "rm -rf *" to ensure -everything- is cleaned out; 2) cmake ../ 3) vi cmake_install script and change /usr/local to /opt/local at the top. 4) make 5) sudo make install
This put everything in the correct place, but still a no-go. Python chokes on the line in top_block.py that says "import osmosdr". Module not found.
I tried PYTHONPATH again to see if I could give python a hint, but no go.
Just seems that python needs to be able to find the osmosdr module.
Marcello, thanks for the suggestion re the build-gnuradio script, but it won't work on a Mac/Darwin. It took the better part of a month working with the macports.org folks just to get gnuradio to compile cleanly and run. It's a very complex port for them, with everything (just about) going into different places, so I wouldn't want to even risk trying it. Might screw my main machine up!
If I can't get this running I may just go back to an Ubuntu machine for gnuradio. The Mac would be better for my needs though, as I travel a bit and want to use grc etc on the road. That was the impetus for getting the package to run on the Mac in the first place.
Kevin
On 2012-12-01, at 7:37 PM, "Marcello Barnaba (void)" vjt@openssl.it wrote:
HTH,