pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/ham/uhd



Module Name:    pkgsrc
Committed By:   tnn
Date:           Tue Apr 12 20:10:46 UTC 2022

Modified Files:
        pkgsrc/ham/uhd: Makefile distinfo
Added Files:
        pkgsrc/ham/uhd/patches: patch-examples_getopt_getopt.c
            patch-examples_getopt_getopt.h
            patch-lib_rfnoc_vector__iir__block__control.cpp
            patch-lib_usrp_common_lmx2592.cpp
            patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp

Log Message:
uhd: fix some code portability issues


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 pkgsrc/ham/uhd/Makefile
cvs rdiff -u -r1.31 -r1.32 pkgsrc/ham/uhd/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.c \
    pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.h \
    pkgsrc/ham/uhd/patches/patch-lib_rfnoc_vector__iir__block__control.cpp \
    pkgsrc/ham/uhd/patches/patch-lib_usrp_common_lmx2592.cpp \
    pkgsrc/ham/uhd/patches/patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/ham/uhd/Makefile
diff -u pkgsrc/ham/uhd/Makefile:1.66 pkgsrc/ham/uhd/Makefile:1.67
--- pkgsrc/ham/uhd/Makefile:1.66        Sun Mar 27 17:03:28 2022
+++ pkgsrc/ham/uhd/Makefile     Tue Apr 12 20:10:46 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.66 2022/03/27 17:03:28 tnn Exp $
+# $NetBSD: Makefile,v 1.67 2022/04/12 20:10:46 tnn Exp $
 
 DISTNAME=      uhd-4.1.0.5
 PKGREVISION=   1
@@ -72,6 +72,10 @@ REPLACE_PYTHON+=     tests/streaming_perform
 REPLACE_PYTHON+=       tests/streaming_performance/run_N3xx_max_rate_tests.py
 REPLACE_PYTHON+=       tests/streaming_performance/run_X3xx_max_rate_tests.py
 
+# -pthread needed to turn on boost threads on some platforms
+CXXFLAGS.SunOS+=       -pthread
+LDFLAGS.SunOS+=                -lsocket
+
 INSTALLATION_DIRS+=    share/uhd
 INSTALLATION_DIRS+=    share/uhd/firmware
 INSTALLATION_DIRS+=    share/uhd/fpga

Index: pkgsrc/ham/uhd/distinfo
diff -u pkgsrc/ham/uhd/distinfo:1.31 pkgsrc/ham/uhd/distinfo:1.32
--- pkgsrc/ham/uhd/distinfo:1.31        Sun Mar 27 17:03:28 2022
+++ pkgsrc/ham/uhd/distinfo     Tue Apr 12 20:10:46 2022
@@ -1,9 +1,14 @@
-$NetBSD: distinfo,v 1.31 2022/03/27 17:03:28 tnn Exp $
+$NetBSD: distinfo,v 1.32 2022/04/12 20:10:46 tnn Exp $
 
 BLAKE2s (uhd-4.1.0.5.tar.gz) = f172a3e30a7e6b81cf79ead0b7a7bb2f34ea55777b94152c2fec267b2f68586a
 SHA512 (uhd-4.1.0.5.tar.gz) = 4929ebc8a12bcc0acfe4a64ceafe17387420e2f056e7bb7284a8d7b60d14aba05484b3c033ce63b00c6d9115f570b056df4e2b36e11a2b25079a8c34b1d084af
 Size (uhd-4.1.0.5.tar.gz) = 37975618 bytes
 SHA1 (patch-CMakeLists.txt) = 16cc883a0bffdb6c3a4733dda7060bd206928d68
+SHA1 (patch-examples_getopt_getopt.c) = f9c7297cb1dcc9438baed9dcdaf0f52b83297e01
+SHA1 (patch-examples_getopt_getopt.h) = 7f01c9385644dbf2b61dfd8bebac8016b46000c5
+SHA1 (patch-lib_rfnoc_vector__iir__block__control.cpp) = d0bc32f888a6cfc30f1eb57d7f2d71bb86cdc284
 SHA1 (patch-lib_transport_nirio_lvbitx_process-lvbitx.py) = 5117c7593c4e92ed6bfb86388cc366c41a1dead7
