Hi Pter - It’s been a while since I tried OOT modules with GNU Radio;
it’s certainly possible that the CMake scripts don’t quite work on OSX
right now. I’ll add testing an OOT module to my queue for by
mid-August.
One recommendation is to not use /opt/local to install the module; use
/usr/local instead, or ~/GNURadio/local, or some other non-MacPorts
location. MacPorts is happiest when it has its space undisturbed by
anything else.
CMake should handle setting the libraries and Python scripts correctly,
so then all you should need to do is set PYTHONPATH to point to your new
location’s site-packages directory.
If the Python script is found, but importing it fails because the .dylib
was not found, then you’ll need to check out the .so file that is loaded
by Python; it should be located in the same directory as the Python
scripts. If the file is “foo.so”, you can do “otool -L foo.so” to see
what libraries the .so file is linked against. If the .dylib is found
but the wrong directory, you can use “install_name_tool” to change it to
what it is supposed to be – and, then please let me know so that I can
fix the issue within CMake.
To build GNU Radio outside of MacPorts, you’ll want to use something
like (all one line; watch for line breaks due to email), assuming from
the top-level GNU Radio source directory:
mkdir build
cd build
CC=/usr/bin/gcc CXX=/usr/bin/g++ cmake
-DPYTHON_EXECUTABLE=/opt/local/bin/python2.7
-DPYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers
-DPYTHON_LIBRARY=/opt/local/Library/Frameworks/Python.framework/Python
-DSPHINX_EXECUTABLE=/opt/local/bin/rst2html-2.7.py
-DCMAKE_INSTALL_PREFIX=/usr/local …
make
make test
and so forth. CMake does not do a great job finding Python on OSX when
multiple versions are installed; hence all of those defines.
gcc-4.7 from MacPorts cannot be used to compile GNU Radio just yet;
we’re working on that issue. If you want to use something other than
Clang, you can do that via (e.g., if you are using 10.8):
sudo port install gnuradio +full configure.compiler=llvm-gcc-4.2
to use Apple’s Xcode LLVM; for more info, see <
http://guide.macports.org > and search for “configure.compiler”.
I hope this helps. I’ll be away for the coming week; hopefully someone
else can jump in if you can’t figure this out. - MLD