sagemath / sage

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

Update ECL to 10.4.1 and Maxima to 5.22.1 - currently the latest releases. #10187

Closed vbraun closed 13 years ago

vbraun commented 13 years ago

Note: See #10434 for a follow-up ticket.

Please update ECL and Maxima to the newest upstream release. Sage packages are here:

It's unsafe to build either ECL or Maxima in parallel, so we must not do this. Updated versions of ECL and Maxima can be found here:

http://boxen.math.washington.edu/home/kirkby/patches/ecl-10.4.1.spkg

http://www.stp.dias.ie/~vbraun/Sage/spkg/maxima-5.22.1.spkg

Note that you cannot upgrade one without the other; Both ECL and Maxima need to be upgraded simultaneously or build will fail.

Relevant tickets for ECL:

Relevant tickets for maxima:

The updated Maxima code seems to be more careful about signs which leads to doctest errors. Moreover, error reporting was changed. Therefore you need to apply the following patches to the Sage library (in this order):

Finally, you need to patch $SAGE_ROOT/local/bin/sage-maxima.lisp with

Upstream: Workaround found; Bug reported upstream.

CC: @williamstein @jhpalmieri @qed777 @nexttime @jaapspies @jasongrout @kcrisman @kiwifb @jpflori

Component: packages: standard

Author: Volker Braun, David Kirkby

Reviewer: Karl-Dieter Crisman, David Kirkby, Volker Braun, Leif Leonhardy

Merged: sage-4.6.1.alpha3

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

vbraun commented 13 years ago
comment:2

The doctests show one maxima regression:

sage: t = log(sqrt(2) - 1) + log(sqrt(2) + 1); t
log(sqrt(2) - 1) + log(sqrt(2) + 1)
sage: u = t.maxima_methods(); u
MaximaWrapper(log(sqrt(2) - 1) + log(sqrt(2) + 1))
sage: u.logcontract()
log((sqrt(2) - 1)*(sqrt(2) + 1))

This simplified to 0 in a previous version. But at least its not wrong ;-)

The attached patch fixes all doctests except for a timeout in maxima. That one is a different issue with maxima, which forgets to print the general-display-prefix variable for errors:

(sage subshell) volker-desktop:sage vbraun$ ./local/bin/maxima -p ./local/bin/sage-maxima.lisp 
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/cmp.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sysfun.lsp"
Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp ECL 10.4.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) 1;
<sage-display>(%o1)                                  1
(%i2) 1==1;
incorrect syntax: = is not a prefix operator
1==
 ^
(%i2) 1=1;
<sage-display>(%o2)                                1 = 1
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:3

FYI, here's the failures on OpenSolaris 06/2009 with those updated versions of Maxima and ECL.

sage -t  -long -force_lib devel/sage/sage/interfaces/maxima.py
*** *** Error: TIMED OUT! PROCESS KILLED! *** ***

     [1800.2 s]

----------------------------------------------------------------------

The following tests failed:

    sage -t  -long -force_lib devel/sage/sage/symbolic/integration/integral.py # 6 doctests failed
    sage -t  -long -force_lib devel/sage/sage/symbolic/maxima_wrapper.py # 1 doctests failed
    sage -t  -long -force_lib devel/sage/sage/symbolic/expression.pyx # 11 doctests failed
    sage -t  -long -force_lib devel/sage/sage/misc/functional.py # 2 doctests failed
    sage -t  -long -force_lib devel/sage/sage/calculus/wester.py # 1 doctests failed
    sage -t  -long -force_lib devel/sage/sage/calculus/tests.py # 1 doctests failed
    sage -t  -long -force_lib devel/sage/sage/calculus/calculus.py # 5 doctests failed
    sage -t  -long -force_lib devel/sage/sage/calculus/functional.py # 1 doctests failed
    sage -t  -long -force_lib devel/sage/sage/plot/plot3d/transform.pyx # 1 doctests failed
    sage -t  -long -force_lib devel/sage/sage/interfaces/maxima.py # Time out
