numo-narray icon indicating copy to clipboard operation
numo-narray copied to clipboard

Installation fails on Fedora 43

Open bkmgit opened this issue 9 months ago • 6 comments

See https://github.com/red-data-tools/red_amber/pull/303#issuecomment-2751301962

bkmgit avatar Mar 26 '25 14:03 bkmgit

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)

RuhmUndAnsehen avatar Apr 22 '25 20:04 RuhmUndAnsehen

Ok. Will work on fixing it later this week.

bkmgit avatar Apr 23 '25 04:04 bkmgit

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

ankaph avatar Apr 24 '25 14:04 ankaph

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])

kojix2 avatar Apr 25 '25 01:04 kojix2

@kojix2 I can confirm it works. Thanks!

ankaph avatar Apr 25 '25 05:04 ankaph

Can anymore release this, Please?

madhums avatar May 23 '25 10:05 madhums