rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

Can't compile Maxima 5.47 with gcl 2.6.12 #630

Open rtoy opened 6 days ago

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:40 Created by catap on 2023-07-31 13:18:12 Original: https://sourceforge.net/p/maxima/bugs/4167


An attempt to build Maxima 5.47 with gcl 2.6.12 had failed because it produced invalid C code.

Error:

./binary-gcl/pregexp.c:4288:7: error: use of undeclared identifier 'fun'
        if(((fun->cc.cc_turbo[1]->c.c_car))==Cnil){
             ^
./binary-gcl/pregexp.c:4290:37: error: use of undeclared identifier 'fun'
        if(!(immnum_ge((base[0]->c.c_car),(fun->cc.cc_turbo[1]->c.c_car)))){
                                           ^
./binary-gcl/pregexp.c:4300:7: error: use of undeclared identifier 'fun'
        if(((fun->cc.cc_turbo[5]->c.c_car))!=Cnil){
             ^
./binary-gcl/pregexp.c:4302:12: error: use of undeclared identifier 'fun'
        base[3]= (fun->cc.cc_turbo[3]->c.c_car);
                  ^
./binary-gcl/pregexp.c:4308:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[10]->c.c_car));
                 ^
./binary-gcl/pregexp.c:4326:12: error: use of undeclared identifier 'fun'
        base[3]= (fun->cc.cc_turbo[3]->c.c_car);
                  ^
./binary-gcl/pregexp.c:4332:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[10]->c.c_car));
                 ^
./binary-gcl/pregexp.c:4450:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[0]->c.c_car));
                 ^
./binary-gcl/pregexp.c:4626:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[0]->c.c_car));
                 ^
./binary-gcl/pregexp.c:4650:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[0]->c.c_car));
                 ^
./binary-gcl/pregexp.c:4976:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[0]->c.c_car));
                 ^
./binary-gcl/pregexp.c:5099:11: error: use of undeclared identifier 'fun'
        funcall((fun->cc.cc_turbo[0]->c.c_car));

Which is obtain from defently invalide code near Q-LOOP:

/*      local function Q-LOOP   */

static void L45(base0,base1)
register object *base0,*base1;
{       register object *base=vs_base;
        register object *sup=base+VM35; VC35
        vs_check;
        base[0]=MMcons(base[0],base1[2]);
        base[1]=MMcons(base[1],base[0]);
        vs_top=sup;
        base[2]= 
        make_cclosure_new(LC71,Cnil,base[1],Cdata);
        base[2]=MMcons(base[2],base[1]);
        if(((fun->cc.cc_turbo[1]->c.c_car))==Cnil){
        goto T1218;}
        if(!(immnum_ge((base[0]->c.c_car),(fun->cc.cc_turbo[1]->c.c_car)))){
        goto T1218;}
        vs_base=vs_top;
        {object _funobj = (base[2]->c.c_car);if(type_of(_funobj)==t_cclosure && (_funobj->cc.cc_turbo))
                   (*(_funobj->cc.cc_self))(_funobj);
               else if (type_of(_funobj)==t_cfun) (*(_funobj->cc.cc_self))();
               else super_funcall_no_event(_funobj);}
        return;
        goto T1218;
T1218:;
        if(((fun->cc.cc_turbo[5]->c.c_car))!=Cnil){
        goto T1223;}
        base[3]= (fun->cc.cc_turbo[3]->c.c_car);
        base[4]= (base[1]->c.c_car);
        base[5]= 
        make_cclosure_new(LC72,Cnil,base[2],Cdata);
        base[6]= (base[2]->c.c_car);
        vs_top=(vs_base=base+3)+4;
        funcall((fun->cc.cc_turbo[10]->c.c_car));
        return;
        goto T1223;
T1223:;{object V274;
        V274= 
        ({object _f=(base[2]->c.c_car);enum type _t=type_of(_f);
        _f = _t==t_symbol && _f->s.s_gfdef!=OBJNULL ? (_t=type_of(_f->s.s_gfdef),_f->s.s_gfdef) : _f;
        _t==t_sfun ? _f->sfn.sfn_self : 
        (fcall.argd= 0,_t==t_vfun ? _f->vfn.vfn_self : 
        (fcall.fun=_f,fcalln));})
        (
        );
        if(V274==Cnil)goto T1229;
        base[3]= V274;
        vs_top=(vs_base=base+3)+1;
        return;
        goto T1229;
T1229:;}
        base[3]= (fun->cc.cc_turbo[3]->c.c_car);
        base[4]= (base[1]->c.c_car);
        base[5]= 
        make_cclosure_new(LC73,Cnil,base[2],Cdata);
        base[6]= (base[2]->c.c_car);
        vs_top=(vs_base=base+3)+4;
        funcall((fun->cc.cc_turbo[10]->c.c_car));
        return;
}

anyway, this file contains near identical pice of code with different name LC45 instead of L45 which hasn't got this issue:

/*      local function Q-LOOP   */

