Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

riscv64 and gcc 13: gf16_shuffle128_rvv.c:(.text+0x22e): undefined reference to `__riscv_vlseg2e8_v_u8m1' #449

Open
sanderjo opened this issue Dec 2, 2024 · 20 comments · Fixed by #478
Assignees
Labels
question Further information is requested

Comments

@sanderjo
Copy link
Contributor

sanderjo commented Dec 2, 2024

NZBGet Version

v24.5-testing

Platform

Linux/Docker

Environment

riscv64 
Bianbu OS

$ uname -a
Linux sander-desktop 6.6.36 #2.0.2.2 SMP PREEMPT Mon Nov 11 13:06:48 UTC 2024 riscv64 riscv64 riscv64 GNU/Linux

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Bianbu
Description:	Bianbu 2.0.2
Release:	2.0.2
Codename:	noble


$ cat /proc/cpuinfo 
processor	: 0
hart		: 0
model name	: Spacemit(R) X60
isa		: rv64imafdcv_zicbom_zicboz_zicntr_zicond_zicsr_zifencei_zihintpause_zihpm_zfh_zfhmin_zca_zcd_zba_zbb_zbc_zbs_zkt_zve32f_zve32x_zve64d_zve64f_zve64x_zvfh_zvfhmin_zvkt_sscofpmf_sstc_svinval_svnapot_svpbmt
mmu		: sv39
mvendorid	: 0x710
marchid		: 0x8000000058000001
mimpid		: 0x1000000049772200

Problem or Question

gcc (Ubuntu 13.2.0-23ubuntu4bb2) 13.2.0
mkdir build
cd build/
cmake ..
cmake --build . -j 2

gives the errors below (in the linking).

Because I see par2-turbo and gf16, I first tried compiling par2cmd-turbo from @animetosho , and that just works.

The procedure via wget https://nzbget.com/download/nzbget-latest-bin-linux.run works and results in a working riscv64 nzbget binary. So

  1. not urgent
  2. probably a (link?) parameter setting, and possibly a PEBKAC
[ 94%] Building CXX object CMakeFiles/nzbget.dir/daemon/util/Benchmark.cpp.o
[ 95%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/SystemInfo.cpp.o
[ 96%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/OS.cpp.o
[ 97%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/CPU.cpp.o
[ 98%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/Network.cpp.o
[100%] Linking CXX executable nzbget
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_mul_128_rvv':
gf16_shuffle128_rvv.c:(.text+0x22e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x334): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_muladd_128_rvv':
gf16_shuffle128_rvv.c:(.text+0x5e8): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x60e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x722): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_muladd_multi_128_rvv':
gf16_shuffle128_rvv.c:(.text+0xe7c): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0xea0): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0xfa6): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x10bc): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x11cc): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x16ce): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x16e0): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x17e4): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x190c): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x1bae): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x1bc0): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x1cd6): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_muladd_multi_stridepf_128_rvv':
gf16_shuffle128_rvv.c:(.text+0x232e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2340): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2454): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x256a): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x268a): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2d20): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2d32): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2e46): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x2f5c): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x306c): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3532): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3544): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3648): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3770): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3bc6): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3bd8): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3cea): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x3e12): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x406a): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x407c): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x41a2): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x43d0): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x43e2): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x4508): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_muladd_multi_packed_128_rvv':
gf16_shuffle128_rvv.c:(.text+0x4bc8): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x4bda): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x4ce6): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x4dee): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x4f1e): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x5436): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x5460): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x5566): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x567e): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x58d2): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x58fc): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x5a20): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: par2-turbo/src/par2-turbo-build/libgf16.a(gf16_shuffle128_rvv.c.o): in function `gf16_shuffle_muladd_multi_packpf_128_rvv':
gf16_shuffle128_rvv.c:(.text+0x609a): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x60ac): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x61b6): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x62be): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x63ec): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x6a1c): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x6a2e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x6b38): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x6c40): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x6d70): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x7224): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x724e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x7354): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x746c): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x78fa): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x7924): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x7a2a): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x7b42): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8168): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x817a): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8284): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x838c): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x84bc): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8770): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x87a8): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x88bc): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8b0e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8b46): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8c5a): undefined reference to `__riscv_vsseg2e8_v_u8m1'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/nzbget.dir/build.make:1658: nzbget] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/nzbget.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
sander@sander-desktop:~/git/nzbget/build$ 

Steps To Reproduce

see above

Logs

No response

Extra information

No response

@sanderjo sanderjo added the question Further information is requested label Dec 2, 2024
@sanderjo
Copy link
Contributor Author

sanderjo commented Dec 2, 2024

Without any knowledge:

sander@sander-desktop:~/git/nzbget$ grep -irn vlseg2e8_v_u8m1  *
grep: build/par2-turbo/src/par2-turbo-build/CMakeFiles/gf16.dir/parpar/gf16/gf16_shuffle128_rvv.c.o: binary file matches
grep: build/par2-turbo/src/par2-turbo-build/libgf16.a: binary file matches
build/par2-turbo/src/par2-turbo/parpar/gf16/gf16_shuffle128_rvv.c:15:	vuint8m1x2_t d = RV(vlseg2e8_v_u8m1x2)(src, vl);
build/par2-turbo/src/par2-turbo/parpar/gf16/gf16_shuffle128_rvv.c:27:#  define _vlseg2e8 RV(vlseg2e8_v_u8m1)

The same grep in par2cmdline-turbo: same result for sources, but not in the binary files

sander@sander-desktop:~/git/par2cmdline-turbo$ grep -irn vlseg2e8_v_u8m1  *
parpar/gf16/gf16_shuffle128_rvv.c:15:	vuint8m1x2_t d = RV(vlseg2e8_v_u8m1x2)(src, vl);
parpar/gf16/gf16_shuffle128_rvv.c:27:#  define _vlseg2e8 RV(vlseg2e8_v_u8m1)



@dnzbk dnzbk self-assigned this Dec 3, 2024
@animetosho
Copy link

Do you know what compiler/version are you using?

For the builds that succeed, I assume they're done outside of the Docker container, and using a different compiler/version?

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 4, 2024

We’re cross-compiling for the RISC-V arch using a GCC 9.x toolchain built with Buildroot and the musl libc.
Besides, for gf16 and hasher, I based the CMake configuration files on the configs from the ParPar repository, so there can be some differences too.

@sanderjo
BTW, what RISC-V board are you using? I’m looking to buy a RISC-V board for testing and debugging.

@animetosho
Copy link

Actually, I think I found out what the issue is. sanderjo is probably using GCC 13, which lacks support for segmented loads/stores (hence the errors). I disabled RVV in GCC13 because of this, but I haven't made a release version with this change.

@sanderjo
Copy link
Contributor Author

sanderjo commented Dec 4, 2024

BTW, what RISC-V board are you using? I’m looking to buy a RISC-V board for testing and debugging.

Banana Pi BPI-F3. See https://docs.banana-pi.org/en/BPI-F3/BananaPi_BPI-F3

Quite nice: RVV1.0, nice performance (it even runs a GUI quite nicely), documentation, maintained OS (Bianbu OS, based on ubuntu)

@sanderjo
Copy link
Contributor Author

sanderjo commented Dec 4, 2024

Actually, I think I found out what the issue is. sanderjo is probably using GCC 13

Yes, sorry for not mentioning, gcc 13: gcc (Ubuntu 13.2.0-23ubuntu4bb2) 13.2.0

I do have gcc-14 on this system too, but I'm a bit scared of all the "sudo update-alternatives" command needed to switch to gcc-14.

I can start a docker with ubuntu 24.10 and gcc 14, to see if that compiles.

which lacks support for segmented loads/stores (hence the errors). I disabled RVV in GCC13 because of this, but I haven't made a release version with this change.

So if/when you release that, and nzbget picks it up, nzbget should compile on my RISCV64 with gcc 13?

@sanderjo
Copy link
Contributor Author

sanderjo commented Dec 4, 2024

Confirmed: builds nicely with gcc 14 (on Ubuntu 24.10, in docker). So indeed a gcc13 problem.

root@10052bfdba31:/nzbget/build# gcc --version
gcc (Ubuntu 14.2.0-4ubuntu2) 14.2.0
[ 97%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/CPU.cpp.o
[ 98%] Building CXX object CMakeFiles/nzbget.dir/daemon/system/Network.cpp.o
[100%] Linking CXX executable nzbget
[100%] Built target nzbget
root@10052bfdba31:/nzbget/build# 
root@10052bfdba31:/nzbget/build# ./nzbget --version
nzbget version: 24.5
root@10052bfdba31:/nzbget/build# file nzbget
nzbget: ELF 64-bit LSB pie executable, UCB RISC-V, RVC, double-float ABI, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=cfc96edcc696f8b1fdacee845d5a7285bb410373, for GNU/Linux 4.15.0, stripped

@animetosho
Copy link

Thanks for testing!

So if/when you release that, and nzbget picks it up, nzbget should compile on my RISCV64 with gcc 13?

Yes, just with RVV disabled.

@animetosho
Copy link

par2cmdline-turbo v1.2.0 has been released with the compile fixes. This issue should be resolved when this fork pulls across the changes.

@sanderjo sanderjo changed the title riscv64: gf16_shuffle128_rvv.c:(.text+0x22e): undefined reference to `__riscv_vlseg2e8_v_u8m1' riscv64 and gcc 13: gf16_shuffle128_rvv.c:(.text+0x22e): undefined reference to `__riscv_vlseg2e8_v_u8m1' Dec 21, 2024
@dnzbk dnzbk linked a pull request Dec 24, 2024 that will close this issue
@sanderjo
Copy link
Contributor Author