+SHA1 (patch-lib_usrp_common_lmx2592.cpp) = 2828dcf989f1fc43c70e10b8de1e34485066842d
 SHA1 (patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.cpp) = f94b2a282161474a0a91f333fd2d733ce7d1d4f3
 SHA1 (patch-lib_usrp_mpmd_mpmd__link__if__ctrl__udp.hpp) = 3106d28c4ddc38fd304eb94de5773ff56fed0fd8
+SHA1 (patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp) = 5d9594ce208acd8668589b117dd58d6b1a09de3a

Added files:

Index: pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.c
diff -u /dev/null pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.c:1.1
--- /dev/null   Tue Apr 12 20:10:46 2022
+++ pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.c       Tue Apr 12 20:10:46 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-examples_getopt_getopt.c,v 1.1 2022/04/12 20:10:46 tnn Exp $
+
+don't conflict with system's getopt prototype
+
+--- examples/getopt/getopt.c.orig      2021-12-14 18:37:20.000000000 +0000
++++ examples/getopt/getopt.c
+@@ -23,7 +23,7 @@ int optopt;
+ char *optarg;
+ 
+ int
+-getopt(int argc, char **argv, char *opts)
++getopt(int argc, char *const *argv, const char *opts)
+ {
+     static int sp;
+     int c;
Index: pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.h
diff -u /dev/null pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.h:1.1
--- /dev/null   Tue Apr 12 20:10:46 2022
+++ pkgsrc/ham/uhd/patches/patch-examples_getopt_getopt.h       Tue Apr 12 20:10:46 2022
@@ -0,0 +1,14 @@
+$NetBSD: patch-examples_getopt_getopt.h,v 1.1 2022/04/12 20:10:46 tnn Exp $
+
+don't conflict with system's getopt prototype
+
+--- examples/getopt/getopt.h.orig      2021-12-14 18:37:20.000000000 +0000
++++ examples/getopt/getopt.h
+@@ -14,6 +14,6 @@ extern int   optind;
+ extern int   optopt;
+ extern char* optarg;
+ 
+-int getopt(int argc, char **argv, char *opts);
++int getopt(int argc, char *const *argv, const char *opts);
+ 
+ #endif /* _GETOPT_H_ */
Index: pkgsrc/ham/uhd/patches/patch-lib_rfnoc_vector__iir__block__control.cpp
diff -u /dev/null pkgsrc/ham/uhd/patches/patch-lib_rfnoc_vector__iir__block__control.cpp:1.1
--- /dev/null   Tue Apr 12 20:10:46 2022
+++ pkgsrc/ham/uhd/patches/patch-lib_rfnoc_vector__iir__block__control.cpp      Tue Apr 12 20:10:46 2022
@@ -0,0 +1,24 @@
+$NetBSD: patch-lib_rfnoc_vector__iir__block__control.cpp,v 1.1 2022/04/12 20:10:46 tnn Exp $
+
+Avoid ambiguous call to pow on SunOS.
+
+--- lib/rfnoc/vector_iir_block_control.cpp.orig        2021-12-14 18:37:20.000000000 +0000
++++ lib/rfnoc/vector_iir_block_control.cpp
+@@ -109,7 +109,7 @@ private:
+                     throw uhd::value_error("Alpha value must be in [0.0, 1.0]");
+                 }
+                 _vector_iir_reg_iface.poke32(
+-                    REG_ALPHA_OFFSET, uint32_t(alpha * pow(2, 31)), chan);
++                    REG_ALPHA_OFFSET, uint32_t(alpha * pow((double)2, (double)31)), chan);
+             });
+             register_property(&_prop_beta.back(), [this, chan]() {
+                 double beta = _prop_beta.at(chan).get();
+@@ -117,7 +117,7 @@ private:
+                     throw uhd::value_error("Beta value must be in [0.0, 1.0]");
+                 }
+                 _vector_iir_reg_iface.poke32(
+-                    REG_BETA_OFFSET, uint32_t(beta * pow(2, 31)), chan);
++                    REG_BETA_OFFSET, uint32_t(beta * pow((double)2, (double)31)), chan);
+             });
+             register_property(&_prop_delay.back(), [this, chan, max_delay]() {
+                 int length = _prop_delay.at(chan).get();
Index: pkgsrc/ham/uhd/patches/patch-lib_usrp_common_lmx2592.cpp
diff -u /dev/null pkgsrc/ham/uhd/patches/patch-lib_usrp_common_lmx2592.cpp:1.1
--- /dev/null   Tue Apr 12 20:10:46 2022
+++ pkgsrc/ham/uhd/patches/patch-lib_usrp_common_lmx2592.cpp    Tue Apr 12 20:10:46 2022
@@ -0,0 +1,50 @@
+$NetBSD: patch-lib_usrp_common_lmx2592.cpp,v 1.1 2022/04/12 20:10:46 tnn Exp $
+
+Don't conflict with system's offset_t.
+
+--- lib/usrp/common/lmx2592.cpp.orig   2021-12-14 18:37:20.000000000 +0000
++++ lib/usrp/common/lmx2592.cpp
+@@ -104,10 +104,10 @@ inline bool abs_less_than_compare(const 
+     return std::abs(a) < std::abs(b);
+ }
+ 
+-typedef std::pair<double, intermediate_frequency_t> offset_t;
++typedef std::pair<double, intermediate_frequency_t> lmx2592_offset_t;
+ 
+-// comparator that uses absolute value on the first value of an offset_t
+-inline bool offset_abs_less_than_compare(const offset_t a, const offset_t b)
++// comparator that uses absolute value on the first value of an lmx2592_offset_t
++inline bool offset_abs_less_than_compare(const lmx2592_offset_t a, const lmx2592_offset_t b)
+ {
+     return std::abs(a.first) < std::abs(b.first);
+ }
+@@ -607,7 +607,7 @@ private: // Members
+     // 3. Reference to Fvco spur
+     // 4. Reference to Flo spur
+     // A negative offset indicates the closest spur is at a lower frequency
+-    offset_t _get_min_offset_frequency(const uint16_t N,
++    lmx2592_offset_t _get_min_offset_frequency(const uint16_t N,
+         const uint32_t fnum,
+         const uint32_t fden,
+         const int prescaler,
+@@ -626,16 +626,16 @@ private: // Members
+         // in order to calculate the necessary frequency shift
+ 
+         // Integer Boundary:
+-        const offset_t ib_spur = {_get_closest_spur_offset(frf_in, pfd_freq), FRF_IN};
++        const lmx2592_offset_t ib_spur = {_get_closest_spur_offset(frf_in, pfd_freq), FRF_IN};
+ 
+         // PFD Offset Spur:
+-        const offset_t pfd_offset_spur = {_get_closest_spur_offset(fvco, pfd_freq), FVCO};
++        const lmx2592_offset_t pfd_offset_spur = {_get_closest_spur_offset(fvco, pfd_freq), FVCO};
+ 
+         // Reference to Fvco Spur:
+-        const offset_t fvco_spur = {_get_closest_spur_offset(fvco, fref), FVCO};
++        const lmx2592_offset_t fvco_spur = {_get_closest_spur_offset(fvco, fref), FVCO};
+ 
+         // Reference to F_lo Spur:
+-        const offset_t flo_spur = {_get_closest_spur_offset(flo, fref), FLO};
++        const lmx2592_offset_t flo_spur = {_get_closest_spur_offset(flo, fref), FLO};
+ 
+         // use min with special comparator for minimal absolute value
+         return std::min({ib_spur, pfd_offset_spur, fvco_spur, flo_spur},
Index: pkgsrc/ham/uhd/patches/patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp
diff -u /dev/null pkgsrc/ham/uhd/patches/patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp:1.1
--- /dev/null   Tue Apr 12 20:10:46 2022
+++ pkgsrc/ham/uhd/patches/patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp Tue Apr 12 20:10:46 2022
@@ -0,0 +1,15 @@
+$NetBSD: patch-tests_rfnoc__block__tests_vector__iir__block__test.cpp,v 1.1 2022/04/12 20:10:46 tnn Exp $
+
+Avoid ambiguous call to pow on SunOS.
+
+--- tests/rfnoc_block_tests/vector_iir_block_test.cpp.orig     2021-12-14 18:37:20.000000000 +0000
++++ tests/rfnoc_block_tests/vector_iir_block_test.cpp
+@@ -94,7 +94,7 @@ struct vector_iir_block_fixture
+ 
+     inline uint32_t calculate_alphabeta_register_value(double alphabeta) const
+     {
+-        return uint32_t(alphabeta * pow(2, 31));
++        return uint32_t(alphabeta * pow((double)2, (double)31));
+     }
+ 
+     inline size_t calculate_register_address(size_t offset, size_t channel) const



Home | Main Index | Thread Index | Old Index