Compare commits
5 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 5e91252ab1 | |||
| 3f651b7920 | |||
| 4f4fc2f135 | |||
| 2d478ecf73 | |||
| 13ad6e5899 |
72
fix-chromosome-32bit.patch
Normal file
72
fix-chromosome-32bit.patch
Normal file
@@ -0,0 +1,72 @@
|
||||
Description: Fix chromosomes for sizeof (unsigned long) == 32
|
||||
In the chromosome struct, the maximum value of a trait is stored in an
|
||||
unsigned long (which is 32 bits on a typical 32 bit architecture) and up to 32
|
||||
bits per trait are allowed. When the full 32 bits per trait were used, the
|
||||
value stored in max_value is 1 << 32 which is truncated to zero on 32 bit
|
||||
architectures. This causes the limit check in chromosome_init() to always
|
||||
fail.
|
||||
.
|
||||
While it would be sufficient to change the comparison from v >= max_value to
|
||||
v > (max_value - 1), change the setting of max_value to "(1<<bits)-1". This
|
||||
has the advantage of being the actual maximum value and therefore more
|
||||
appropriate for the name.
|
||||
Author: Andreas Bombe <aeb@debian.org>
|
||||
Last-Update: 2023-10-18
|
||||
---
|
||||
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
|
||||
--- a/src/optim/src/chromosome.c
|
||||
+++ b/src/optim/src/chromosome.c
|
||||
@@ -62,7 +62,7 @@
|
||||
for (i=0; i<q->num_traits; i++) {
|
||||
q->bits_per_trait[i] = _bits_per_trait[i];
|
||||
|
||||
- q->max_value[i] = 1LU << q->bits_per_trait[i];
|
||||
+ q->max_value[i] = (1ULL << q->bits_per_trait[i]) - 1;
|
||||
q->traits[i] = 0LU;
|
||||
|
||||
q->num_bits += q->bits_per_trait[i];
|
||||
@@ -80,7 +80,7 @@
|
||||
// validate input
|
||||
if (_num_traits == 0)
|
||||
return liquid_error_config("chromosome_create_basic(), must have at least one trait");
|
||||
- if (_bits_per_trait == 0 || _bits_per_trait > 64)
|
||||
+ if (_bits_per_trait == 0 || _bits_per_trait > LIQUID_CHROMOSOME_MAX_SIZE)
|
||||
return liquid_error_config("chromosome_create_basic(), bits per trait out of range");
|
||||
|
||||
unsigned int * bpt = (unsigned int *) malloc(_num_traits*sizeof(unsigned int));
|
||||
@@ -179,7 +179,7 @@
|
||||
unsigned int i;
|
||||
for (i=0; i<_c->num_traits; i++) {
|
||||
//printf("===> [%3u] bits:%3u, max:%12lu, value:%12lu\n", i, _c->bits_per_trait[i], _c->max_value[i], _v[i]);
|
||||
- if (_v[i] >= _c->max_value[i])
|
||||
+ if (_v[i] > _c->max_value[i])
|
||||
return liquid_error(LIQUID_EIRANGE,"chromosome_init(), value exceeds maximum");
|
||||
|
||||
_c->traits[i] = _v[i];
|
||||
@@ -197,7 +197,7 @@
|
||||
return liquid_error(LIQUID_EIRANGE,"chromosome_initf(), value must be in [0,1]");
|
||||
|
||||
// quantize sample
|
||||
- unsigned long N = 1LU << _c->bits_per_trait[i];
|
||||
+ unsigned long N = (1ULL << _c->bits_per_trait[i]) - 1;
|
||||
_c->traits[i] = (unsigned long) floorf( _v[i] * N );
|
||||
//printf("===> [%3u] quantizing %8.2f, bits:%3u, N:%12lu, trait:%12lu/%12lu => %12.8f\n",
|
||||
// i, _v[i], _c->bits_per_trait[i], N, _c->traits[i], _c->max_value[i], chromosome_valuef(_c,i));
|
||||
@@ -295,7 +295,7 @@
|
||||
{
|
||||
unsigned int i;
|
||||
for (i=0; i<_q->num_traits; i++)
|
||||
- _q->traits[i] = rand() & (_q->max_value[i]-1LU);
|
||||
+ _q->traits[i] = rand() & _q->max_value[i];
|
||||
return LIQUID_OK;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@
|
||||
liquid_error(LIQUID_EIRANGE,"chromosome_valuef(), trait index exceeded");
|
||||
return 0.0f;
|
||||
}
|
||||
- return (float) (_q->traits[_index]) / (float)(_q->max_value[_index]-1LU);
|
||||
+ return (float) (_q->traits[_index]) / (float)_q->max_value[_index];
|
||||
}
|
||||
|
||||
unsigned int chromosome_value(chromosome _q,
|
||||
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6ee6a5dfb48e047b118cf613c0b9f43e34356a5667a77a72a55371d2c8c53bf5
|
||||
size 1243435
|
||||
3
liquid-dsp-1.7.0.tar.gz
Normal file
3
liquid-dsp-1.7.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:33c42ebc2e6088570421e282c6332e899705d42b4f73ebd1212e6a11da714dd4
|
||||
size 1281395
|
||||
@@ -1,3 +1,32 @@
|
||||
-------------------------------------------------------------------
|
||||
Sun Feb 23 13:42:21 UTC 2025 - Andreas Stieger <andreas.stieger@gmx.de>
|
||||
|
||||
- switch to cmake and remove spec constructs no longer needed
|
||||
- do not build examples, run tests, disable SIMD fixing aarch64
|
||||
- add fix-chromosome-32bit.patch for armv7l builds
|
||||
- The devel package is now liquid-dsp-devel
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 7 13:18:10 UTC 2025 - Martin Hauke <mardnh@gmx.de>
|
||||
|
||||
- Update to version 1.7.0
|
||||
framing
|
||||
* added more description to method definitions such as
|
||||
qpacketmodem and qdetector.
|
||||
* dsssframe64: extended functionality to use qdsync, added
|
||||
standard methods such as copy(), added interfaces for
|
||||
specifying thresholds, reduced default spreading gain.
|
||||
filter
|
||||
* firinterp: added flush() method to run zeros through filter.
|
||||
* rresamp: allow for default bandwidth with an input of -1.
|
||||
nco
|
||||
* fixed issue where frequency was being set improperly, added
|
||||
more extensive testing.
|
||||
* improved the NCO object with VCO precision.
|
||||
random
|
||||
* added more extensive testing for various distributions to
|
||||
ensure values are generated properly.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Aug 29 08:25:28 UTC 2023 - Bernhard Wiedemann <bwiedemann@suse.com>
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
#
|
||||
# spec file for package liquid-dsp
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2017, Martin Hauke <mardnh@gmx.de>
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
# Copyright (c) 2017-2025, Martin Hauke <mardnh@gmx.de>
|
||||
# Copyright (c) 2025 Andreas Stieger <Andreas.Stieger@gmx.de>
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -17,11 +18,10 @@
|
||||
#
|
||||
|
||||
|
||||
%define use_build_checks 0
|
||||
%define libname libliquid
|
||||
|
||||
%define sover 1
|
||||
%define libname libliquid%{sover}
|
||||
Name: liquid-dsp
|
||||
Version: 1.6.0
|
||||
Version: 1.7.0
|
||||
Release: 0
|
||||
Summary: Digital signal processing library for software-defined radios
|
||||
License: MIT
|
||||
@@ -29,14 +29,9 @@ Group: Development/Libraries/C and C++
|
||||
URL: https://liquidsdr.org
|
||||
#Git-Clone: https://github.com/jgaeddert/liquid-dsp.git
|
||||
Source: https://github.com/jgaeddert/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libtool
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: pkgconfig(fftw3)
|
||||
%ifarch x86_64 aarch64
|
||||
BuildRequires: pkgconfig(libfec)
|
||||
%endif
|
||||
Patch0: fix-chromosome-32bit.patch
|
||||
BuildRequires: c++_compiler
|
||||
BuildRequires: cmake >= 3.10
|
||||
|
||||
%description
|
||||
liquid-dsp is a signal processing library for software-defined
|
||||
@@ -46,18 +41,22 @@ that do no rely on external dependencies or cumbersome frameworks.
|
||||
%package -n %{libname}
|
||||
Summary: Digital signal processing library for software-defined radios
|
||||
Group: Development/Libraries/C and C++
|
||||
Obsoletes: libliquid < %{version}
|
||||
Provides: libliquid = %{version}
|
||||
|
||||
%description -n %{libname}
|
||||
liquid-dsp is a signal processing library for software-defined
|
||||
radios written in C. Its purpose is to provide a set of extensible DSP modules
|
||||
that do no rely on external dependencies or cumbersome frameworks.
|
||||
|
||||
%package -n %{libname}-devel
|
||||
%package devel
|
||||
Summary: Development files for the liquid-dsp library
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: libliquid = %{version}
|
||||
Requires: %{libname} = %{version}
|
||||
Obsoletes: libliquid-devel < %{version}
|
||||
Provides: libliquid-devel = %{version}
|
||||
|
||||
%description -n %{libname}-devel
|
||||
%description devel
|
||||
liquid-dsp is a signal processing library for software-defined
|
||||
radios written in C. Its purpose is to provide a set of extensible DSP modules
|
||||
that do no rely on external dependencies or cumbersome frameworks.
|
||||
@@ -66,37 +65,32 @@ This subpackage contains libraries and header files for developing
|
||||
applications that want to make use of libliquid.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
rm scripts/ax_ext.m4 # avoid CPU-detection on build machine (boo#1100677)
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
./bootstrap.sh
|
||||
%configure -disable-static
|
||||
%make_build
|
||||
%cmake \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DENABLE_SIMD=OFF \
|
||||
%{nil}
|
||||
%cmake_build
|
||||
|
||||
%install
|
||||
%make_install
|
||||
rm -f %{buildroot}/%{_libdir}/libliquid.a*
|
||||
|
||||
# fix library executable flag
|
||||
chmod a+x %{buildroot}/%{_libdir}/libliquid.so.1.6
|
||||
|
||||
%post -n %{libname} -p /sbin/ldconfig
|
||||
%postun -n %{libname} -p /sbin/ldconfig
|
||||
%cmake_install
|
||||
|
||||
%check
|
||||
%if 0%{?use_build_checks}
|
||||
make %{?_smp_mflags} check
|
||||
%endif
|
||||
%ctest
|
||||
|
||||
%ldconfig_scriptlets -n %{libname}
|
||||
|
||||
%files -n %{libname}
|
||||
%license LICENSE
|
||||
%doc HISTORY README.md TROUBLESHOOTING
|
||||
%{_libdir}/%{libname}.so.*
|
||||
%doc CHANGELOG.md README.rst
|
||||
%{_libdir}/libliquid.so.%{sover}
|
||||
%{_libdir}/libliquid.so.%{sover}.*
|
||||
|
||||
%files -n %{libname}-devel
|
||||
%dir %{_includedir}/liquid
|
||||
%{_includedir}/liquid/liquid.h
|
||||
%{_libdir}/%{libname}.so
|
||||
%files devel
|
||||
%license LICENSE
|
||||
%{_includedir}/liquid
|
||||
%{_libdir}/libliquid.so
|
||||
|
||||
%changelog
|
||||
|
||||
Reference in New Issue
Block a user