sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.37k stars 465 forks source link

Upgrade Maxima to 5.29.1 #13364

Closed kcrisman closed 11 years ago

kcrisman commented 12 years ago
Message: 5
Date: Sun, 12 Aug 2012 23:18:05 +0000 (UTC)
From: Robert Dodier <robert.dodier@gmail.com>
To: maxima@math.utexas.edu
Subject: [Maxima] Maxima 5.28.0 release
Message-ID: <k09djd$dvj$2@dough.gmane.org>

Hi, I've created branch-5_28 in Git and tagged branch-5_28-base and
5.28.0. I've created tar.gz, srpm, and rpm's and uploaded them to the
SourceForge file manager. (http://sourceforge.net/projects/maxima/files)

The new spkg is for ECL 11 as well as for ECL 12, i.e. ASDF-agnostic, along the lines of maxima 5.26.0 at #13860. Moreover it has an upstream patch preventing segfaults. This fixes few tickets.

Install http://boxen.math.washington.edu/home/jdemeyer/spkg/maxima-5.29.1.p1.spkg

Apply

Upstream: Reported upstream. Developers acknowledge bug.

CC: @jpflori @dimpase @nbruin @zimmermann6

Component: packages: standard

Keywords: maxima spkg

Author: Jean-Pierre Flori, Dmitrii Pasechnik

Reviewer: Karl-Dieter Crisman, François Bissey, Leif Leonhardy, Paul Zimmermann

Merged: sage-5.7.beta0

Issue created by migration from https://trac.sagemath.org/ticket/13364

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:48

Back to integration:

Did anyone try using cos() instead? After apparently "deep thinking", I for example get:

sage: integrate(abs(cos(x)),x,0,pi)
-1
sage: integrate(abs(cos(x)),x,0,2*pi)
0
sage: integrate(abs(cos(x)),1/2*pi,3/2*pi)
-2

Unless I'm missing something...

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:49

Replying to @nexttime:

Back to integration:

Did anyone try using cos() instead? After apparently "deep thinking", I for example get:

sage: integrate(abs(cos(x)),x,0,pi)
-1
sage: integrate(abs(cos(x)),x,0,2*pi)
0
sage: integrate(abs(cos(x)),1/2*pi,3/2*pi)
-2

Unless I'm missing something...

Just noticed Sage 5.4 gives the same results.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:50

Replying to @nexttime:

Replying to @nexttime:

Back to integration:

Did anyone try using cos() instead? After apparently "deep thinking", I for example get:

sage: integrate(abs(cos(x)),x,0,pi)
-1
sage: integrate(abs(cos(x)),x,0,2*pi)
0
sage: integrate(abs(cos(x)),1/2*pi,3/2*pi)
-2

Unless I'm missing something...

Just noticed Sage 5.4 gives the same results.

In contrast:

----------------------------------------------------------------------
| Sage Version 4.7.2, Release Date: 2011-10-29                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: integrate(abs(sin(x)),x,0,2*pi)
0
sage: integrate(abs(cos(x)),x,0,2*pi)
integrate(abs(cos(x)), x, 0, 2*pi)
sage: integrate(abs(cos(x)),x,0,pi)
integrate(abs(cos(x)), x, 0, pi)
sage: integrate(abs(cos(x)),x,1/2*pi,3/2*pi)
integrate(abs(cos(x)), x, 1/2*pi, 3/2*pi)

(Same for Sage 4.8.)

dimpase commented 11 years ago
comment:51

Replying to @nexttime:

Back to integration:

Did anyone try using cos() instead? After apparently "deep thinking", I for example get:

sage: integrate(abs(cos(x)),x,0,pi)
-1
sage: integrate(abs(cos(x)),x,0,2*pi)
0
sage: integrate(abs(cos(x)),1/2*pi,3/2*pi)
-2

Unless I'm missing something...

same for 5.1. So I suppose this is a bug in Maxima 5.26, which remained in 5.29. Oh dear. Both 5.26 and 5.29 give the following nonsense:

sage: from sage.symbolic.integration.external import maxima_integrator
sage: g(x)=maxima_integrator(abs(cos(x)), x); g(x)
-((2*sin(x)/((cos(x) + 1)*(sin(x)^2/(cos(x) + 1)^2 + 1)) - 1)*sgn(sin(x)/(cos(x) + 1) - 1) - 2)*sgn(sin(x)/(cos(x) + 1) + 1)
sage: g(0)                                                            
1
sage: g.limit(x=pi)
x |--> 0

This, indeed, one gets -1...

they also both "can" compute maxima_integrator(abs(sin(x)), x)...

sage: g(x)=maxima_integrator(abs(sin(x)), x); g(x)
-(2*sin(x)*arctan(sin(x)/(cos(x) + 1))/(cos(x) + 1) - log(2))*sgn(1/(cos(x) + 1))*sgn(sin(x)) + log(sin(x)^2/(cos(x) + 1)^2 + 1)*sgn(1/(cos(x) + 1))*sgn(sin(x)) - log(2*sin(x)^2/(cos(x) + 1)^2 + 2)*sgn(1/(cos(x) + 1))*sgn(sin(x)) + 2*(sin(x)/((cos(x) + 1)*(sin(x)^2/(cos(x) + 1)^2 + 1)) + arctan(sin(x)/(cos(x) + 1)))*abs(sin(x))/abs(cos(x) + 1)
sage: g(0)
0
dimpase commented 11 years ago
comment:52

see #11483 comment:12 (this is where maxima's abs_integrate was added, to Sage 5.0).

dimpase commented 11 years ago
comment:53

Replying to @nexttime:

Replying to @kiwifb:

Do we know the expression that get passed to maxima? I would check a direct call to maxima and possibly a couple of lisp to check it is not actually a lisp fault.

Well, using the Maxima library segfaults.

I'm not at all familiar with Maxima, but


Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) integrate(abs(sin(x)),x,0,2*pi);
                              2 pi
                             /
                             [
(%o1)                        I     abs(sin(x)) dx
                             ]
                             /
                              0
