Macport switching between gnuradio and gnuradio-devel ports with installed gr-osmosdr?

Mike,

I wanted to switch from gnuradio macport to gnu radio-devel port to
hopefully avoid the following error:

bash-3.2$ ./multimode.py
Mac OS; GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM
build 2336.11.00); Boost_105300; UHD_003.005.001-0-unknown

Using Volk machine: sse4_1_64_orc
Traceback (most recent call last):
File “./multimode.py”, line 1086, in
tb = multimode(ahw=options.ahw, ppm=options.ppm, vol=options.vol,
ftune=options.ftune, xftune=options.xftune, srate=options.srate,
upclo=options.upclo, devinfo=options.devinfo, agc=options.agc,
arate=options.arate, upce=options.upce, mthresh=options.mthresh,
flist=options.flist, mbw=options.mbw, deemph=options.deemph,
dmode=options.dmode, dfifo=options.dfifo, aout=options.aout,
freq=options.freq)
File “./multimode.py”, line 301, in init
self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback)
File
“/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gnuradio/gr/hier_block2.py”,
line 54, in getattr
return getattr(self._hb, name)
AttributeError: ‘gr_hier_block2_sptr’ object has no attribute
‘set_callback’
bash-3.2$

I had the following installed:

bash-3.2$ port installed gnuradio
The following ports are currently installed:
gnuradio
@3.6.4.1_0+docs+full+grc+jack+orc+portaudio+python27+qtgui+sdl+swig+uhd+wavelet+wxgui
(active)
bash-3.2$
bash-3.2$ port installed rtl-sdr
The following ports are currently installed:
rtl-sdr @20130301_0 (active)
bash-3.2$
bash-3.2$ port installed gr-osmosdr
The following ports are currently installed:
gr-osmosdr @20130313_0+docs+full+python27+swig+uhd (active)
bash-3.2$

I deactivated gnuradio, and installed and activated gnuradio-devel.
However this will not work with gr-osmosdr port since it is dependent on
‘gnuradio’, see (I assume there is an issue with not being able to be
dependent on two other ports in an ‘or’ relationship?):

bash-3.2$ port deps gr-osmosdr
Full Name: gr-osmosdr @20130313_0+python27
Fetch Dependencies: git-core
Build Dependencies: cmake
Library Dependencies: gnuradio, rtl-sdr, python27
bash-3.2$

Any suggestions?

Thanks,
mlk

PS: Thanks for adding the gr-osmosdr package to macports. Hopefully
there is a simple way to install it so that it can work with either
gnuradio or gnuradio-devel when switching back and forth. I suppose
another way to do this might be to not install macports gr-osmosdr and
instead install their package in /user/local so that either gnuradio or
gnuradio-devel could use it without the dependency issue.

Hi Mike - You’re (all) welcome for the gr-osmosdr port. Seems like it
is pretty well used as well as kept up, and so is a good candidate for
being in MacPorts. That’s a great suggestion! I’m doing a “port
selfupdate” right now to get the latest of everything, and when that is
done I will fix this issue. I’ll post back here when it’s ready; should
be later this morning (US/ET). - MLD

This is taking longer than I expected, because I have to modify
something other than the Portfile in order to get the functionality I
need. I have to run that change past “the MacPorts powers that be”;
they are usually pretty responsive, usually within a day or so. I’ll
post back when the change is in place. - MLD

Hi Michael,

thank you very much for your great job with the gnuradio* and gr-osmosdr
stuff in Macports, even keeping us updated about the progress! Just a
comment: I’ve found that the gnuradio-next
@3.7.0_20130326_0+python27+uhd
build fails in my system. It didn’t happen with previous versions. It’s
a
dwarf in my computer, or someone else has experienced the same? Do I
better
wait for that forthcoming release?

Best regards,
Carles

On Mon, Apr 1, 2013 at 12:44 PM, Michael D. [email protected]
wrote:

Carles points out that the next branch is failing on OSX (via the
“gnuradio-next” port). Here’s the error log. Ideas? - MLD

Is this the current HEAD on the next branch? As we’ve said, we’re
going through a lot of major changes on next right now as the last
steps to 3.7. One huge change I’ve just recently finished was removing
gruel and putting all of it’s functionality into gnuradio-runtime.
That could either fix this problem or make it worse…

Regardless, I’m not inclined to spend too much time right now
debugging it until we’re more fully settled on the structure in
‘next.’ For now, I’d go back before the major gnuradio-runtime
changes. I think this commit should work:
40ab0030dbe821c9ed475a0b73898040f4af581c

I might bug you for some help on OSX issues in a few days when we
think that we’re ready.

Thanks,
Tom

Carles points out that the next branch is failing on OSX (via the
“gnuradio-next” port). Here’s the error log. Ideas? - MLD

[ 6%] Building CXX object
gnuradio-runtime/lib/CMakeFiles/gnuradio-runtime.dir/gr_basic_block.cc.o
cd
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/gnuradio-runtime/lib
&& /usr/bin/clang++ -DALIGNED_MALLOC=0 -DENABLE_GR_LOG
-DHAVE_ARPA_INET_H -DHAVE_COSF -DHAVE_GETPAGESIZE -DHAVE_GETTIMEOFDAY
-DHAVE_LOG4CPP -DHAVE_MMAP -DHAVE_NANOSLEEP -DHAVE_NETDB_H
-DHAVE_NETINET_IN_H -DHAVE_POSIX_MEMALIGN -DHAVE_PTHREAD_SIGMASK
-DHAVE_SELECT -DHAVE_SIGACTION -DHAVE_SIGNAL_H -DHAVE_SINF
-DHAVE_SNPRINTF -DHAVE_SYSCONF -DHAVE_SYS_IPC_H -DHAVE_SYS_MMAN_H
-DHAVE_SYS_RESOURCE_H -DHAVE_SYS_SELECT_H -DHAVE_SYS_SHM_H
-DHAVE_SYS_SOCKET_H -DHAVE_SYS_TIME_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H
-DTRY_SHM_VMCIRCBUF -Dgnuradio_runtime_EXPORTS -pipe -Os -arch x86_64
-O3 -DNDEBUG -arch x86_64 -fPIC
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/gnuradio-runtime/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/gnuradio-runtime/lib/…/include
-I/opt/local/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gruel/src/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/gruel/src/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gruel/src/swig
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/gruel/src/swig
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/volk/include
-I/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/build/volk/include
-o CMakeFiles/gnuradio-runtime.dir/gr_basic_block.cc.o -c
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc:27:
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:63:53:
error: no member named ‘comperator’ in namespace ‘pmt’; did you mean
‘operator’?
typedef std::map<pmt::pmt_t , msg_handler_t, pmt::comperator>
d_msg_handlers_t;
~~~~~^
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:67:50:
error: no member named ‘comperator’ in namespace ‘pmt’; did you mean
‘operator’?
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>
msg_queue_map_t;
~~~~~^
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:68:50:
error: no member named ‘comperator’ in namespace ‘pmt’; did you mean
‘operator’?
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>::iterator
msg_queue_map_itr;
~~~~~^
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:68:63:
error: non-friend class member ‘iterator’ cannot have a qualified name
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>::iterator
msg_queue_map_itr;
~~^
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:68:63:
error: typedef declarator cannot be qualified
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>::iterator
msg_queue_map_itr;
~~^
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:68:71:
error: expected ‘;’ at end of declaration list
typedef std::map<pmt::pmt_t, msg_queue_t, pmt::comperator>::iterator
msg_queue_map_itr;
^
;
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:69:75:
error: no member named ‘comperator’ in namespace ‘pmt’; did you mean
‘operator’?
std::map<pmt::pmt_t, boost::shared_ptrboost::condition_variable,
pmt::comperator> msg_queue_ready;
~~~~~^
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:120:28:
error: member reference base type ‘d_msg_handlers_t’ (aka ‘int’) is not
a structure or union
return (d_msg_handlers.find(which_port) != d_msg_handlers.end());
~~~~~~~~~~^
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:120:63:
error: member reference base type ‘d_msg_handlers_t’ (aka ‘int’) is not
a structure or union
return (d_msg_handlers.find(which_port) != d_msg_handlers.end());
~~~~~~~~~~~~^~
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:133:21:
error: type ‘d_msg_handlers_t’ (aka ‘int’) does not provide a subscript
operator
d_msg_handlerswhich_port; // Yes, invoke it.
~~~~^
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:151:39:
error: no member named ‘intern’ in namespace ‘pmt’
pmt::pmt_t alias_pmt(){ return pmt::intern(alias()); }
~~~~~^
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:189:17:
error: member reference base type ‘msg_queue_map_t’ (aka ‘int’) is not a
structure or union
if(msg_queue.find(which_port) == msg_queue.end())
~~~~~^
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:189:47:
error: member reference base type ‘msg_queue_map_t’ (aka ‘int’) is not a
structure or union
if(msg_queue.find(which_port) == msg_queue.end())
~~~~~^~
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:191:21:
error: type ‘msg_queue_map_t’ (aka ‘int’) does not provide a subscript
operator
return msg_queue[which_port].empty();
~^

In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc:27:
In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:36:
In file included from /opt/local/include/gruel/thread.h:25:
In file included from /opt/local/include/boost/thread/thread.hpp:17:
In file included from
/opt/local/include/boost/thread/pthread/thread_data.hpp:11:
In file included from /opt/local/include/boost/thread/lock_guard.hpp:12:
In file included from
/opt/local/include/boost/thread/detail/move.hpp:16:
In file included from /opt/local/include/boost/type_traits/decay.hpp:18:
/opt/local/include/boost/mpl/eval_if.hpp:38:26: error: no type named
‘type’ in ‘boost::range_mutable_iterator’
typedef typename f
::type type;
~~~~~~~~~~~^~
/opt/local/include/boost/foreach.hpp:360:48: note: in instantiation of
template class 'boost::mpl::eval_if<mpl
::bool
,
boost::range_const_iterator, boost::range_mutable_iterator >’
requested here
typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if<
^
/opt/local/include/boost/foreach.hpp:660:40: note: in instantiation of
template class 'boost::foreach_detail
::foreach_iterator<int,
mpl
::bool
>’ requested here
inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>
^
/opt/local/include/boost/foreach.hpp:661:1: note: while substituting
deduced template arguments into function template ‘begin’ [with T = int,
C = mpl
::bool
]
begin(auto_any_t col, type2type<T, C> *, boost::mpl::true
*) // rvalue
^
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc:27:
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:195:19:
error: expected a class or namespace
BOOST_FOREACH(msg_queue_map_t::value_type &i, msg_queue) {
^
/opt/local/include/boost/foreach.hpp:1108:14: note: expanded from macro
‘BOOST_FOREACH’
for (VAR = BOOST_FOREACH_DEREF(COL);
!BOOST_FOREACH_ID(_foreach_continue);
BOOST_FOREACH_ID(_foreach_continue) = true)
^
In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc:27:
In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:27:
In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_runtime_types.h:27:
In file included from
/opt/local/var/macports/build/opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_types.h:27:
In file included from /opt/local/include/boost/shared_ptr.hpp:17:
In file included from
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from
/opt/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/4.2.1/memory:52:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:74:
/usr/include/c++/4.2.1/bits/stl_iterator_base_types.h:128:24: error:
type ‘int’ cannot be used prior to ‘::’ because it has no members
typedef typename Iterator::iterator_category iterator_category;
^
/opt/local/include/boost/detail/iterator.hpp:82:7: note: in
instantiation of template class ‘std::iterator_traits’ requested
here
: std::iterator_traits
^
/opt/local/include/boost/iterator/iterator_traits.hpp:36:37: note: in
instantiation of template class ‘boost::detail::iterator_traits’
requested here
typedef typename boost::detail::iterator_traits::reference
type;
^
/opt/local/include/boost/foreach.hpp:400:5: note: in instantiation of
template class ‘boost::iterator_reference’ requested here
: iterator_reference<BOOST_DEDUCED_TYPENAME foreach_iterator<T,
C>::type>
^
/opt/local/include/boost/foreach.hpp:768:31: note: in instantiation of
template class 'boost::foreach_detail
::foreach_reference<int,
mpl
::bool
>’ requested here
inline BOOST_DEDUCED_TYPENAME foreach_reference<T, C>::type
^
/opt/local/include/boost/foreach.hpp:769:1: note: while substituting
deduced template arguments into function template ‘deref’ [with T = int,
C = mpl
::bool
]
deref(auto_any_t cur, type2type<T, C> *)
^
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/lib/gr_basic_block.cc:27:
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_basic_block.h:27:
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_runtime_types.h:27:
In file included from
/opt/local/var/macports/build/_opt_MacPorts_trunk_dports_science_gnuradio/gnuradio-next/work/gnuradio-3.7.0_20130329/gnuradio-runtime/include/gr_types.h:27:
In file included from /opt/local/include/boost/shared_ptr.hpp:17:
In file included from
/opt/local/include/boost/smart_ptr/shared_ptr.hpp:27:
In file included from
/opt/local/include/boost/config/no_tr1/memory.hpp:21:
In file included from /usr/include/c++/4.2.1/memory:52:
In file included from /usr/include/c++/4.2.1/bits/stl_algobase.h:74:
/usr/include/c++/4.2.1/bits/stl_iterator_base_types.h:129:24: error:
type ‘int’ cannot be used prior to ‘::’ because it has no members
typedef typename _Iterator::value_type value_type;
^
/usr/include/c++/4.2.1/bits/stl_iterator_base_types.h:130:24: error:
type ‘int’ cannot be used prior to ‘::’ because it has no members
typedef typename _Iterator::difference_type difference_type;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: ***
[gnuradio-runtime/lib/CMakeFiles/gnuradio-runtime.dir/gr_basic_block.cc.o]
Error 1

This is 007b401cf14fcfc067d11f5e4d2ca1730407803b, which according to my
git-foo is the latest commit to (aka HEAD of) this branch. Fixing it
“right now” is not a big deal IMHO: I just keep the gnuradio-next branch
up to date and if it works that’s great and if it does not then (as the
description states) use the current gnuradio-next install and check back
in a few days and hopefully the build will have been fixed. I’m going
to leave this port where it is, and I’ll just continue to update it as
commits are merged.

Please do feel free to ping me about OSX stuff if/when you need/want to.

  • MLD

Here’s a patch to fix the issue, which just switches the
“include_directories” ordering such that the internal pmt.h is found
before the already-installed pmt.h. At least with MacPorts, having this
ordering correct makes all the difference, so I encourage folks to think
carefully about this ordering before committing it. This patch restores
this ordering, or at least I think it does; it works for me to get
gnuradio-next building correctly again for me (and, mostly passing “make
test”). - MLD

On Mon, Apr 1, 2013 at 1:26 PM, Michael D. [email protected]
wrote:

This is 007b401cf14fcfc067d11f5e4d2ca1730407803b, which according to my git-foo
is the latest commit to (aka HEAD of) this branch. Fixing it “right now” is not a
big deal IMHO: I just keep the gnuradio-next branch up to date and if it works
that’s great and if it does not then (as the description states) use the current
gnuradio-next install and check back in a few days and hopefully the build will
have been fixed. I’m going to leave this port where it is, and I’ll just continue
to update it as commits are merged.

Please do feel free to ping me about OSX stuff if/when you need/want to. - MLD

Got it. That sounds good. I’ll let you know when things change.

Tom

On Tue, Apr 2, 2013 at 9:09 AM, Michael D. [email protected]
wrote:

Here’s a patch to fix the issue, which just switches the “include_directories”
ordering such that the internal pmt.h is found before the already-installed pmt.h.
At least with MacPorts, having this ordering correct makes all the difference, so
I encourage folks to think carefully about this ordering before committing it.
This patch restores this ordering, or at least I think it does; it works for me to
get gnuradio-next building correctly again for me (and, mostly passing “make
test”). - MLD


Johnathan C.
Corgan Labs - SDR Training and Development Services
http://corganlabs.com