Bug 261245 - devel/volk: Update to 2.5.0
Summary: devel/volk: Update to 2.5.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL: https://github.com/gnuradio/volk/rele...
Keywords:
Depends on: 261252
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-16 12:17 UTC by Rainer Hurling
Modified: 2022-04-07 20:22 UTC (History)
6 users (show)

See Also:
bugzilla: maintainer-feedback? (hamradio)


Attachments
patch to update from 2.2.1 to 2.5.0, and fix python shebang (3.71 KB, patch)
2022-01-16 12:17 UTC, Rainer Hurling
no flags Details | Diff
Update 2.5.0 -> 2.5.1 with cpu_features enabled (3.28 KB, patch)
2022-04-07 10:28 UTC, Ganael LAPLANCHE
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Hurling freebsd_committer freebsd_triage 2022-01-16 12:17:12 UTC
Created attachment 231039 [details]
patch to update from 2.2.1 to 2.5.0, and fix python shebang

This patch should update the port vom 2.2.1 to 2.5.0. This brings several enhancements, new features and bug fixes, see https://github.com/gnuradio/volk/releases. Although comms/gnuradio builds and installs without problems with devel/volk v2.5.0, I did not check for correct functionality in gnuradio!



The internal cpu_features are not included in the tarball, external cpu_features (i.e. devel/cpu_features) are not found by CMakeLists.txt (due to missing functionality). Therefore CMAKE_OFF=VOLK_CPU_FEATURES is set as a workaround.



While testing the patch with DEVELOPER=yes in /etc/make.conf, the staging aborted with the following error:

====> Running Q/A tests (stage-qa).
Error: '/usr/local/bin/python3' is an invalid shebang you need USES=shebangfix for 'bin/volk_modtool'
*** Error code 1

It it turned out that the shebang for bin/volk_modtool was not created correctly. I found no other way than to delete the line in question in the file before configuration and then patch it again before installation.

Translated with www.DeepL.com/Translator (free version)
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 16:31:53 UTC
Committed, thanks!
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-01-16 16:32:14 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bb2c5fd3048a5e5a762466a3e22deba661fe1a08

commit bb2c5fd3048a5e5a762466a3e22deba661fe1a08
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2022-01-16 16:17:12 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-01-16 16:31:51 +0000

    devel/volk: Update 2.2.1 -> 2.5.0

    PR:             261245

 devel/volk/Makefile  | 19 +++++++++++++++++--
 devel/volk/distinfo  |  6 +++---
 devel/volk/pkg-plist |  7 ++++++-
 3 files changed, 26 insertions(+), 6 deletions(-)
