# Toggle use of bad versions of Boost

**URL:** <https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880>\
**Category:** GNU Radio\
**Created:** [February 13, 2013, 8:38pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880 "2013-02-13T20:38:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 13, 2013, 8:38pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/1 "2013-02-13T20:38:11Z")

</div>

GNU Radio: now allowing you to shoot yourself in the foot!

We’ve identified a few versions of Boost that don’t work well with GNU  
Radio, 1.46, 1.47, and 1.52. A little while ago, I updated our cmake  
build  
files to look for these specific versions and disable their use if  
found.

Sadly, many distros currently ship with one of these known bad versions.  
Looking at Boost’s website, 1.47 and 1.52 are by far the most downloaded  
Boost versions. So, as recommended by Johnathan, I put in a cmake  
command  
line option that allows you to override the version check so GNU Radio  
will  
build with any current Boost.

To use it, just specify “-DENABLE\_BAD\_BOOST=True” on your cmake command  
line. By default this is False. That will allow you to build against  
anything. If this value is False, all GNU Radio components will be  
disabled  
if it finds one of the bad versions. (VOLK and a couple of others will  
still pass and compile since they are not affected by the problem).

Just be aware that using one of these versions can cause problems.  
Specifically, it can lock up your application when shutting down a  
flowgraph. Also, many distros that ship with one of these bad versions  
also  
have other, good, versions that you can pretty easily switch to.

Tom

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 1:02pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/2 "2013-02-26T13:02:04Z")

</div>

On Wed, Feb 13, 2013 at 8:12 PM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> build with any current Boost.  
> have other, good, versions that you can pretty easily switch to.

Hi,

Sorry for the late reply, but I just realized that half of my  
computers running Mint 13 (based on Ubuntu 12.04) come with Boost  
1.46, yet I have had no problem building gnuradio without using  
“-DENABLE\_BAD\_BOOST=True”  
Admittedly, this distro appears to have a horrible mix of 1.46 and  
1.48, which may confuse cmake - I really have no idea which one really  
is installed but I do have runtime issues on these computers. If  
anybody has ideas for what we can do on Mint 13 / Ubuntu 12.04, please  
let me know.

Alex

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 3:17pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/3 "2013-02-26T15:17:05Z")

</div>

On Tue, Feb 26, 2013 at 7:01 AM, Alexandru C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > line option that allows you to override the version check so GNU Radio will  
> > flowgraph. Also, many distros that ship with one of these bad versions also  
> > 1.48, which may confuse cmake - I really have no idea which one really  
> > is installed but I do have runtime issues on these computers. If  
> > anybody has ideas for what we can do on Mint 13 / Ubuntu 12.04, please  
> > let me know.
> 
> Alex

Alex,

You can see which Boost version Cmake is finding for you by looking at  
CMakeCache.txt in the top of the build directory. Check out the  
“Boost\_\_LIBRARY” and “Boost\_INCLUDE\_DIR” to see which ones  
were found and are being used. Hopefully, it’s finding the 1.48  
version that’s installed.

Tom

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 3:38pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/4 "2013-02-26T15:38:07Z")

</div>

Hi,

> You can see which Boost version Cmake is finding for you by looking at  
> CMakeCache.txt in the top of the build directory. Check out the  
> “Boost\_\_LIBRARY” and “Boost\_INCLUDE\_DIR” to see which ones  
> were found and are being used. Hopefully, it’s finding the 1.48 version  
> that’s  
> installed.

It seems some older gnuradio versions and other SDR tools do not want  
the  
1.48, they want a 1.46 or maybe a boost lib without any version in its  
name,  
who knows. I got into problems when compiling gnuradio 3.4.2 for  
OpenBTS,  
but lacking the knowledge how to solve this in a proper way I just  
fiddled  
around with uninstalling and installing several parts of the packages  
until  
it compiled. Not satisfying, such a workaround…

> Tom

Ralph.

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 3:55pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/5 "2013-02-26T15:55:39Z")

</div>

On Tue, Feb 26, 2013 at 9:38 AM, Ralph A. Schmid, dk5ras  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 1.48, they want a 1.46 or maybe a boost lib without any version in its name,  
> who knows. I got into problems when compiling gnuradio 3.4.2 for OpenBTS,  
> but lacking the knowledge how to solve this in a proper way I just fiddled  
> around with uninstalling and installing several parts of the packages until  
> it compiled. Not satisfying, such a workaround…
> 
> > Tom
> 
> Ralph.

Two things with this. First, the checking and rejecting of bad Boost  
versions is new since we just started to understand the issue. So  
older versions do not have this protection.

Second, GNU Radio doesn’t /prefer/ a version of Boost; it’ll likely  
just picks the first one it finds that is valid. With 3.4.2, the only  
non-valid Boost versions would be those before the minimum version of  
1.35. Most likely, it’ll take whichever the sym link to  
libboost\_xxx.so it finds. For instance, my machine has:

/usr/lib/libboost\_filesystem-mt.so → libboost\_filesystem.so.1.48.0

It’ll depend on how to installed, order of install, or OS issues that  
would determine this if you have multiple versions installed.

You can always tell cmake (and configure before it) which Boost  
libraries and include directories you want to specify. With cmake, you  
use -DBoost\_LIBRARY\_DIRS=…, -DBoost\_INCLUDE\_DIR=…, and even  
library-specific directives (if multiple Boost libs are installed into  
the same directory) like  
-DBoost\_FILESYSTEM\_LIBRARY=…/libboost\_filesystem-mt.so.

I don’t recall how to set these using configure, though.

Tom

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 5:23pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/6 "2013-02-26T17:23:19Z")