(%i2) display2d : false$

(%i3) integrate(abs(sin(x)),x,0,2*pi);

(%o3) 'integrate(abs(sin(x)),x,0,2*pi)
(%i4)

FWIW.

no, you need to load some stuff, as spelled out at maxima_lib.py:

init_code = ['display2d : false', 'domain : complex', 'keepfloat : true',
            'load(to_poly_solver)', 'load(simplify_sum)',
            'load(abs_integrate)']

In maxima, you type in

display2d : false;
domain : complex;
keepfloat : true;
load(to_poly_solver);
load(simplify_sum);
load(abs_integrate);
integrate(abs(sin(x)),x);

to get a symbolic answer. It's weird that the definite integral does not get computed, perhaps due to an uncaught error...

kiwifb commented 11 years ago
comment:54

An uncaught error?

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp CLISP 2.48 (2009-07-28)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) display2d : false;
(%o1) false
(%i2)  domain : complex;
(%o2) complex
(%i3)  keepfloat : true;
(%o3) true
(%i4)  load(to_poly_solver);
to_poly_solve: to_poly_solver.mac is obsolete; I'm loading to_poly_solve.mac instead.
Loading maxima-grobner $Revision: 1.6 $ $Date: 2009-06-02 07:49:49 $
WARNING: DEFUN/DEFMACRO: redefining macro OPAPPLY in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
WARNING: DEFUN/DEFMACRO: redefining macro OPCONS in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /scratch/portage/sci-mathematics/maxima-5.29.1/work/maxima-5.29.1/src/binary-clisp/nummod.fas
WARNING: DEFUN/DEFMACRO: redefining function SIMP-ISREAL-P in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly_solve_extra.lisp, was
         defined in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
(%o4) "/usr/share/maxima/5.29.1/share/to_poly_solve/to_poly_solver.mac"
(%i5)  load(simplify_sum);
(%o5) "/usr/share/maxima/5.29.1/share/solve_rec/simplify_sum.mac"
(%i6)  load(abs_integrate);
(%o6) "/usr/share/maxima/5.29.1/share/contrib/integration/abs_integrate.mac"
(%i7)  integrate(abs(sin(x)),x);
(%o7) 4*(abs(sin(x))*(atan(sin(x)/(cos(x)+1))/2
                     +sin(x)/((cos(x)+1)*(2*sin(x)^2/(cos(x)+1)^2+2)))
        /abs(cos(x)+1)
        -(signum(1/(cos(x)+1))*signum(sin(x))*log(2*sin(x)^2/(cos(x)+1)^2+2)
         -signum(1/(cos(x)+1))*signum(sin(x))*log(sin(x)^2/(cos(x)+1)^2+1)
         +signum(1/(cos(x)+1))*signum(sin(x))
                              *(2*sin(x)*atan(sin(x)/(cos(x)+1))/(cos(x)+1)
                               -log(2)))
         /4)
(%i8)

Do you think that could be that obsolete module?

dimpase commented 11 years ago
comment:55

Replying to @kiwifb:

Do you think that could be that obsolete module?

no, it does not matter. It suffices to load abs_integrate only. Actually, then I can reproduce

;;;
;;; Detected access to protected memory, also kwown as 'bus or segmentation fault'.
;;; Jumping to the outermost toplevel prompt
;;;

from within maxima (so no, the library interface does not matter!) if I try

integrate(abs(sin(x)),x,0,2*%pi);

What will you get with the CLISP-based maxima here?

If I try the same on 5.26.0 (from Sage 5.5.rc0 on OSX 10.6.8) , I don't get a segfault; I just get back an unevaluated integral, if I try definite integral, and I get the same (wrong) symbolic expression for the indefinite integral.

kiwifb commented 11 years ago
comment:56

Do you mean doing this?

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp CLISP 2.48 (2009-07-28)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load(abs_integrate);
WARNING: DEFUN/DEFMACRO: redefining macro OPAPPLY in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
WARNING: DEFUN/DEFMACRO: redefining macro OPCONS in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /scratch/portage/sci-mathematics/maxima-5.29.1/work/maxima-5.29.1/src/binary-clisp/nummod.fas
WARNING: DEFUN/DEFMACRO: redefining function SIMP-ISREAL-P in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly_solve_extra.lisp, was
         defined in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
(%o1) /usr/share/maxima/5.29.1/share/contrib/integration/abs_integrate.mac
(%i2) integrate(abs(sin(x)),x);
                             sin(x)
                      atan(----------)
                           cos(x) + 1                 sin(x)
         abs(sin(x)) (---------------- + --------------------------------)
                             2                                2
                                                         2 sin (x)
                                         (cos(x) + 1) (------------- + 2)
                                                                   2
                                                       (cos(x) + 1)
(%o2) 4 (-----------------------------------------------------------------
                                  abs(cos(x) + 1)
                                                 2
               1                            2 sin (x)
 - (signum(----------) signum(sin(x)) log(------------- + 2)
           cos(x) + 1                                 2
                                          (cos(x) + 1)
                                               2
              1                             sin (x)
 - signum(----------) signum(sin(x)) log(------------- + 1)
          cos(x) + 1                                 2
                                         (cos(x) + 1)
                                                      sin(x)
                                      2 sin(x) atan(----------)
              1                                     cos(x) + 1
 + signum(----------) signum(sin(x)) (------------------------- - log(2)))/4)
          cos(x) + 1                         cos(x) + 1
(%i3)
kiwifb commented 11 years ago
comment:57

And i get the same thing with ecl in fact (all system maxima):

;;; Loading #P"/usr/lib64/ecl-12.12.1/sb-bsd-sockets.fas"
;;; Loading #P"/usr/lib64/ecl-12.12.1/sockets.fas"
;;; Loading #P"/usr/lib64/ecl-12.12.1/defsystem.fas"
;;; Loading #P"/usr/lib64/ecl-12.12.1/cmp.fas"
Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load(abs_integrate);
(%o1) /usr/share/maxima/5.29.1/share/contrib/integration/abs_integrate.mac
(%i2) integrate(abs(sin(x)),x);
                             sin(x)
                      atan(----------)
                           cos(x) + 1                 sin(x)
         abs(sin(x)) (---------------- + --------------------------------)
                             2                                2
                                                         2 sin (x)
                                         (cos(x) + 1) (------------- + 2)
                                                                   2
                                                       (cos(x) + 1)
(%o2) 4 (-----------------------------------------------------------------
                                  abs(cos(x) + 1)
                                                 2
               1                            2 sin (x)
 - (signum(----------) signum(sin(x)) log(------------- + 2)
           cos(x) + 1                                 2
                                          (cos(x) + 1)
                                               2
              1                             sin (x)
 - signum(----------) signum(sin(x)) log(------------- + 1)
          cos(x) + 1                                 2
                                         (cos(x) + 1)
                                                      sin(x)
                                      2 sin(x) atan(----------)
              1                                     cos(x) + 1
 + signum(----------) signum(sin(x)) (------------------------- - log(2)))/4)
          cos(x) + 1                         cos(x) + 1
(%i3)
dimpase commented 11 years ago
comment:58

Replying to @kiwifb:

Do you mean doing this?

I meant the definite integral, which causes the segfault for us:

integrate(abs(sin(x)),x,0,2*%pi);
kiwifb commented 11 years ago
comment:59

OK didn´t spot the definite bit, fails also with clisp:

Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp CLISP 2.48 (2009-07-28)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) load(abs_integrate);
WARNING: DEFUN/DEFMACRO: redefining macro OPAPPLY in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
WARNING: DEFUN/DEFMACRO: redefining macro OPCONS in /usr/share/maxima/5.29.1/share/fourier_elim/fourier_elim.lisp, was defined in
         /scratch/portage/sci-mathematics/maxima-5.29.1/work/maxima-5.29.1/src/binary-clisp/nummod.fas
WARNING: DEFUN/DEFMACRO: redefining function SIMP-ISREAL-P in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly_solve_extra.lisp, was
         defined in /usr/share/maxima/5.29.1/share/to_poly_solve/to_poly.lisp
(%o1) /usr/share/maxima/5.29.1/share/contrib/integration/abs_integrate.mac
(%i2) integrate(abs(sin(x)),x,0,2*%pi);

*** - Program stack overflow. RESET

[../src/eval.d:573] reset() found no driver frame (sp=0x7fff1606f430-0x7fff160690b0)
Exiting on signal 6
Aborted
dimpase commented 11 years ago
comment:60

Replying to @kiwifb:

OK didn´t spot the definite bit, fails also with clisp:

OK, now we have something to report upstream... The homepage of the author of abs_integrate is here. Perhaps one should at least cc him when reporting. Can you do this?

dimpase commented 11 years ago

Upstream: Not yet reported upstream; Will do shortly.

kiwifb commented 11 years ago
comment:62

I am not sure about the usual procedure favored by maxima people. A message on their mailing list or straight to sourceforge bugtracker? I am also not sure how to title the report.

dimpase commented 11 years ago
comment:63

Replying to @kiwifb:

I am not sure about the usual procedure favored by maxima people. A message on their mailing list or straight to sourceforge bugtracker? I am also not sure how to title the report.

OK, I'll take care of this.

dimpase commented 11 years ago

Changed upstream from Not yet reported upstream; Will do shortly. to Reported upstream. No feedback yet.

dimpase commented 11 years ago
comment:64

Reported as maxima's bug 2520.

jpflori commented 11 years ago
comment:65

I think the makeinfo problem is my fault, I did not preserved timestamps when updating the src directory and I think this triggers the regeneration of some autocrap and finally lead to running a second time config.status.

I'm reuploading a proper spkg in a few minutes.

jpflori commented 11 years ago
comment:66

New spkg which should install properly with ECL 12.12.1 from #13324, should not need makeinfo as well.

jpflori commented 11 years ago
comment:67

makeinfo is still invoked, too bad.

kcrisman commented 11 years ago
comment:68

I am not sure about the usual procedure favored by maxima people. A message on their mailing list or straight to sourceforge bugtracker? I am also not sure how to title the report.

OK, I'll take care of this.

Just for future reference, bug tracker is best, but also putting something on the mailing list as a "heads up" doesn't hurt - but my experience is that the mailing list either gets lots of traction or none.

kcrisman commented 11 years ago
comment:69

New spkg which should install properly with ECL 12.12.1 from #13324, should not need makeinfo as well.

This installed properly on Cygwin on XP. How do I check whether the library is correct (other than the fact that there is a local/lib/ecl/maxima.fas) since #9671 is still unresolved?

jpflori commented 11 years ago
comment:70

I guess you can launch a ecl shell with sage -ecl and then type (require :maxima). This should not be affected by #9671.

jpflori commented 11 years ago
comment:71

Ok, I just copied pasted some of the above find command and modified it and did not think, and what happens is that the .info files are not touched. So the fix is easy.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:72

Replying to @jpflori:

I think the makeinfo problem is my fault, I did not preserved timestamps when updating the src directory