static void LC45(fun)
        object fun;
{       register object *base=vs_base;
        register object *sup=base+VM31; VC31
        vs_check;
        base[0]=MMcons(base[0],fun->cc.cc_turbo[0]);
        base[1]=MMcons(base[1],base[0]);
        vs_top=sup;
        base[2]= 
        make_cclosure_new(LC68,Cnil,base[1],Cdata);
        base[2]=MMcons(base[2],base[1]);
        if(((fun->cc.cc_turbo[4]->c.c_car))==Cnil){
        goto T1186;}
        if(!(immnum_ge((base[0]->c.c_car),(fun->cc.cc_turbo[4]->c.c_car)))){
        goto T1186;}
        vs_base=vs_top;
        {object _funobj = (base[2]->c.c_car);if(type_of(_funobj)==t_cclosure && (_funobj->cc.cc_turbo))
                   (*(_funobj->cc.cc_self))(_funobj);
               else if (type_of(_funobj)==t_cfun) (*(_funobj->cc.cc_self))();
               else super_funcall_no_event(_funobj);}
        return;
        goto T1186;
T1186:;
        if(((fun->cc.cc_turbo[8]->c.c_car))!=Cnil){
        goto T1191;}
        base[3]= (fun->cc.cc_turbo[6]->c.c_car);
        base[4]= (base[1]->c.c_car);
        base[5]= 
        make_cclosure_new(LC69,Cnil,base[2],Cdata);
        base[6]= (base[2]->c.c_car);
        vs_top=(vs_base=base+3)+4;
        funcall((fun->cc.cc_turbo[13]->c.c_car));
        return;
        goto T1191;
T1191:;{object V270;
        V270= 
        ({object _f=(base[2]->c.c_car);enum type _t=type_of(_f);
        _f = _t==t_symbol && _f->s.s_gfdef!=OBJNULL ? (_t=type_of(_f->s.s_gfdef),_f->s.s_gfdef) : _f;
        _t==t_sfun ? _f->sfn.sfn_self : 
        (fcall.argd= 0,_t==t_vfun ? _f->vfn.vfn_self : 
        (fcall.fun=_f,fcalln));})
        (
        );
        if(V270==Cnil)goto T1197;
        base[3]= V270;
        vs_top=(vs_base=base+3)+1;
        return;
        goto T1197;
T1197:;}
        base[3]= (fun->cc.cc_turbo[6]->c.c_car);
        base[4]= (base[1]->c.c_car);
        base[5]= 
        make_cclosure_new(LC70,Cnil,base[2],Cdata);
        base[6]= (base[2]->c.c_car);
        vs_top=(vs_base=base+3)+4;
        funcall((fun->cc.cc_turbo[13]->c.c_car));
        return;
}
rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:41 Created by catap on 2023-07-31 13:19:21 Original: https://sourceforge.net/p/maxima/bugs/4167/#80f8


And I was absolutley wrong, I've used GCL 2.6.12, not CCL64 1.12.1

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:44 Created by rtoy on 2023-07-31 14:40:02 Original: https://sourceforge.net/p/maxima/bugs/4167/#80f8/d4f4


Please update the bug to say gcl.

Gcl was not really super-clear on what version 2.6.12 is, but you need at least gcl compiled with the ansi option. I don't think we really support building with any version of gcl older than the current 2.6.14. That builds maxima fine for me.

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:48 Created by catap on 2023-07-31 18:33:27 Original: https://sourceforge.net/p/maxima/bugs/4167/#80f8/d4f4/ea8f


Unfortently I have no idea how to edit ticket :( and the last version of GCL doesn't support by macOS.

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:51 Created by rtoy on 2023-07-31 19:45:38 Original: https://sourceforge.net/p/maxima/bugs/4167/#1553


rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:55 Created by rtoy on 2023-07-31 19:45:38 Original: https://sourceforge.net/p/maxima/bugs/4167/#35ac


Update bug report title to say gcl instead of ccl.

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:03:58 Created by rtoy on 2023-07-31 19:47:00 Original: https://sourceforge.net/p/maxima/bugs/4167/#80f8/d4f4/ea8f/4e5e


I've corrected the title for you by using the "Edit" button next to the title. Is there a reason you want to use gcl? There are other Lisps that will run maxima on recent MacOS machines and OSes.

rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:04:02 Created by vttoth on 2023-08-01 04:49:05 Original: https://sourceforge.net/p/maxima/bugs/4167/#f1fd


Diff:


--- old
+++ new
@@ -1,4 +1,4 @@
-An attempt to build Maxima 5.47 with CCL64 1.12.1 had failed because it produced invalud C code.
+An attempt to build Maxima 5.47 with gcl 2.6.12 had failed because it produced invalid C code.

 Error:


- **status**: open --> not-a-bug
- **assigned_to**: Viktor Toth
rtoy commented 6 days ago

Imported from SourceForge on 2024-07-03 03:04:05 Created by vttoth on 2023-08-01 04:49:05 Original: https://sourceforge.net/p/maxima/bugs/4167/#be61


Closing it as not-a-bug; Maxima 5.47 is not compatible with GCL versions prior to 2.6.14.