</div>

On Tue, Feb 26, 2013 at 11:10 AM, Alexandru C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > > Looking at Boost’s website, 1.47 and 1.52 are by far the most downloaded  
> > > > Just be aware that using one of these versions can cause problems.  
> > > > “-DENABLE\_BAD\_BOOST=True”  
> > > > You can see which Boost version Cmake is finding for you by looking at  
> > > > info I see that it depends on libboost1.46-dev, which explain why all  
> > > > my boost libs are version 1.46. The same applies to many other boost  
> > > > packages, e.g. libboost-thread-dev.

Grep CMakeCache.txt for “Boost\_VERSION” and see what that returns. For  
1.48, it’ll look like 104800, and for 1.46 it should be 104600.

Also see what it tells you when you grep for ENABLE\_BAD\_BOOST. If this  
is set to True, it will allow any version.

> Cmake didn’t complain about bad boost version and I can see no version  
> info in CMakeCache.txt. Gnuradio compiles and install just fine. I can  
> rerun cmake and submit the cmake files on a system with boost 1.46 if  
> needed.

Maybe delete CMakeCache.txt and rerun cmake to make sure it refreshes  
everything.

> I have uninstalled the 1.46 libs manually (except those that are  
> required by some applications) and the installed libboost-xyz1.48-dev  
> libraries. recompiled uhd and gnuradio and it seems the run-time issue  
> I was having before (app freezes) is now gone.
> 
> Alex

Ok, glad you got it working.

Tom

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 5:11pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/7 "2013-02-26T17:11:38Z")

</div>

On Tue, Feb 26, 2013 at 3:15 PM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > Boost versions. So, as recommended by Johnathan, I put in a cmake command  
> > > Specifically, it can lock up your application when shutting down a  
> > > Admittedly, this distro appears to have a horrible mix of 1.46 and  
> > > CMakeCache.txt in the top of the build directory. Check out the  
> > > “Boost\_\_LIBRARY” and “Boost\_INCLUDE\_DIR” to see which ones  
> > > were found and are being used. Hopefully, it’s finding the 1.48  
> > > version that’s installed.

Actually, it seems that I only have version 1.46 libraries installed,  
see the attached file.

This is really screwed up: I have libboost-dev installed, which  
according to synaptic is at version 1.48.0.2. Looking in the package  
info I see that it depends on libboost1.46-dev, which explain why all  
my boost libs are version 1.46. The same applies to many other boost  
packages, e.g. libboost-thread-dev.

Cmake didn’t complain about bad boost version and I can see no version  
info in CMakeCache.txt. Gnuradio compiles and install just fine. I can  
rerun cmake and submit the cmake files on a system with boost 1.46 if  
needed.

I have uninstalled the 1.46 libs manually (except those that are  
required by some applications) and the installed libboost-xyz1.48-dev  
libraries. recompiled uhd and gnuradio and it seems the run-time issue  
I was having before (app freezes) is now gone.

Alex

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 7:13pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/8 "2013-02-26T19:13:11Z")

</div>

On Tue, Feb 26, 2013 at 5:21 PM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > > > Sadly, many distros currently ship with one of these known bad versions.
> > > > 
> > > > 1.46, yet I have had no problem building gnuradio without using
> > 
> > according to synaptic is at version 1.48.0.2. Looking in the package  
> > Cmake didn’t complain about bad boost version and I can see no version  
> > info in CMakeCache.txt. Gnuradio compiles and install just fine. I can  
> > rerun cmake and submit the cmake files on a system with boost 1.46 if  
> > needed.
> 
> Maybe delete CMakeCache.txt and rerun cmake to make sure it refreshes  
> everything.

Hi Tom,

I started with a clean build directory and after cmake finishes  
without errors I get:

oz9aec@romit ~/sdr/gnuradio/v3.6.3-146-ga54dc5ba/build $ cat  
CMakeCache.txt | grep ENABLE\_BAD\_BOOST  
ENABLE\_BAD\_BOOST:BOOL=OFF  
oz9aec@romit ~/sdr/gnuradio/v3.6.3-146-ga54dc5ba/build $ cat  
CMakeCache.txt | grep “Boost\_VERSION”  
Boost\_VERSION:INTERNAL=104601

Alex

---

<div class="post-metadata">

**Author:** ![tomrobinson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d78d45/32.png) [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Post date:** [February 26, 2013, 7:14pm UTC](https://www.ruby-forum.com/t/toggle-use-of-bad-versions-of-boost/229880/9 "2013-02-26T19:14:56Z")

</div>

On Tue, Feb 26, 2013 at 1:12 PM, Alexandru C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > > > > > pass and compile since they are not affected by the problem).  
> > > > > > computers running Mint 13 (based on Ubuntu 12.04) come with Boost  
> > > > > > Alex,  
> > > > > > This is really screwed up: I have libboost-dev installed, which
> 
> I started with a clean build directory and after cmake finishes  
> without errors I get:
> 
> oz9aec@romit ~/sdr/gnuradio/v3.6.3-146-ga54dc5ba/build $ cat  
> CMakeCache.txt | grep ENABLE\_BAD\_BOOST  
> ENABLE\_BAD\_BOOST:BOOL=OFF  
> oz9aec@romit ~/sdr/gnuradio/v3.6.3-146-ga54dc5ba/build $ cat  
> CMakeCache.txt | grep “Boost\_VERSION”  
> Boost\_VERSION:INTERNAL=104601
> 
> Alex

That clears it up, thanks! I read somewhere that the last two digits  
would always be 00, so that’s all I checked for. With yours being  
104601, I’ll need to be more clever about it.

Tom