----------------------------------------------------------------------
Total time for all tests: 2628.2 seconds
make: *** [ptestlong] Error 192
drkirkby@hawk:~/sage-4.6.1.alpha0$ 

I've not applied any patches at this point. I'll apply patches and rerun later.

kcrisman commented 13 years ago
comment:4

Replying to @sagetrac-drkirkby:

FYI, here's the failures on OpenSolaris 06/2009 with those updated versions of Maxima and ECL.

sage -t  -long -force_lib devel/sage/sage/interfaces/maxima.py
*** *** Error: TIMED OUT! PROCESS KILLED! *** ***

     [1800.2 s]

I'd be interested what happened if you manually removed the tests in that file which test the tab-completion for Maxima. I get a problem on Mac OS X Tiger with that file for exactly that reason. We haven't filed a ticket because nobody knows how to fix it, and tab-completion does work on that platform, just not the testing.

vbraun commented 13 years ago
comment:5

The TIMED OUT! error is the missing general-display-prefix, which causes the expect interface to wait forever for maxima to print its next prompt.

I've filed a bug upstream here: https://sourceforge.net/tracker/?func=detail&aid=3098375&group_id=4933&atid=104933

kcrisman commented 13 years ago
comment:6

Replying to @vbraun:

The TIMED OUT! error is the missing general-display-prefix, which causes the expect interface to wait forever for maxima to print its next prompt.

Okay, thanks - so that's unrelated to the Tiger timeout from earlier Maximas.

vbraun commented 13 years ago
comment:7

I've modified sage/interfaces/maxima.py to work with maxima's prompt_prefix instead. Patch is attached and fixes the remaining doctest error.

This requires that `$SAGE_LOCAL/bin/sage-maxima.lisp sets

; (setf *general-display-prefix* "<sage-display>")
(setf *prompt-prefix* "<sage-display>")

I've made a updated sage_scripts spkg here: http://www.stp.dias.ie/~vbraun/Sage/spkg/sage_scripts-4.6.rc0.p0.spkg

To test this ticket, you need all three spkgs and both patches.

vbraun commented 13 years ago

Upstream: Workaround found; Bug reported upstream.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:10

One thing we don't don, which I think would be sensible, is to include the test suite for ECL. That adds 1.7 MB. From the README.ECL file:

    cd tests
    make

You will find two types of output files:

    *.out   The whole output of a test
    *.erg   The errors arising from a test

When there is no *.erg, it means that ECL passed the test.

Would it not be sensible to add these in? Then we could execute the tests with a spkg-check file, like we do other code which has self-tests.

Dave

kcrisman commented 13 years ago
comment:11

Replying to @vbraun:

I've modified sage/interfaces/maxima.py to work with maxima's prompt_prefix instead. Patch is attached and fixes the remaining doctest error.

Just a very minor note:

# we are now getting three lines of commented verbosity 

but of course you changed it to get rid of the extra two lines from our constantly added packages :) so it's now five lines. Might as well change that too so future people are confused.

kcrisman commented 13 years ago
comment:12

Also, be sure to include a test that shows #8729 is fixed, as that was closed as a duplicate on the condition that #8731's doctests would show that.

f8667504-6eb9-4678-970d-c85e19c6bba2 commented 13 years ago
comment:13

I looked trough doctest patch and compared it with mine from #8731, I have few comments.

I think that doctest fix for sage/calculus/functional.py should be modified - it was documentation of the use of assume, but now - when maxima can calculate this integral without assumption, isn't that same as applying assumption to result? And the integral is checked in other doctest now. Maybe there is better example that still needs the assume to get result?

Also the doctest in sage/misc/functional.py was here to demonstrate numerical approximation of integral that cannot be evaluated iirc, and now when it can be evaluated, I think it should be changed to something that cannot be - like Jason did in patch in #8731.

Finally, there is typo in doctest to sage/symbolic/expression.pyx - it should say that this doctest is here to check that #7334 not #7344 is fixed (#7344 point to libjpeg issue so it cannot be it) - and it should stay in here unmodified. Also - the log thing - it's not exactly regression, it's feature. This is because of Maxima ticket 947808 - http://sourceforge.net/tracker/?func=detail&aid=947808&group_id=4933&atid=104933 - they now try to keep the expression as factored as they can without using factor. This results in observed behaviour. This doctest I think cannot be changed as it demonstrated that ticket is solved, but we should apply "x = x.simplify_rational()" after "x = x.simplify_log('one')" in definition of simplify_full - that way full simplify would result in same results as before I think, and #7334 would be still fixed. Now, this doctest shows nothing.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:14

There is a problem with the ECL package here. The history of all recent changes has been lost. The recent changes to the package have been:

=== ecl-10.2.1.p3 (David Kirkby, David Kirkby, 17th September 2010) ===
=== ecl-10.2.1.p2 (David Kirkby, 30th July 2010) ===
=== ecl-10.2.1.p1 (Mitesh Patel, 11th July 2010) ===
=== ecl-10.2.1.p0 (David Kirkby, 11th July 2010) ===
=== ecl-10.2.1 (William Stein, 14 February 2010) ===

but instead SPKG.txt shows

=== ecl-10.4.1.p0 (Leif Leonhardy, Volker Braun, 29th September 2010) ===
=== ecl-10.4.1 (N. Bruin, W. Stein, D. Kirkby and M. Patel 19th June 2010) ===
=== ecl-10.2.1 (William Stein, 14 February 2010) ===

This error has occurred since the package is based on one that I created several months ago, which never got merged, because their were conflicts with that and the Maxima package at the time.

The current version of ECL in Sage should have been used as a starting point - not an old one that was never merged.

I'll sort the above problem out, and add the ECL test code today.

Dave

kiwifb commented 13 years ago
comment:15

The patch fix_easy_doctest doesn't apply cleanly on either 4.6.rc0 or 4.6.1.alpha0. Was it prepared against 4.5.3?

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 13 years ago
comment:16

Replying to @vbraun:

I've modified sage/interfaces/maxima.py to work with maxima's prompt_prefix instead. Patch is attached and fixes the remaining doctest error.

This requires that `$SAGE_LOCAL/bin/sage-maxima.lisp sets

; (setf *general-display-prefix* "<sage-display>")
(setf *prompt-prefix* "<sage-display>")

I've made a updated sage_scripts spkg here: http://www.stp.dias.ie/~vbraun/Sage/spkg/sage_scripts-4.6.rc0.p0.spkg

To test this ticket, you need all three spkgs and both patches.

Could you please attach a patch to the scripts repo, too (rather than a link to a complete new scripts spkg)?

Also, attaching diffs (or Mercurial patches) of the spkgs makes reviewing easier.

83660e46-0051-498b-a8c1-f7a7bd232b5a commented 13 years ago
comment:17

Replying to @nexttime:

Could you please attach a patch to the scripts repo, too (rather than a link to a complete new scripts spkg)?

P.S.: Of course I could do that, too, but then you wouldn't be able to update it in case you later modify the patch.

vbraun commented 13 years ago

Attachment: trac_10187_general_display_prefix_workaround.patch.gz

Updated patch

vbraun commented 13 years ago
comment:18

I've incorporated your suggestions and updated the patches. Both are (and were) against 4.6.rc0 and apply cleanly. Maybe you had the wrong order? It should be

I'll attach patches for the sage_scripts and maxima spgk for easier review. Once Dave is finished with the ecl package then this ticket is ready for review again.

kiwifb commented 13 years ago
comment:19

Wrong order indeed! I thought the two patches were orthogonal.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:20

I'm going to have to ask on the ECL list how to run the test suite - I can't work out where ones supposed to copy the source.

These changes are not going to make it into 4.6. The milestone is 4.6.1, and it will easily be resolved by then.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:21

Replying to @sagetrac-drkirkby:

I'm going to have to ask on the ECL list how to run the test suite - I can't work out where ones supposed to copy the source.

These changes are not going to make it into 4.6. The milestone is 4.6.1, and it will easily be resolved by then.

Dave