Comment 3 Daniel Engberg freebsd_committer freebsd_triage 2022-01-16 16:37:56 UTC
Please have a look at https://reviews.freebsd.org/D30700 which should fix a bunch of issues
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 16:58:53 UTC
(In reply to Daniel Engberg from comment #3)

Thanks Daniel.

I'll commit the remaining changes from D30700 shortly.
Comment 5 Rainer Hurling freebsd_committer freebsd_triage 2022-01-16 17:46:22 UTC
(In reply to Daniel Engberg from comment #3)
Thanks Daniel, for the hint. And sorry, vishwin, that I overlooked the review :(
Comment 6 Charlie Li freebsd_committer freebsd_triage 2022-01-16 18:58:34 UTC
For the record, I did not commit this precisely because this was only tested with comms/gnuradio 3.9, not 3.8. Please check for correct functionality before thinking about committing.

Also, cpu_features is *required* functionality despite being a disable-able option; this just possibly broke some stuff within GNU Radio. cpu_features explicitly says to embed it into existing projects [0], not as a separate library.

Neither commit was even done correctly, as the PATCHFILES and post-extract exist specifically to replace the bundled cpu_features with an updated snapshot volk upstream uses. The released versions of cpu_features build but do not run on FreeBSD, as even their own tests crash or otherwise do not work.

Reopening because this was not done properly. Please consider why things are done the way they are in spite of what the Porter's Handbook says.

[0] https://github.com/google/cpu_features/blob/master/cmake/README.md
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 19:37:05 UTC
(In reply to Charlie Li from comment #6)

Hmmm ... 

I am not sure I agree that commits are wrong.
Your patch also keeps VOLK_CPU_FEATURES disabled (it has CMAKE_OFF=VOLK_CPU_FEATURES).

The current version of devel/volk is functionally identical to the patch in D30700 because I picked all bits of the patch.

cpu_features detection is broken in the upstream project - they have the patch to fix it now.

> cpu_features explicitly says to embed it into existing projects [0], not as a separate library.

It certainly wasn't embedded properly because static library and headers were installed such that they were conflicting with other packages.
Comment 8 Charlie Li freebsd_committer freebsd_triage 2022-01-16 19:43:50 UTC
The original patch had cpu_features disabled, but the updated patch re-enables it (after including the updated submodule pointers). Thus they are not functionally identical, and in fact volk does not even work without cpu_features. Yet another reason why I never committed after this much time.
Comment 9 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 19:55:25 UTC
(In reply to Charlie Li from comment #8)

No, cpu_features bundling is clearly wrong.
(1) it isn't done correctly - it installs all cpu_features files causing conflicts
(2) external cpu_features package should be used instead of bundling.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 19:57:36 UTC
You can probably just remove all additions to plist.

This should likely work.
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2022-01-16 19:58:47 UTC
also see https://reviews.freebsd.org/D30700
Comment 12 Charlie Li freebsd_committer freebsd_triage 2022-01-16 19:59:13 UTC
The bad bundling is an upstream problem, both on GNU Radio and google/cpu_features. In the meantime, we may be able to just remove the conflicting files, as it appears that cpu_features is just statically-linked. We will have to figure out a way to ensure tests and runtime continue to work as intended though.

While ideally we should dynamically link using the existing port, again, all currently released versions of cpu_features do not work on FreeBSD, and cpu_features themselves are not exactly friendly to dynamic linking (without downstream patching).
Comment 13 Ganael LAPLANCHE freebsd_committer freebsd_triage 2022-04-06 14:13:03 UTC
Hello,

Just for your information, I am having problems with that update and latest comms/gqrx (2.15.8). It crashes when hitting the "play" button with the following backtrace :

Core was generated by `gqrx'.
Program terminated with signal SIGILL, Illegal instruction.
--Type <RET> for more, q to quit, c to continue without paging--
Privileged opcode.
#0  0x00000008036b7620 in ?? () from /usr/local/lib/libvolk.so.2.5
[Current thread is 1 (LWP 119178)]
(gdb) bt
#0  0x00000008036b7620 in ?? () from /usr/local/lib/libvolk.so.2.5
#1  0x0000000802418ed3 in gr::filter::kernel::fir_filter<float, float, float>::filterN(float*, float const*, unsigned long) () from /usr/local/lib/libgnuradio-filter.so.3.8.4
#2  0x000000080242109e in gr::filter::fir_filter_blk_impl<float, float, float>::work(int, std::__1::vector<void const*, std::__1::allocator<void const*> >&, std::__1::vector<void*, std::__1::allocator<void*> >&) ()
   from /usr/local/lib/libgnuradio-filter.so.3.8.4

If I revert back to Volk 2.2.1... gqrx works again.
Comment 14 Darren Mulligan 2022-04-06 15:03:35 UTC
I have had a similar experience - most things in gnuradio crash:

>>> Done (return code -4)
pid 78870 (python3.8), jid 0, uid 1000: exited on signal 4

I can't even run volk_profile:

> volk_profile
RUN_VOLK_TESTS: volk_64u_popcntpuppet_64u(131071,1987)
Illegal instruction
pid 78875 (volk_profile), jid 0, uid 1000: exited on signal 4
Comment 15 Charlie Li freebsd_committer freebsd_triage 2022-04-07 06:25:38 UTC
Yeah I haven't been able to run a single GNU Radio flowgraph either, which is why I never wanted to commit this until we could start to figure out where these SIGILLs and SIGBUSes are coming from. Unfortunately 2.5.0 is required to even build GNU Radio 3.9 and above let alone run it.

In the meantime 2.5.1 released back in February; see if anything from https://github.com/gnuradio/volk/compare/v2.5.0...v2.5.1 piques thought.
Comment 16 Ganael LAPLANCHE freebsd_committer freebsd_triage 2022-04-07 10:27:37 UTC
Hello,

Version 2.5.1 is able to detect cpu_features from ports.

The attached patch updates devel/volk to 2.5.1 and allows me to run gqrx smoothly.

Cheers,

Ganael.
Comment 17 Ganael LAPLANCHE freebsd_committer freebsd_triage 2022-04-07 10:28:38 UTC
Created attachment 233021 [details]
Update 2.5.0 -> 2.5.1 with cpu_features enabled
Comment 18 Darren Mulligan 2022-04-07 18:16:01 UTC
The 2.5.1 patch now allows volk_profile to 100% complete:

RUN_VOLK_TESTS: volk_64u_popcntpuppet_64u(131071,1987)
generic completed in 168.651 ms
a_sse4_2 completed in 168.538 ms
Best aligned arch: a_sse4_2
Best unaligned arch: generic
RUN_VOLK_TESTS: volk_16u_byteswappuppet_16u(131071,1987)
generic completed in 34.313 ms
u_sse2 completed in 34.879 ms
a_sse2 completed in 35.08 ms
u_avx2 completed in 34.32 ms
a_avx2 completed in 34.376 ms
Best aligned arch: generic
Best unaligned arch: generic
[hundreds of more lines]

I tested several graphs with gnuradio-3.8.4.0_3 that were dying from illegal instruction before and all are running normally now.
Comment 19 commit-hook freebsd_committer freebsd_triage 2022-04-07 20:19:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=56da6587708830f13e8baec5feef04be80f30f1e

commit 56da6587708830f13e8baec5feef04be80f30f1e
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2022-04-07 20:18:18 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-04-07 20:19:04 +0000

    devel/volk: Update 2.5.0 -> 2.5.1

    PR:             261245

 devel/volk/Makefile  | 16 ++++------------
 devel/volk/distinfo  |  6 +++---
 devel/volk/pkg-plist |  6 +++++-
 3 files changed, 12 insertions(+), 16 deletions(-)
Comment 20 Yuri Victorovich freebsd_committer freebsd_triage 2022-04-07 20:19:32 UTC
Thanks for the patch, Ganael.
Comment 21 commit-hook freebsd_committer freebsd_triage 2022-04-07 20:22:26 UTC
A commit in branch 2022Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bdd72f98e45013fac8396cb6ca195ada2a7e416d

commit bdd72f98e45013fac8396cb6ca195ada2a7e416d
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2022-04-07 20:18:18 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-04-07 20:21:44 +0000

    devel/volk: Update 2.5.0 -> 2.5.1

    PR:             261245
    (cherry picked from commit 56da6587708830f13e8baec5feef04be80f30f1e)

 devel/volk/Makefile  | 16 ++++------------
 devel/volk/distinfo  |  6 +++---
 devel/volk/pkg-plist |  6 +++++-
 3 files changed, 12 insertions(+), 16 deletions(-)