Yeah, I also noticed that and made an spkg with "fresh" src/ (also spkg-dist'ed), but only after I had already triggered a new build from scratch with the ECL and Maxima spkgs replaced, so haven't tested that yet.

IMHO all necessary files get touched, but as mentioned, the TeXinfo file gets recreated upon building as well.

jpflori commented 11 years ago
comment:73

With the just uploaded spkg, everything is correctly touched, timestamps are ok and makeinfo is not invoked.

So I guess that apart from fixing the doctests, and the Maxima upstream bug, everything looks rather ok.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:74

Ok, building Sage 5.5.rc0 from scratch with the ECL and Maxima spkgs replaced, this time with GCC 4.4.3 and without setting any flags, gives exactly the same doctest errors (plus those due to not having applied the patch from #13324), including the famous access to protected memory messages.

(Haven't tried or looked at JP's new p0 yet.)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:75

Replying to @jpflori:

I guess that apart from fixing the doctests, and the Maxima upstream bug, everything looks rather ok.

Well, presumably we'll never merge a new Maxima without new known bugs (although fixing some old ones), probably even regressions, but I feel a bit uncomfortable with how symbolic integration (using the Maxima library interface) now fails, since Sage actually crashes (without itself catching the segfault).

(Others may say that's better than "silently" giving a wrong answer... ;-) )

We could mark the doctest # not tested for now, but who knows where else similar can or will happen.

Thoughts?

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:76

Replying to @kiwifb:

...
(%i4)  load(to_poly_solver);
to_poly_solve: to_poly_solver.mac is obsolete; I'm loading to_poly_solve.mac instead.
...

We should probably fix that in sage/interfaces/maxima_lib.py (in the init_code list), perhaps sage/calculus/calculus.py (where the code is commented out, and is there for explanation only, apparently), and in a couple of docstrings elsewhere (sage/symbolic/{expression,relation}.py*).

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago

Changed work issues from fix doctests, build with latest ECL, fix spkg-install to fix doctests

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago

Description changed:

--- 
+++ 
@@ -13,3 +13,8 @@

This should fix at least a few tickets. + +--- + +New spkg: http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg +

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:78

Replying to @nexttime:

Replying to @jpflori:

I think the makeinfo problem is my fault, I did not preserved timestamps when updating the src directory

Yeah, I also noticed that and made an spkg with "fresh" src/ (also spkg-dist'ed), but only after I had already triggered a new build from scratch with the ECL and Maxima spkgs replaced, so haven't tested that yet.

IMHO all necessary files get touched, but as mentioned, the TeXinfo file gets recreated upon building as well.

Yes, that fixed the issue.

I used

diff --git a/spkg-install b/spkg-install
--- a/spkg-install
+++ b/spkg-install
@@ -38,14 +38,16 @@
 ./configure --prefix="$SAGE_LOCAL" --libdir="$SAGE_LOCAL/lib" --enable-ecl
 check_error "Failed to configure Maxima."

+echo
 # Touching html and info files to avoid to regenerate them.
 # This must be done after configuration since the timestamps need
 # to be later than include-maxima.texi which is generated at
 # configuration time:
-for i in doc/info/*.html ; do
-    touch "${i}"
+echo "Touching some HTML and info files to avoid their regeneration..."
+for f in doc/info/*.html doc/info/maxima.info*; do
+    echo "  $f"
+    touch "$f"
 done
-touch doc/info/maxima.info*

 echo
@@ -108,10 +110,13 @@
 check_error "Failed to build Maxima as an ECL library."

 ECLLIB=`ecl -eval "(princ (SI:GET-LIBRARY-PATHNAME))" -eval "(quit)"`
+src_dir=`pwd`
+src_name="maxima.system.fasb" # This has changed from 'maxima.fasb'.
+tgt_name="maxima.fas"
 echo
-echo "Now installing the Maxima library as '$ECLLIB/maxima.fas'..."
-cp -f maxima.fasb "$ECLLIB/maxima.fas"
-check_error "Failed to install '`pwd`/maxima.fasb' as '$ECLLIB/maxima.fas'."
+echo "Now installing the Maxima library as '$ECLLIB/${tgt_name}'..."
+cp -f "${src_dir}/${src_name}" "$ECLLIB/${tgt_name}"
+check_error "Failed to install '${src_dir}/${src_name}' as '$ECLLIB/${tgt_name}'."

 if [[ "$SAGE_SPKG_INSTALL_DOCS" = yes ]] ; then

but JP's solution looks ok as well.

kcrisman commented 11 years ago
comment:79

Replying to @jpflori:

I guess you can launch a ecl shell with sage -ecl and then type (require :maxima). This should not be affected by #9671.

$ ./sage -ecl
ECL (Embeddable Common-Lisp) 12.12.1 (git:UNKNOWN)
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.
Top level.
> (require :maxima)

;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/maxima.fas"
;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/sockets.fas"
("SB-BSD-SOCKETS" "SOCKETS" "MAXIMA")
> (+ 2 2);

4

Though I didn't know how to run a Maxima command in this, the fact that no error was raised seems good.

dimpase commented 11 years ago

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

dimpase commented 11 years ago
comment:80

there is quite a bit of activity on maxima's tracker on the reported bug. There seem to be several(?) bugs triggered, not in abs_integrate package, but in the "core" maxima.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:81

Anybody a clue where the extra question mark (in e.g. "Is a an ?integer?") may originate from?

I don't get it with sage --maxima.

jpflori commented 11 years ago
comment:82

I guess the string produced by Maxima and the way it is treated before printing changed, so the way we do it in maxima_lib at the lisp level is not uptodate anymore?

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:83

Replying to @jpflori:

I guess the string produced by Maxima and the way it is treated before printing changed, so the way we do it in maxima_lib at the lisp level is not uptodate anymore?

Ahem, yes, presumably... ;-) [AFAICS the original retrieve function hasn't changed.]

I was wondering whether some non-printable character (like ASCII BEL) gets mapped to a literal ?, but at least the position is strange, and e.g. "Is a positve, negative, or zero?" (note the [IMHO inconsistent] extra spaces) in contrast is just as before (at least on the Python level, i.e., the string passed with the exception, before we strip "ECL says: Maxima asks: ").

dimpase commented 11 years ago
comment:85

for the record, maxima 5.26.0 cannot do similar definite integrals involving abs, either:

(%i2) integrate(abs(cos(x)),x,0,2*%pi);

log: encountered log(0).
[...]
(%o2)                                  0
83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago
comment:86

Dima's Maxima 5.26.0.p1 spkg from #13860 now builds with both the old (our current) and the new ECL (from #13324), so the spkg here should be (re-)based on that one. (It would then no longer depend on #13324, too.)

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 11 years ago

Changed dependencies from #13324 to #13860

dimpase commented 11 years ago

Description changed:

--- 
+++ 
@@ -18,3 +18,4 @@

 **New spkg:** [http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg](http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg)

+**with un upstream patch preventing segfaults:**  [http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg](http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg)
dimpase commented 11 years ago
comment:87

added to the spkg patch (from Maxima bug tracker: a patch for bug 2520) gets rid of the segfaults on integrate(abs(sin(x)),x,0,2*pi) reported here.

dimpase commented 11 years ago
comment:88

There is a regression: maxima 5.29 (and 5.28) cannot compute integrate(sqrt(x + sqrt(x)), x). Reported as issue 2526 on Maxima's tracker. This leads to a doctest failure in maxima_lib.py (line 716).

dimpase commented 11 years ago

Description changed:

--- 
+++ 
@@ -12,10 +12,13 @@
 SourceForge file manager. (http://sourceforge.net/projects/maxima/files)

-This should fix at least a few tickets. +This should fix at least a few tickets. The following spkgs are for ECL 12.12 (new ASDF)


New spkg: http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg

-with un upstream patch preventing segfaults: http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg +with an upstream patch preventing segfaults: http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg + +apply +* attachment: doctests.patch

dimpase commented 11 years ago
comment:89

remaining doctest issues are due to extra ? characters appearing in Maxima library interactions in sage/calculus.py, such as

    Is a an ?integer?

and

    Is a an ?even?\ ?number?

instead of

    Is a an integer?

and

    Is a an even number?

This needs to be investigated, IMHO.

dimpase commented 11 years ago

Description changed:

--- 
+++ 
@@ -12,13 +12,14 @@
 SourceForge file manager. (http://sourceforge.net/projects/maxima/files)

-This should fix at least a few tickets. The following spkgs are for ECL 12.12 (new ASDF) +This should fix at least a few tickets. The following spkg is for ECL 12.12 (new ASDF)


New spkg: http://boxen.math.washington.edu/home/jpflori/maxima-5.29.1.p0.spkg

-with an upstream patch preventing segfaults: http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg +The following spkg is for ECL 11 as well as for ECL 12, i.e. ASDF-agnostic, along the lines of maxima 5.26.0 at #13860. Moreover it has +an upstream patch preventing segfaults: http://boxen.math.washington.edu/home/dima/packages/maxima-5.29.1.p1.spkg

apply

dimpase commented 11 years ago
comment:91

Replying to @dimpase:

the spkg is updated to work with ECL 11.1.1, as well as with the new ECL 12.12. Doctests show that the ?integer? stuff does not go away if ECL 11.1.1 is used. So this is the new Maxima to blame for.

dimpase commented 11 years ago
comment:92

I'm doing git bisect on the Maxima repo to try to find the places to blame. It looks it was a long story, more than just a single change to undo. The first bad commit after the clean situation, as if in 5.26.0, is

4e2e7fb738e6f9f1955a5378ae392a1930b30bce
Merge branch 'share-cleanup-branch-2011-10'

Maxima identifies itself as Maxima 5.26.0_70_g4e2e7fb_dirty, and one gets

sage: var('a');assume(a>0);limit(x^a,x=0)
a
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line string', (205, 187))
[...]
RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined.

looking at the commit more carefully, one sees renaming to_poly_solver to to_poly_solve. If I make this change in sage/interfaces/maxima_lib.py, line 142, the error go away. So in fact these ?integer? things got in later.

Back to git bisect now.