I've now got the information on the ANSI test suite from the ECL developer, though I gather the copy on the ECL site is rather out of date. Also, the ECL developer has fixed the bug that causes #9840, so I'll patch that too, so #9840 can hopefully be closed at the same time.

I'll try to get this sorted out within the next few days.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:22

I have put an updated ECL file at http://boxen.math.washington.edu/home/kirkby/patches/ecl-10.4.1.spkg This has only been checked on OpenSolaris - I don't have access to a Fedora 14 machine, so can't verify if it actually fixes the issues reported at #10185

I should make a few comments about this:

After

I get one reject out of six when adding

trac_10187_general_display_prefix_workaround.patch

to sage 4.6.1.alpha0, so I think that patch needs updating. The contents of the reject are:

--- maxima.py
+++ maxima.py
@@ -728,10 +729,12 @@

             sage: maxima._eval_line('1+1;')
             '2'
-            sage: maxima.eval('sage0: x == x;')
+            sage: maxima._eval_line('sage0: x == x;')
             Traceback (most recent call last):
             ...
-            TypeError: error evaluating "sage0: x == x;":...
+            TypeError: Error executing code in Maxima...
+
+
         """
         if len(line) == 0:
             return ''

But as I say, all doctests passed for me, despite one patch was not fully applied!!

----------------------------------------------------------------------
All tests passed!
Total time for all tests: 1871.3 seconds

I'm leaving as needs work, as clearly the fact one patch does not apply cleanly is a problem. It also needs testing on more than one system, but I don't have access to the Fedora 14 system where this was a particular problem.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago

Description changed:

--- 
+++ 
@@ -1,17 +1,15 @@
 Please update ecl and maxima to the newest upstream release. Sage packages are here:

-http://www.stp.dias.ie/~vbraun/Sage/spkg/ecl-10.4.1.p0.spkg
+http://boxen.math.washington.edu/home/kirkby/patches/ecl-10.4.1.spkg
 http://www.stp.dias.ie/~vbraun/Sage/spkg/maxima-5.22.1.spkg

 Note that you cannot upgrade one without the other; Both need to be upgraded simultaneously or build will fail.

 Relevant tickets for ecl:

-* #9264: Apply ALL relevent fixes to ECL 10.4.1: As far as I can tell all relevant patches are included in ecl-10.4.1.p0.spkg.
+* #9493: Remove extra baggage from ECL 10.2.1.p1 (again). The package has been cleaned up, but I feel removing gmp sources is too dangerous. 

-* #9493: Remove extra baggage from ECL 10.2.1.p1 (again): Patch is included and #9493 can be closed after this ticket.
-
-* #10185: the old ecl-10.2.1 does not build on Fedora 14: Fixed with the updated ecl from this ticket.
+* #10185: the old ecl-10.2.1 does not build on Fedora 14: Hopefully fixed with the updated ecl from this ticket.

 Relevant tickets for maxima:
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago

Changed author from Volker Braun to Volker Braun, David Kirkby

vbraun commented 13 years ago
comment:23

Dave's ecl-10.4.1.spkg compiles just fine on Fedora 14! I don't have sage 4.6.1.alpha0 installed right now, so it'll take me a few hours to update the patch.

vbraun commented 13 years ago
comment:24

Patches apply cleanly on sage 4.6.1.alpha0. As I wrote in #10187 comment:18, they need to be applied in the order

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:25

Replying to @vbraun:

Patches apply cleanly on sage 4.6.1.alpha0. As I wrote in #10187 comment:18, they need to be applied in the order

  • trac_10187_fix_easy_doctests.patch
  • trac_10187_general_display_prefix_workaround.patch

Perhaps I did not have a clean sage 4.6.1.alpha0. I will start a fresh build and try again.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:26

Replying to @vbraun:

Patches apply cleanly on sage 4.6.1.alpha0. As I wrote in #10187 comment:18, they need to be applied in the order

  • trac_10187_fix_easy_doctests.patch
  • trac_10187_general_display_prefix_workaround.patch

Ah, I missed that fact. I applied the patches in the order they were applied to the trac ticket, which is the reverse order to what you are saying should have been done!

I've just started a build. It takes a bit over an hour to build Sage and run all the long doctests on this machine, but it's 11 pm local time. I'll try to get it done before going to bed, so I can report on it, but it might have to wait until tomorrow. I'm feeling rather tired here.

Dave

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:27

OK, this is fine on OpenSolaris 06/2009 and Fedora 14. What about any other platforms?

kiwifb commented 13 years ago
comment:28

Replying to @sagetrac-drkirkby:

OK, this is fine on OpenSolaris 06/2009 and Fedora 14. What about any other platforms?

I have switched sage-on-gentoo to maxima-5.22.1 on sage-4.6's release I haven't run a long test of alpha1 with it but I haven't heard complaint from anyone running tests on x86 and amd64 with 4.6.

bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 13 years ago
comment:29

Replying to @kiwifb:

I have switched sage-on-gentoo to maxima-5.22.1 on sage-4.6's release I haven't run a long test of alpha1 with it but I haven't heard complaint from anyone running tests on x86 and amd64 with 4.6.

Thank you. I must do some other things today, so don't have time to test this much. But hopefully we can get some testers on other platforms. To my knowledge we know nothing about

all of which are supported platforms.

I've asked on sage-devel, if someone else can do some testing. It would be nice to get this merged. Experience shows if we leave updating Maxima too long, it becomes a nightmare to update. It really is something we should regularly update - not only for new functionality, but also it saves a nightmare at a later date.

Dave

kcrisman commented 13 years ago
comment:31

I'm currently testing on OS X 10.4 (Tiger) PPC. ECL installed fine, but I won't be able to see the results of the rest and some testing until tomorrow.

jpflori commented 13 years ago
comment:32

I tested both spkg on Debian, everything compiled fine, the patches applied cleanly on 4.6.1.alpha2 and sage_scripts spkg from that version (when applied in order of comment 18, otherwise 1 hunk does not get applied) and all tests passed.

sage -t -long -force_lib "devel/sage/sage/interfaces/maxima.py"
         [22.4 s]

----------------------------------------------------------------------
All tests passed!
Total time for all tests: 22.5 seconds

It should be noted that the Maxima update fixes #7952 (and #10273 I opened by mistake and closed as duplicate).

kcrisman commented 13 years ago

Work Issues: new interface patch needs help

kcrisman commented 13 years ago
comment:33

I get a LOT of timeouts on PPC OS X 10.4. I think that basically any time Maxima is invoked inside Sage, it times out or does something else weird. E.g.

sage: integrate(x^2,x)
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
 ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
 ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
 ignored
Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
Exception RuntimeError: RuntimeError('maximum recursion depth exceeded in cmp',) in Exception RuntimeError: 'maximum recursion depth exceeded in __subclasscheck__' in <type 'exceptions.RuntimeError'> ignored
 ignored

I also get the following:

sage -t -long "devel/sage/sage/calculus/functions.py"       
**********************************************************************
File "/Users/student/Desktop/sage-4.6/devel/sage/sage/calculus/functions.py", line 46:
    sage: wronskian(*[x^k for k in range(1, 5)])
        assert len(self._before())==0, 'Maxima expect interface is confused!'
    AssertionError: Maxima expect interface is confused!

What the heck? I assume the change to the Maxima interface is to blame; reverting that patch only (not the doctest one) seems to fix the problem.

Though in that case I do get

File "/Users/student/Desktop/sage-4.6/devel/sage/sage/calculus/calculus.py", line 343:
    sage: taylor(gamma(1/3+x),x,0,3)
Expected:
    -1/432*((36*(pi*sqrt(3) + 9*log(3))*euler_gamma^2 + 27*pi^2*log(3) + 72*euler_gamma^3 + 243*log(3)^3 + 18*(6*pi*sqrt(3)*log(3) + pi^2 + 27*log(3)^2 + 12*psi(1, 1/3))*euler_gamma + 324*psi(1, 1/3)*log(3) + (pi^3 + 9*(9*log(3)^2 + 4*psi(1, 1/3))*pi)*sqrt(3))*gamma(1/3) - 72*gamma(1/3)*psi(2, 1/3))*x^3 + 1/24*(6*pi*sqrt(3)*log(3) + 4*(pi*sqrt(3) + 9*log(3))*euler_gamma + pi^2 + 12*euler_gamma^2 + 27*log(3)^2 + 12*psi(1, 1/3))*x^2*gamma(1/3) - 1/6*(6*euler_gamma + pi*sqrt(3) + 9*log(3))*x*gamma(1/3) + gamma(1/3)
Got:
    -1/432*((36*(pi*sqrt(3) + 9*log(3))*euler_gamma^2 + 27*pi^2*log(3) + 72*euler_gamma^3 + 243*log(3)^3 + 18*(6*pi*sqrt(3)*log(3) + pi^2 + 27*log(3)^2 + 12*psi(1, 1/3))*euler_gamma + 324*log(3)*psi(1, 1/3) + (pi^3 + 9*(9*log(3)^2 + 4*psi(1, 1/3))*pi)*sqrt(3))*gamma(1/3) - 72*gamma(1/3)*psi(2, 1/3))*x^3 + 1/24*(6*pi*sqrt(3)*log(3) + 4*(pi*sqrt(3) + 9*log(3))*euler_gamma + pi^2 + 12*euler_gamma^2 + 27*log(3)^2 + 12*psi(1, 1/3))*x^2*gamma(1/3) - 1/6*(6*euler_gamma + pi*sqrt(3) + 9*log(3))*x*gamma(1/3) + gamma(1/3)
**********************************************************************

which is interesting; if you find where they differ (hint - transposed multiplication), you win the Where's Waldo award.

I'll report back if there are any other errors without it.

kcrisman commented 13 years ago

Reviewer: Karl-Dieter Crisman

vbraun commented 13 years ago
comment:34

kcrisman: looks like you did not install the updated sage_scripts-4.6.rc0.p0.spkg, see #10187 comment:7

jdemeyer commented 13 years ago
comment:35

If sage_scripts needs to be patched, please provide a hg patch for that.

jpflori commented 13 years ago
comment:36

It is sage-maxima.lisp.patch provided in the ticked.

It applies cleanly on sage_script spkg of sage 4.6.1.alpha2 for me and tests pass.

kcrisman commented 13 years ago
comment:37

Replying to @jdemeyer:

If sage_scripts needs to be patched, please provide a hg patch for that.

Looks like it needs a commit message to apply straight-up with hg_scripts, so it's not ready as it stands, perhaps.

Without either of those patches, I get most relevant tests passing EXCEPT the taylor(gamma(1/3+x),x,0,3) one, on both OS X 10.6 Intel and 10.4 PPC. The interfaces/maxima.py times out without both the workaround and lisp patch on 10.6, after which it's fine on that and sage/calculus, sage/symbolic, and sage/functions.

I haven't tested that last combination of patches yet on my 10.4 machine, as it's very slow - later today I might know more.

vbraun commented 13 years ago

patch to SAGE_LOCAL/bin/sage_maxima.lisp with commit message

vbraun commented 13 years ago
comment:38

Attachment: trac_10187_sage-maxima_lisp.patch.gz

I've added a patch for sage-maxima.lisp as trac_10187_sage-maxima_lisp.patch.

To summarize, you need to

  1. Apply trac_10187_sage-maxima_lisp.patch to SAGE_LOCAL/bin
  2. http://boxen.math.washington.edu/home/kirkby/patches/ecl-10.4.1.spkg
  3. http://www.stp.dias.ie/~vbraun/Sage/spkg/maxima-5.22.1.spkg
  4. Apply trac_10187_fix_easy_doctests.patch to the sage library
  5. Apply trac_10187_general_display_prefix_workaround.patch to the sage library

Its true, but completely pointless, that some doctests pass without some of these patches. Maxima's error reporting changed and we cannot use the old parser any more. Read this ticket for details.

vbraun commented 13 years ago

Changed work issues from new interface patch needs help to none

kcrisman commented 13 years ago
comment:39

Okay, after running all (not long) doctests, I get the following error in addition to the taylor error above, on Mac OS X 10.6, applied to a brand-new Sage 4.6.1.alpha1 build:


sage -t  devel/sage/sage/plot/plot3d/transform.pyx
**********************************************************************
File "/Users/.../sage-4.6.1.alpha1/devel/sage-main/sage/plot/plot3d/transform.pyx", line 217:
    sage: m
Expected:
    [                                       -(cos(theta) - 1)*x^2 + cos(theta)              -(cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*x + sin(theta)*abs(z)      -((cos(theta) - 1)*x*z^2 + sqrt(-x^2 - z^2 + 1)*sin(theta)*abs(z))/z]
    [             -(cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*x - sin(theta)*abs(z)                           (cos(theta) - 1)*x^2 + (cos(theta) - 1)*z^2 + 1 -((cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*z*abs(z) - x*z*sin(theta))/abs(z)]
    [     -((cos(theta) - 1)*x*z^2 - sqrt(-x^2 - z^2 + 1)*sin(theta)*abs(z))/z -((cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*z*abs(z) + x*z*sin(theta))/abs(z)                                        -(cos(theta) - 1)*z^2 + cos(theta)]
Got:
    [                                       -(cos(theta) - 1)*x^2 + cos(theta)              -(cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*x + abs(z)*sin(theta)      -((cos(theta) - 1)*x*z^2 + sqrt(-x^2 - z^2 + 1)*abs(z)*sin(theta))/z]
    [             -(cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*x - abs(z)*sin(theta)                           (cos(theta) - 1)*x^2 + (cos(theta) - 1)*z^2 + 1 -((cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*z*abs(z) - x*z*sin(theta))/abs(z)]
    [     -((cos(theta) - 1)*x*z^2 - sqrt(-x^2 - z^2 + 1)*abs(z)*sin(theta))/z -((cos(theta) - 1)*sqrt(-x^2 - z^2 + 1)*z*abs(z) + x*z*sin(theta))/abs(z)                                        -(cos(theta) - 1)*z^2 + cos(theta)]
**********************************************************************

There are several transpositions of abs(z)*sin(theta) in this one, just like the transposition of psi(1, 1/3)*log(3) in the other error.

I get


sage: sage.calculus.calculus.maxima.eval('taylor(gamma(1/3+x),x,0,3)')
'gamma(1/3)-(6*%gamma+%pi*sqrt(3)+9*log(3))*gamma(1/3)*x/6+(12*%gamma^2+(4*%pi*sqrt(3)+36*log(3))*%gamma+6*log(3)*%pi*sqrt(3)+%pi^2+27*log(3)^2+12*psi[1](1/3))*gamma(1/3)*x^2/24+(72*gamma(1/3)*psi[2](1/3)+(-72*%gamma^3+(-36*%pi*sqrt(3)-324*log(3))*%gamma^2+(-108*log(3)*%pi*sqrt(3)-18*%pi^2-486*log(3)^2-216*psi[1](1/3))*%gamma+(-%pi^3+(-81*log(3)^2-36*psi[1](1/3))*%pi)*sqrt(3)-27*log(3)*%pi^2-243*log(3)^3-324*psi[1](1/3)*log(3))*gamma(1/3))*x^3/432'

which looks like the 'expected' line. I also get

sage: psi(1,1/3)*log(3)
log(3)*psi(1, 1/3)

which perhaps is the issue. What do people who do not have problems with this doctest get for this? (If the same for Maxima, but different for Sage, maybe it's a platform-dependent Pynac issue ... why on earth would that happen?)

vbraun commented 13 years ago
comment:40

Can you double-check that the maxima binary works? you should get:

[vbraun@volker-two ~]$ sage -sh

Starting subshell with Sage environment variables set.
Be sure to exit when you are done and do not do anything
with other copies of Sage!

Bypassing shell configuration files ...

SAGE_ROOT=/home/vbraun/Sage/sage
(sage subshell) volker-two:~ vbraun$ maxima
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/cmp.fas"
;;; Loading #P"/home/vbraun/Sage/sage/local/lib/ecl/sysfun.lsp"
Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp ECL 10.4.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) display2d : false;

(%o1) false
(%i2) psi(1,1/3)*log(3);

(%o2) psi(1,1/3)*log(3)
kcrisman commented 13 years ago
comment:41

RReplying to @vbraun:

Can you double-check that the maxima binary works? you should get:

I'm not sure how it could have passed tests without working :) but yes, it works on OS X 10.6. From command line, from sage -sh, from maxima_console, etc.

On 10.4 it also works once I add in the script change, and I'm currently running doctests. It is even slower than before, but so far it does seem to be working. Just FYI that on that platform testing sage/interfaces/maxima.py has no point, because of the (unrelated, I think) #9361.

Putting to needs work because of this weird multiplication issue.

vbraun commented 13 years ago
comment:42

yes, it works on OS X 10.6.

Does maxima return psi(1,1/3)*log(3) in this order or in the reversed order?

kcrisman commented 13 years ago
comment:43

Replying to @vbraun:

yes, it works on OS X 10.6.

Does maxima return psi(1,1/3)*log(3) in this order or in the reversed order?

I already reverted ... but as far as I recall, it was Sage itself that reversed this, as in comment 39, and in straight Maxima I got what you did.

Sorry, put to wrong thing before - needs work because of this, or needs info if you like.

vbraun commented 13 years ago
comment:44

I'm still confused what, if any, issue remains. This patch only touches the capture of the whole maxima output string, and not the parsing of expression. If maxima's output ordering has not changed yet some platform returns a different output sort order then this is an unrelated bug in the maxima interface.

kcrisman commented 13 years ago
comment:46

Dan, thanks for that confirmation of the issue.

Replying to @vbraun:

I'm still confused what, if any, issue remains. This patch only touches the capture of the whole maxima output string, and not the parsing of expression. If maxima's output ordering has not changed yet some platform returns a different output sort order then this is an unrelated bug in the maxima interface.

Actually, I'm pretty sure it's an unrelated bug in something else. At first I thought Pynac/Ginac, but maybe not (?) - in Sage 4.6 on PPC, I get

sage: psi(1,1/3)*log(3)
log(3)*psi(1, 1/3)
sage: from sage.misc.citation import get_systems
sage: get_systems('psi(1,1/3)*log(3)')
['GMP']

This machine doesn't have the new Maxima, so it's definitely unrelated.

Nonetheless, we can't ship a Sage with a failing doctest that we know about, except at great need - this is why I put needs work. The very minor change in how Maxima grouped the coefficient of x^3 created this.

So I recommend that we replace this doctest with something very similar which doesn't have this problem, and then open a new ticket for this issue. Maybe something like

sage: taylor(gamma(1/4+x),x,0,3)

except I can't tell you what the Mac output is on this until tomorrow - maybe someone else can.

The new ticket is #10282.

jpflori commented 13 years ago
comment:47

I installed Sage on a Mac:

Machine Name: Power Mac G5

  Machine Model: PowerMac11,2

  CPU Type: PowerPC G5 (1.1)

with Mac OS X:

  System Version: Mac OS X 10.4.11 (8S165)

  Kernel Version: Darwin 8.11.0

from binary packages:

http://www.sagemath.org/download-mac.html

and using cp -R - A ... to a custom directory because I don't have admin rights.

So I got Sage 4.6.

I ran Sage once.

I then patched sage_scripts (downloaded spkg, uncompressed, hg qimport patch, hg qpush) and installed it.

I installed ecl-10.4 and maxima5.22.1 spkgs.

I ran ./sage -b but got problem of paths, it was looking in /Users/Shared/sage/sage-4.6/ ...

So I moved my installation folder there and ./sage -b worked.

I then ran ./sage -t  -long -force_lib devel/sage/sage/interfaces/maxima.py

and everything was fine:

init.sage does not exist ... creating
sage -t -long -force_lib "devel/sage/sage/interfaces/maxima.py"
         [53.8 s]

----------------------------------------------------------------------
All tests passed!
Total time for all tests: 53.8 seconds

I'll try to test on a SPARC machine with Solaris 10 soon.