Greetings all, this is my first post here so I apologize ahead of time
for any clumsiness in the order and detail of my question. I’m using a
Macport install of Gnuradio 3.6.3 (system particulars below). So far
I’ve had a good deal of success with Gnuradio but I’m at the point where
I need to start constructing custom modules. Unfortunately, I’ve
encountered some difficulties with the out-of-tree build tutorial using
gr_modtool.
Here is a summary of the problems, the first two being general FYI, the
last being my question to the group.
-
A minor difficulty is that gr_modtool.py does not appear to be
placing the class definitions and the instantiation of the class
object(s) in the proper order. This was easy enough to remedy by hand. -
A second minor difficulty is that makexml does not appear to work at
all. Again, this is easy enough to remedy by hand.
- My main problem that I’m 8+ hours into is that with my installation I
cannot get cmake to set an explicit path to my dylib file and changing
DYLD_LIBRARY_PATH produces other conflicts with gnuradio-companion.
Unfortunately my competency with cmake/make and modifying related files
is minimal. Can someone provide some insight into how I can explicitly
link my _howto_swig.so to the full path name of the dylib
(libgnuradio-howto.dylib) associated with it during the build process?
My suspicion is that I need to modify some aspect of the template in
gr_modtool.py but any ideas would be appreciated. For clarity, the
details of my system and build problems are provided below sequentially.
System: Mac OSX 10.6.8
%uname -a:
Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011;
root:xnu-1504.15.3~1/RELEASE_I386 i386
Gnuradio 3.6.3 from Macports:
gnuradio
@3.6.3_1+docs+full+grc+jack+orc+portaudio+python27+qtgui+sdl+swig+uhd+wavelet+wxgui
Using:
gr_modtool.py from github
Following tutorial:
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules
I followed the tutorial to the letter up to the cmake configuration
where I called cmake as follows (macport install):
%cmake -DCMAKE_INSTALL_PREFIX=/opt/local …/
This process proceeds and completes unremarkably. At this point
%make test
Fails.
%ctest -V
reports:
fails with:
2: File
“/Users/xxxxxx/Documents/Work/Gnuradio/modules/gr-howto/build/swig/howto_swig.py”,
line 314, in
2: square_ff = square_ff.make;
2: NameError: name ‘square_ff’ is not defined
2/2 Test #2: qa_square_ff …***Failed 0.32 sec
An inspection of howto_swig.py reveals that square_ff = square_ff.make
is called before the class square_ff is defined. This appears to be an
error in order with how gr_modtool constructs the swig file.
Rearranging the order within howto_swig.py eliminates the “name
‘square_ff’ is not defined error.” At this point there is a thread join
error in the test which is remedied by rolling back boost 1.52 to boost
1.51 (known issue).
An attempt to make the xml file fails entirely:
%gr_modtool.py makexml square_ff
Operating in directory .
GNU Radio module name identified: howto
Warning: This is an experimental feature. Don’t expect any magic.
Searching for matching files in lib/:
Making GRC bindings for lib/square_ff_impl.cc…
Can’t parse the argument list: Found closing parentheses before
finishing last argument (this is how far I got: [])
Fortunately this is no problem. Easy enough to edit by hand.
Execution of
%sudo make install
completes successfully in the proper directories, or at least the
directories I think I want the install to be located.
When I obtain a Python command prompt and attempt to import howto I get
the following error message:
Traceback (most recent call last):
File “”, line 1, in
File “/opt/local/lib/python2.7/site-packages/howto/init.py”, line
45, in
from howto_swig import *
File “/opt/local/lib/python2.7/site-packages/howto/howto_swig.py”,
line 26, in
_howto_swig = swig_import_helper()
File “/opt/local/lib/python2.7/site-packages/howto/howto_swig.py”,
line 22, in swig_import_helper
_mod = imp.load_module(‘_howto_swig’, fp, pathname, description)
ImportError:
dlopen(/opt/local/lib/python2.7/site-packages/howto/_howto_swig.so, 2):
Library not loaded: libgnuradio-howto.dylib
Referenced from:
/opt/local/lib/python2.7/site-packages/howto/_howto_swig.so
Reason: image not found
The dylib is properly installed:
%ls /opt/local/lib|grep howto
libgnuradio-howto.dylib
The files appear to be in the desired location:
%ls /opt/local/lib/python2.7/site-packages/howto
init.py init.pyc init.pyo _howto_swig.so howto_swig.py
howto_swig.pyc howto_swig.pyo
otool indicates that there is no explicit path to ibgnuradio-howto.dylib
%otool -L
/opt/local/lib/python2.7/site-packages/howto/_howto_swig.so/opt/local/lib/python2.7/site-packages/howto/_howto_swig.so:
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/Python
(compatibility version 2.7.0, current version 2.7.0)
libgnuradio-howto.dylib (compatibility version 0.0.0, current version
0.0.0)
/opt/local/lib/libboost_filesystem-mt.dylib (compatibility version
0.0.0, current version 0.0.0)
/opt/local/lib/libboost_system-mt.dylib (compatibility version 0.0.0,
current version 0.0.0)
/opt/local/lib/libgruel.3.6.4git.dylib (compatibility version 3.6.4,
current version 0.0.0)
/opt/local/lib/libgnuradio-core.3.6.4git.dylib (compatibility version
3.6.4, current version 0.0.0)
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
125.2.11)
It appears as if I need to set target_link_libraries somewhere in the
middle of all of this build process.
Unfortunately I cannot simply append /opt/local/lib to DYLD_LIBRARY_PATH
as this causes catastrophic errors with the gtk system framework when I
attempt to launch gnuradio-companion. Again, I cannot modify
DYLD_LIBRARY_PATH. I need to have it linked with its full path during
the build process.