Raise boost baseline version check?

David Ostrovsky d.ostrovsky at gmx.de
Thu May 4 05:59:51 UTC 2017

Building LO on OpenSUSE 42.2, against the latest available system
boost library (1.54.0), is failing here with:

error: ‘boost::integer’ has not been declared
         T gcd1 = boost::integer::gcd(i.numerator(), den);

Looking into the most recent version:


reveals, that this part of the code is consumed from:

#include <boost/integer/common_factor_rt.hpp> // for
boost::integer::gcd, lcm

On 1.54 the similar line in rational.hpp read:

#include <boost/math/common_factor_rt.hpp>  // for boost::math::gcd,

So that this diff fixed the problem here:

diff --git a/tools/source/generic/fract.cxx
index bc9bef467e86..02fb711c0c84 100644
--- a/tools/source/generic/fract.cxx
+++ b/tools/source/generic/fract.cxx
@@ -180,8 +180,8 @@ namespace
         T den = r.denominator();
         // Avoid overflow and preserve normalization
-        T gcd1 = boost::integer::gcd(i.numerator(), den);
-        T gcd2 = boost::integer::gcd(num, i.denominator());
+        T gcd1 = boost::math::gcd(i.numerator(), den);
+        T gcd2 = boost::math::gcd(num, i.denominator());
         bool fail = false;
         fail |= o3tl::checked_multiply(i.numerator() / gcd1, num /
gcd2, num);

Unless we want to make the code compile against different boost
versions, should we rather bump the boost version check?

My autogen.input is: [1].

* [1] http://paste.openstack.org/show/608796/

More information about the LibreOffice mailing list