Skip to content

Installation fails on Fedora 43 #221

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

Open
bkmgit opened this issue Mar 26, 2025 · 5 comments
Open

Installation fails on Fedora 43 #221

bkmgit opened this issue Mar 26, 2025 · 5 comments

Comments

@bkmgit
Copy link

bkmgit commented Mar 26, 2025

See red-data-tools/red_amber#303 (comment)

@RuhmUndAnsehen
Copy link

RuhmUndAnsehen commented Apr 22, 2025

Fedora 42 (current stable release) is affected as well. I'm getting the same build error as shown in the thread you linked.

$ ruby --version
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-linux]
$ gcc --version
gcc (GCC) 15.0.1 20250329 (Red Hat 15.0.1-0)

@bkmgit
Copy link
Author

bkmgit commented Apr 23, 2025

Ok. Will work on fixing it later this week.

@ankaph
Copy link

ankaph commented Apr 24, 2025

Same error here with Ruby 3.3.7 and GCC 15.0.1 20250329. Any ideas on how to patch it at least temporarily?

@kojix2
Copy link
Contributor

kojix2 commented Apr 25, 2025

These days AI is so good that it can quickly identify the cause of the problem.

Fixed the compilation issue with numo-narray on Fedora 43.

  • Added forward declaration of struct: struct NA_MD_LOOP;
  • Specified function pointer type: void (*loop_func)(ndfunc_t*, struct NA_MD_LOOP*);

Root Cause

  • The struct was self-referencing
  • Function pointer type was imprecise
  • Newer GCC enforces stricter type checking, causing errors

This fix allows numo-narray to compile successfully on Fedora 43 environments.

diff --git a/ext/numo/narray/ndloop.c b/ext/numo/narray/ndloop.c
index 7a3b74c..214f328 100644
--- a/ext/numo/narray/ndloop.c
+++ b/ext/numo/narray/ndloop.c
@@ -38,6 +38,8 @@ typedef struct NA_LOOP_XARGS {
     bool free_user_iter;   // alloc LARG(lp,j).iter=lp->xargs[j].iter
 } na_loop_xargs_t;
 
+struct NA_MD_LOOP;
+
 typedef struct NA_MD_LOOP {
     int  narg;
     int  nin;
@@ -56,7 +58,7 @@ typedef struct NA_MD_LOOP {
     VALUE  reduce;
     VALUE  loop_opt;
     ndfunc_t  *ndfunc;
-    void (*loop_func)();
+    void (*loop_func)(ndfunc_t*, struct NA_MD_LOOP*);
 } na_md_loop_t;
 
 #define LARG(lp,iarg) ((lp)->user.args[iarg])

@ankaph
Copy link

ankaph commented Apr 25, 2025

@kojix2 I can confirm it works. Thanks!

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

No branches or pull requests

4 participants