I recently upgraded to Ubuntu 20.04. I realized that gr-gsm is not yet in the repository, so I proceeded to downloading the source code for gr-gsm and compiling it by myself.
Unfortunately, the gnuradio version in Ubuntu 20.04 is too new for gr-gsm. Hence I had to first download gnuradio version 3.7 and compile it from source. After successfully doing that, I proceeded to build gr-gsm.
Unfortunately, I kept getting an error (from multiple locations) but basically the same about not being able to convert from std::shared_ptr<...> to boost::shared_ptr<...>
.
/mnt/Lenovo/projects/gnuradio/gr-gsm/lib/decoding/tch_f_decoder_impl.cc: In static member function ‘static gr::gsm::tch_f_decoder::sptr gr::gsm::tch_f_decoder::make(gr::gsm::tch_mode, bool)’:
/mnt/Lenovo/projects/gnuradio/gr-gsm/lib/decoding/tch_f_decoder_impl.cc:65:9: error: could not convert ‘gnuradio::get_initial_sptr(T*) [with T = gr::gsm::tch_f_decoder_impl]()’ from ‘std::shared_ptr<gr::gsm::tch_f_decoder_impl>’ to ‘gr::gsm::tch_f_decoder::sptr’ {aka ‘boost::shared_ptr<gr::gsm::tch_f_decoder>’}
64 | return gnuradio::get_initial_sptr
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
65 | (new tch_f_decoder_impl(mode, boundary_check));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| std::shared_ptr<gr::gsm::tch_f_decoder_impl>
from here:
...
control_channels_decoder::make()
{
return gnuradio::get_initial_sptr
(new control_channels_decoder_impl());
}
...
So I thought, that was the end of that. Can't build gr-gsm on Ubuntu 20.04, because the compiler version is newer and probably the 'old' code of gr-gsm needs to brought up to date before that can happen. Short of doing something like done in this SO Answer at every location from where that error pops up, I had to wait for the devs to update gr-gsm.
However, I repeated the same steps on Debian 10, i.e.
- Downloaded from source 'gnuradio 3.7' and compiled it.
- Downloaded gr-gsm from source and went about compiling it.
And unexpectedly it compiled fine.
The GCC version on Debian 10 is 8.3. The GCC version on Ubuntu 20.04 is 9.3.
I thought it is at most a problem of a different C++ standard being used in the two GCC versions. So I passed -std=c++11
, -std=c++14
and -std=c++17
to CMAKE_CXX_FLAG
to the Debian 10 build to try to break it. Nothing changed, it successfully built.
On the flip side, whether I passed -std=c++11
, -std=c++14
or -std=c++17
to CMAKE_CXX_FLAG
to the Ubuntu 20.04 build, nothing changed; the same error still popped up.
What exactly could be different then, between GCC8.3 and GCC9.3 that allowed the same piece of code to be successfully built from the first but not from the later? Even more so when in fact considering that Ubuntu is a derived distro from Debian.