Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package uhd for openSUSE:Factory checked in 
at 2021-05-06 22:52:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/uhd (Old)
 and      /work/SRC/openSUSE:Factory/.uhd.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "uhd"

Thu May  6 22:52:50 2021 rev:29 rq:890968 version:4.0.0.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/uhd/uhd.changes  2020-12-07 15:02:11.356834351 
+0100
+++ /work/SRC/openSUSE:Factory/.uhd.new.2988/uhd.changes        2021-05-06 
22:53:31.618526873 +0200
@@ -1,0 +2,6 @@
+Wed May  5 16:36:38 UTC 2021 - Stefan Br??ns <[email protected]>
+
+- Fix build with Boost 1.76, replace boost::math usage with
+  equivalent stdlib functionality. Add uhd_fix_boost.patch.
+
+-------------------------------------------------------------------

New:
----
  uhd_fix_boost.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ uhd.spec ++++++
--- /var/tmp/diff_new_pack.DViHct/_old  2021-05-06 22:53:32.418523573 +0200
+++ /var/tmp/diff_new_pack.DViHct/_new  2021-05-06 22:53:32.422523556 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package uhd
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,8 @@
 URL:            https://files.ettus.com/manual/
 Source0:        
https://github.com/EttusResearch/uhd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        
https://github.com/EttusResearch/uhd/releases/download/v%{version}/uhd-images_%{version}.tar.xz
+# PATCH-FIX-UPSTREAM -- fix compilation with Boost 1.76
+Patch0:         uhd_fix_boost.patch
 BuildRequires:  cmake >= 2.6
 BuildRequires:  docutils
 BuildRequires:  doxygen
@@ -39,7 +41,6 @@
 BuildRequires:  pkgconfig(libxml-2.0)
 BuildRequires:  pkgconfig(udev)
 Requires:       udev
-%if 0%{?suse_version} > 1325
 BuildRequires:  libboost_filesystem-devel
 BuildRequires:  libboost_program_options-devel
 BuildRequires:  libboost_regex-devel
@@ -47,9 +48,6 @@
 BuildRequires:  libboost_system-devel
 BuildRequires:  libboost_test-devel
 BuildRequires:  libboost_thread-devel
-%else
-BuildRequires:  boost-devel >= 1.36.0
-%endif
 
 %description
 The UHD is the "Universal Software Radio Peripheral" hardware driver.
@@ -87,16 +85,12 @@
 Group:          Development/Libraries/Other
 Requires:       %{libname} = %{version}
 Recommends:     %{name}-doc
-%if 0%{?suse_version} > 1325
 Requires:       libboost_filesystem-devel
 Requires:       libboost_program_options-devel
 Requires:       libboost_regex-devel
 Requires:       libboost_serialization-devel
 Requires:       libboost_test-devel
 Requires:       libboost_thread-devel
-%else
-Requires:       boost-devel
-%endif
 
 %description    devel
 The UHD is the "Universal Software Radio Peripheral" hardware driver.
@@ -125,7 +119,7 @@
 This package contains binary firmware images for the Universal Hardware Driver 
(UHD).
 
 %prep
-%setup -q
+%autosetup -p1
 # fix python shebangs
 find . -type f -name "*.py" -exec sed -i '/^#!/ s|.*|#!%{_bindir}/python3|' {} 
\;
 # remove buildtime from documentation
@@ -158,7 +152,7 @@
 install -m 0644 -D %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules 
%{buildroot}%{_udevrulesdir}/10-usrp-uhd.rules
 rm %{buildroot}%{_libdir}/uhd/utils/uhd-usrp.rules
 
-## Move documentation at the default docdir
+## Move documentation to the default docdir
 mkdir -p  %{buildroot}%{_docdir}/uhd
 mv %{buildroot}%{_datadir}/doc/uhd %{buildroot}%{_docdir}/
 mv %{buildroot}%{_libdir}/uhd/utils/*[!.rules] %{buildroot}%{_bindir}

++++++ uhd_fix_boost.patch ++++++
>From 87e4f1f6da642d90903e29506246843d1ce712d2 Mon Sep 17 00:00:00 2001
From: StefanBruens <[email protected]>
Date: Wed, 5 May 2021 18:24:58 +0200
Subject: [PATCH] Replace boost::math::iround / math::sign with std::lround

Instead of multiplying zone with the sign repeatedly just make
the zone a signed value.

See #437, #438
---
 host/lib/usrp/usrp2/usrp2_impl.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/host/lib/usrp/usrp2/usrp2_impl.cpp 
b/host/lib/usrp/usrp2/usrp2_impl.cpp
index c2514ae02..9f797e707 100644
--- a/host/lib/usrp/usrp2/usrp2_impl.cpp
+++ b/host/lib/usrp/usrp2/usrp2_impl.cpp
@@ -20,6 +20,7 @@
 #include <boost/format.hpp>
 #include <boost/thread.hpp>
 #include <functional>
+#include <cmath>
 
 using namespace uhd;
 using namespace uhd::usrp;
@@ -917,22 +918,21 @@ double usrp2_impl::set_tx_dsp_freq(const std::string& mb, 
const double freq_)
     const double tick_rate = _tree->access<double>("/mboards/" + mb + 
"/tick_rate").get();
 
     // calculate the DAC shift (multiples of rate)
-    const int sign         = boost::math::sign(new_freq);
-    const int zone         = std::min(boost::math::iround(new_freq / 
tick_rate), 2);
-    const double dac_shift = sign * zone * tick_rate;
+    const int zone         = std::max(std::min<int>(std::lround(new_freq / 
tick_rate), 2), -2);
+    const double dac_shift = zone * tick_rate;
     new_freq -= dac_shift; // update FPGA DSP target freq
     UHD_LOG_TRACE("USRP2",
         "DSP Tuning: Requested " + std::to_string(freq_ / 1e6)
             + " MHz, Using "
               "Nyquist zone "
-            + std::to_string(sign * zone)
+            + std::to_string(zone)
             + ", leftover DSP tuning: " + std::to_string(new_freq / 1e6) + " 
MHz.");
 
     // set the DAC shift (modulation mode)
     if (zone == 0) {
         _mbc[mb].codec->set_tx_mod_mode(0); // no shift
     } else {
-        _mbc[mb].codec->set_tx_mod_mode(sign * 4 / zone); // DAC interp = 4
+        _mbc[mb].codec->set_tx_mod_mode(4 / zone); // DAC interp = 4
     }
 
     return _mbc[mb].tx_dsp->set_freq(new_freq) + dac_shift; // actual freq

Reply via email to