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)
Committed, thanks!
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(-)
Please have a look at https://reviews.freebsd.org/D30700 which should fix a bunch of issues
(In reply to Daniel Engberg from comment #3) Thanks Daniel. I'll commit the remaining changes from D30700 shortly.
(In reply to Daniel Engberg from comment #3) Thanks Daniel, for the hint. And sorry, vishwin, that I overlooked the review :(
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
(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.
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.
(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.
You can probably just remove all additions to plist. This should likely work.
also see https://reviews.freebsd.org/D30700
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).
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.
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
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.
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.
Created attachment 233021 [details] Update 2.5.0 -> 2.5.1 with cpu_features enabled
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.
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(-)
Thanks for the patch, Ganael.
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(-)