sanderjo commented Dec 24, 2024

I did a fresh git clone in a fresh dir, configure & build cyclus, but get the same error.

PEBKAC, or something not yet correct in nzbget?

/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8770): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x87a8): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x88bc): undefined reference to `__riscv_vsseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8b0e): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8b46): undefined reference to `__riscv_vlseg2e8_v_u8m1'
/usr/bin/ld: gf16_shuffle128_rvv.c:(.text+0x8c5a): undefined reference to `__riscv_vsseg2e8_v_u8m1'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/nzbget.dir/build.make:1694: nzbget] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/nzbget.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
cmake --build . -j4  2553.93s user 164.20s system 333% cpu 13:33.91 total
➜  build git:(develop)
➜  build git:(develop) git log | head -20
commit f41fc9f52a7118564d3dedbd6d933f28163851ce
Author: Denis <[email protected]>
Date:   Tue Dec 24 12:40:08 2024 +0300

    Upgrade par2-turbo to v1.2.0 (#478)

    - upgraded par2-turbo to v1.2.0

commit 82c960298193e3a3b7a1bfd72cf839961aecaec7
Author: Denis <[email protected]>
Date:   Mon Dec 23 12:34:34 2024 +0300

    Update POSIX doc and corrected FreeBSD installation supported versions warning (#476)

commit e5cbe71acc75e8ce0b7bb1ff264e5c826e218bc5
Author: Denis <[email protected]>
Date:   Mon Dec 23 09:55:15 2024 +0300

    Fix: segmentation fault with HealthCheck=None and forced repair (#475)

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 24, 2024

@sanderjo
Got it, thanks. I’ll take a look to see if I missed something when synchronizing with the upstream.

@dnzbk dnzbk reopened this Dec 24, 2024
@animetosho
Copy link

This part wasn't updated. The version check was updated to GCC14 in v1.2.0.

I haven't checked any other changes, but files being moved around might make auto-merging somewhat more painful.

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 24, 2024

@animetosho @sanderjo
Sorry, guys, I’m mixing you and myself up. You’re right. I'll fix that.

@sanderjo
Copy link
Contributor Author

In that fresh nzbget dir

➜  nzbget git:(develop) git pull 
Already up to date.

➜  nzbget git:(develop) find . -name platform.h    
./build/par2-turbo/src/par2-turbo/include/par2/osinfo/platform.h

Let's look:

➜  nzbget git:(develop) cat ./build/par2-turbo/src/par2-turbo/include/par2/osinfo/platform.h | grep -ni __riscv_vector
253:#if defined(__riscv_vector) && defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(13,0,0)
255:# undef __riscv_vector

... "13,0,0" ? Your link https://github.com/animetosho/par2cmdline-turbo/blob/fc3b1bb8457accdda5375d6465e2463cb74e407b/parpar/src/platform.h#L253 says "14,0,0" ... so not good?

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 24, 2024

@sanderjo Thank you.
Yes, not good. It's supposed to be this:

#if defined(__riscv_vector) && defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(14,0,0)
// GCC added RVV intrinsics in GCC13, but GCC13 lacks segmented loads/stores
# undef __riscv_vector
#endif

@sanderjo
Copy link
Contributor Author

I'm now trying this:

Brute force:

➜  nzbget git:(develop) sed -i -e 's/13,0,0/14,0,0/' ./build/par2-turbo/src/par2-turbo/include/par2/osinfo/platform.h


➜  nzbget git:(develop) cat  ./build/par2-turbo/src/par2-turbo/include/par2/osinfo/platform.h | grep riscv
#if defined(__riscv_vector) && defined(HEDLEY_GCC_VERSION) && !HEDLEY_GCC_VERSION_CHECK(14,0,0)
# undef __riscv_vector

... compiling:

[ 98%] Building CXX object CMakeFiles/par2-turbo.dir/src/verificationpacket.cpp.o
[ 99%] Building CXX object CMakeFiles/par2-turbo.dir/src/utf8.cpp.o
[100%] Linking CXX static library libpar2-turbo.a
[100%] Built target par2-turbo
[  4%] No install step for 'par2-turbo'
[  5%] Completed 'par2-turbo'
[  7%] Built target par2-turbo
[  9%] Built target regex
[ 18%] Built target yencode
[ 20%] Building CXX object CMakeFiles/nzbget.dir/daemon/postprocess/ParChecker.cpp.o
[ 20%] Building CXX object CMakeFiles/nzbget.dir/daemon/postprocess/ParRenamer.cpp.o
[ 21%] Building CXX object CMakeFiles/nzbget.dir/daemon/postprocess/PrePostProcessor.cpp.o
[ 21%] Building CXX object CMakeFiles/nzbget.dir/daemon/postprocess/Repair.cpp.o
[ 22%] Building CXX object CMakeFiles/nzbget.dir/daemon/queue/DirectRenamer.cpp.o
[ 23%] Linking CXX executable nzbget
[100%] Built target nzbget
cmake --build . -j 4  487.32s user 33.58s system 286% cpu 3:01.72 total
➜  build git:(develop) 
➜  build git:(develop) 
➜  build git:(develop) ll nzbget         
-rwxrwxr-x 1 sander sander 1.9M Dec 24 13:37 nzbget
➜  build git:(develop) ./nzbget --version                                               
nzbget version: 24.6
➜  build git:(develop) 

Works!

So now the question: why there's still "13,0,0" on my system, even a fresh git clone etc?

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 24, 2024

Oh, that’s a simple question: I failed to properly merge the latest changes from the original repository.
I should get a little rest...

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 24, 2024

@sanderjo
Sorry to bother you so much, but could you try building that again?
You need to change GIT_TAG v1.2.0-nzbget to GIT_TAG nzbget in cmake/par2-turbo.cmake to get the latest changes.

@sanderjo
Copy link
Contributor Author

Sorry to bother you so much, but could you try building that again?
You need to change GIT_TAG v1.2.0-nzbget to GIT_TAG nzbget in cmake/par2-turbo.cmake to get the latest changes.

Yes, works! Thank you.

I did a fresh git clone (just to be sure), and

sed -i -e 's/v1.2.0-nzbget/nzbget/' ../cmake/par2-turbo.cmake

cat ../cmake/par2-turbo.cmake| grep -i GIT_TAG                                    
	GIT_TAG			nzbget

and the cmake --build . -j 4 completes succesfully.

nzbget: ELF 64-bit LSB pie executable, UCB RISC-V, RVC, double-float ABI, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-riscv64-lp64d.so.1, BuildID[sha1]=f2981c1ffd2443bad7b4cf988481be04fd144776, for GNU/Linux 4.15.0, stripped

So: use this workaround when compiling? Or will this get into your 'release'?

@dnzbk
Copy link
Collaborator

dnzbk commented Dec 29, 2024

Thanks for testing.
I’ll definitely include these changes in a future release, but I might delay it a bit since this issue isn’t critical. I'll probably wait for new release of par2cmdline-turbo with a fix of a build on OpenBSD and potentially some other cool features implemented by @animetosho. Will see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants