sagemath / sage

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

Upgrade ECL to 12.12.1 and let it build on (recent) Cygwins #13324

Closed jpflori closed 11 years ago

jpflori commented 12 years ago

On my 1.7.16 installation of Cygwin, the ecl spkg does not build because it defines unconditionaly _WINSOCKAPI_ in h/ecl-cmp.h which then prevents the definition of fd_set in /usr/include/sys/types.h. I guess this is harmless on Linux, intended on Windows, but on Cygwin this breaks the build of ECL.

The proposed spkg patches h/ecl-cmp.h so that _WINSOCKAPI_ is not defined on CYGWIN. This has been merged upstream and is in 12.12.1: https://sourceforge.net/p/ecls/ecl/ci/07c4ab7db83eda2eed7fa4a5ddeec2e28c7eb58b/

Moreover comes patches from upstream to get correct signal handling and is in 12.12.1:

We build ECL single threaded to get hopefully more correct signal handling in library mode and avoid problems with the pexpect interface.

And a later patch to avoid infinite loops while compiling lisp to C: http://sourceforge.net/p/ecls/ecl/ci/13459a98f0c0c58ccc4e9241c3bf0625e39f2383/

Older patches which are now upstream have been removed.

Be sure to use Sage 5.6.beta2 or higher, so that the Maxima spkg is ready for this.

Try spkg at http://boxen.math.washington.edu/home/jpflori/ecl-12.12.1.p0.spkg

Apply:

Depends on #13860

Upstream: Fixed upstream, but not in a stable release.

CC: @kiwifb

Component: porting: Cygwin

Keywords: cygwin ecl spkg

Author: Jean-Pierre Flori

Reviewer: François Bissey, Karl-Dieter Crisman, Dmitrii Pasechnik

Merged: sage-5.7.beta0

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

jpflori commented 11 years ago
comment:44

Ok, as expected we still get the lisp.py issue.

jpflori commented 11 years ago
comment:45

Hummm, in the above examples, Sage does not really gets stucky, after a long time (let's say 10 minutes, not really sure) the tests go on.

jpflori commented 11 years ago
comment:46

And I just realized ECL is built with threads enabled.

jpflori commented 11 years ago

Changed work issues from fix lisp.py issue to none

jpflori commented 11 years ago
comment:47

And tada, with the single threaded interface, I still got no problems with lisp.py, I guess it gave bad interaction with pexpect. New spkg at same address.

jpflori commented 11 years ago

Description changed:

--- 
+++ 
@@ -10,9 +10,11 @@
 * http://sourceforge.net/p/ecls/ecl/ci/15033d5a8ad7297e5f76e2e70446b0eea2f2d2a7/
 * http://sourceforge.net/p/ecls/ecl/ci/ec1fe8781a5f137284cc6c0d0cfa6b0cc9b9b291/

+We build ECL single threaded to get hopefully more correct signal handling in library mode and avoid problems with the pexpect interface.
+
 Try spkg at
 http://boxen.math.washington.edu/home/jpflori/ecl-12.7.1.p0.spkg
 which includes upstream version 12.7.1 and the above fixes.

 Apply:
-* [attachment: trac_1334.patch](https://github.com/sagemath/sage/files/ticket13324/trac_1334.patch.gz).
+* [attachment: trac_13324.patch](https://github.com/sagemath/sage-prod/files/10656101/trac_13324.patch.gz).
kcrisman commented 11 years ago
comment:49

I'm getting to work earlier tomorrow, I'll try to set up an XP Cygwin build and test this - may not have feedback for several days, though!

jpflori commented 11 years ago
comment:50

Replying to @kcrisman:

I'm getting to work earlier tomorrow, I'll try to set up an XP Cygwin build and test this - may not have feedback for several days, though!

Thanks, that's great.

Nonetheless the new patches should not influence the spkg on Cygwin, so your and my previous tests are still valid for Cygwin. I'll be working on the remaining issue this week end hopefully (#9167) and propose patches upstream.

The important thing to test is the timeout problems and this now looks fine. It passed make ptestlong on two different Linux x86_64 Debian and Ubuntu for me and stressful testing of the previous problematic files.

So I guess that if someone thinks that the changes are ok, with minimal additional testing, we can put this as positive_review and let the patchbot make their work (or rather the release manager, as it seems spkg are not tested by patchbot, am I wrong?).

kcrisman commented 11 years ago
comment:51

I see, I didn't read the emails carefully and thought there was something significant.

I have an ecl-12.7.1.p1 here. where did that come from? Anyway, I'll just ./sage -f this spkg and apply the patch and see what happens!

jpflori commented 11 years ago
comment:52

Replying to @kcrisman:

I see, I didn't read the emails carefully and thought there was something significant.

I have an ecl-12.7.1.p1 here. where did that come from? Anyway, I'll just ./sage -f this spkg and apply the patch and see what happens!

This spkg is an old spkg from #9167 and is not up to date with the one here and should be rebased once the one here gets positive review. Indeed, the one here does not contain the fixes in the one from #9167 and I don't plan to do so because the changes there still need some work.

Anyway these fixes at #9167 are not needed to build Sage on Cygwin, they are needed to be able to import maxima in Sage. The fixes here let Sage build on Cygwin and prevent signal problems with the updated ECL.

kcrisman commented 11 years ago
comment:53

Well, it builds but I get all sorts of forking errors when I test the two files in question. Of course, that probably happened before as well!

jpflori commented 11 years ago
comment:54

I don't think I mentioned it here but the bug page upstream was http://sourceforge.net/p/ecls/bugs/216/

To produce a completely correct library would need http://sourceforge.net/p/ecls/bugs/222/ but that might be done in a follow up ticket.

The spgk here fulfill its purpose (in fact more than what originally planned):

So I guess it should be integrated asap.

kcrisman commented 11 years ago
comment:55

I agree. What testing and/or review do you think is still needed? This does build fine on Cygwin on XP, and Maxima builds with it.

kcrisman commented 11 years ago
comment:56

I can't do much else without #9167, of course, in terms of testing. But what needs to be done here? A look at the spkg, the patches (which seems okay) and testing that Maxima still works right on Linux and Mac, at least, with this, right?

jpflori commented 11 years ago
comment:57

I guess that's all indeed.

jpflori commented 11 years ago
comment:58

(FYI I've tested this extensively on Linux (Debian and Ubuntu).)

jpflori commented 11 years ago
comment:59

For info, ECL 12.12.1 which includes the fixes needed here (and much more) was released: http://sourceforge.net/mailarchive/forum.php?thread_name=10634799-3AE2-408D-94F5-5F96A38E60B6%40gmail.com&forum_name=ecls-list

jpflori commented 11 years ago
comment:60

Tentative updated spkg at http://boxen.math.washington.edu/home/jpflori/ecl-12.12.1.p0.spkg

I guess it would be more sensible to get this new spkg into Sage. On the Sage side, the only changes are that I removed the two patches backported for 12.7.1.

jpflori commented 11 years ago

Description changed:

--- 
+++ 
@@ -16,5 +16,8 @@
 http://boxen.math.washington.edu/home/jpflori/ecl-12.7.1.p0.spkg
 which includes upstream version 12.7.1 and the above fixes.

+Or rather use the spkg including the newly released ECL:
+http://boxen.math.washington.edu/home/jpflori/ecl-12.12.1.p0.spkg
+
 Apply:
 * [attachment: trac_13324.patch](https://github.com/sagemath/sage-prod/files/10656101/trac_13324.patch.gz).
jpflori commented 11 years ago
comment:61

I'll also remove the old stat.h fix which is upstream for some time now: http://sourceforge.net/p/ecls/ecl/ci/d3e59164d0e1da1a5a591b3e6a251db1c428b223/

jpflori commented 11 years ago
comment:62

Updated spkg and diff uploaded. Not tested yet.

kcrisman commented 11 years ago
comment:63
=== ecl-12.7.1.p0 (Jean-Pierre Flori, 10 December 2012) === 

I think there is a typo there.

jpflori commented 11 years ago
comment:64

Indeed, corrected spkg uploaded. I just posted a diff for the previous version of ECL. The right one is coming.

jpflori commented 11 years ago
comment:65

There is a small problem with the current 12.12.1 spkg because the patch directory is empty.

jpflori commented 11 years ago
comment:66

I seem to have problem compiling SLATEC:DBESJ in Maxima with both spkg posted here.

jpflori commented 11 years ago
comment:67

No such problem on Linux, so it might be a Cygwin problem. It reminds me of the fact that for some of my attempts I had to rebase during the build of Maxima to be able to finish the build.

jpflori commented 11 years ago
comment:68

But that does not seem to be the case here.

jpflori commented 11 years ago
comment:69

Oops, and I just realized I'm configuring ECL with no assembly everywhere.

kcrisman commented 11 years ago
comment:70

Oops, and I just realized I'm configuring ECL with no assembly everywhere.

I assume that means "needs work" for now... Just let me know when you have something to be tested, and I'll try it out again.

jpflori commented 11 years ago
comment:71

Yes that means needs work... But I think you can already test the updated spkg, a priori, there won't be anything drastically different with ffi added (from the Sage point of view at least; unless you happen to have the problematic system the fix was meant for).

kcrisman commented 11 years ago
comment:72

Oh, I see what you mean! I was thinking it was something else, but you mean that in attachment: ecl-12.7.1.p0.diff you have the same configure options in both cases, but need to remove --with-dffi=no from the else clause?

jpflori commented 11 years ago
comment:73

Exactly!

kcrisman commented 11 years ago
comment:74

In any case I got some weird rebase problem when I did this - ECL installed fine, but Maxima refused to build due to memory not accessible things. Now I'm trying to rebase but having trouble getting find to find anything other than stuff in the SAGE_ROOT directory, it's like it's not looking in SAGE_LOCAL/lib...

jpflori commented 11 years ago

Description changed:

--- 
+++ 
@@ -16,8 +16,9 @@
 http://boxen.math.washington.edu/home/jpflori/ecl-12.7.1.p0.spkg
 which includes upstream version 12.7.1 and the above fixes.

-Or rather use the spkg including the newly released ECL:
+The following spkg includes a more recently released ECL:
 http://boxen.math.washington.edu/home/jpflori/ecl-12.12.1.p0.spkg
+Although there seems to be problem with this one to build Maxima.

 Apply:
 * [attachment: trac_13324.patch](https://github.com/sagemath/sage-prod/files/10656101/trac_13324.patch.gz).
jpflori commented 11 years ago
comment:75

I also had rebase problems once when building Maxima, this was quite horrible to deal with. I had to let it fail, rebase and restart from where it failed.

And now I found something more problematic, Maxima does not seem to build as a library on my Linux system with the 12.12.1 version. And the Maxima spkg does not detect that (although there should be code to detect this), if confirmed, this should go on another trac ticket.

jpflori commented 11 years ago

Work Issues: correct options passed to configure

kcrisman commented 11 years ago
comment:76

This sounds like my problem, though of course I didn't get far enough to see the no library thing. If that is the case, we should definitely just use the (--with-dffi=no fixed) 12.7.1 spkg. The perfect is the enemy of the sufficient. Let me know when you have that (as my tar seems to be causing trouble) and I should be able to review it next week.

jpflori commented 11 years ago
comment:77

I think the library is not missing but its name changed from maxima.fasb to maxima-system.fasb, potentially due to an upgraded ASDF. Seen from Sage, this "new" file seems to work just as well. I don't really know this stuff, so I've asked upstream for confirmation.

Anyway, I'm recrafting cleaner 12.7.1 AND 12.12.1 spkgs.

dimpase commented 11 years ago
comment:78

Replying to @jpflori:

I think the library is not missing but its name changed from maxima.fasb to maxima-system.fasb, potentially due to an upgraded ASDF. Seen from Sage, this "new" file seems to work just as well. I don't really know this stuff, so I've asked upstream for confirmation.

Anyway, I'm recrafting cleaner 12.7.1 AND 12.12.1 spkgs.

why won't we concentrate on 12.12.1?

jpflori commented 11 years ago
comment:79

I am, it is just I'm also giving away something which definitely looks right (apart from the stupid dffi things I had no problem at all with 12.7.1, except that recently I can no longer build Maxima on Cygwin, but that might be something else) as well in case other concerns appear with 12.12.1.

kcrisman commented 11 years ago
comment:80

I am, it is just I'm also giving away something which definitely looks right (apart from the stupid dffi things I had no problem at all with 12.7.1, except that recently I can no longer build Maxima on Cygwin, but that might be something else) as well in case other concerns appear with 12.12.1.

Well anyway, whichever one you come up with within the next 7 hours or so I can try to get set up for a weekend build (Windoze only at work, a poor orphaned computer no one wanted...)

kcrisman commented 11 years ago
comment:81

I am, it is just I'm also giving away something which definitely looks right (apart from the stupid dffi things I had no problem at all with 12.7.1, except that recently I can no longer build Maxima on Cygwin, but that might be something else) as well in case other concerns appear with 12.12.1.

After (finally) a successful rebase I can only build Maxima with 12.7.1 (in this case the p1 spkg from #9167, but whatever), so maybe this is the wiser option currently. Especially if we can quickly get #9167 ready based on something here, that would be ideal; it's wonderful to not have that be an issue soon.

jpflori commented 11 years ago
comment:82

What fails exactly with 12.12.1 and Maxima?

jpflori commented 11 years ago
comment:83

Oh I guess that if the same thing as on Linux happens, then the compile ecl file is not copied but the error not caught.

So more precisely, does the spkg build fails? or does it seem to be ok, but you cannot import maxima then?

kcrisman commented 11 years ago
comment:84

So more precisely, does the spkg build fails? or does it seem to be ok, but you cannot import maxima then?

Precisely what happens is that it raises an error that smells of needing rebasing, and drops me into an interactive (ECL, I think) terminal for whether I want to continue compiling, does that a few times, and then just plain old fails, again smelling of needing a rebase. But the rebase doesn't help.

I'll try it all again just now, now that I confirmed I can get it working again by going back to the old (well, 12.7.1) ECL, rebasing, then doing sage -f maxima. I should be able to report back in about 15-20 minutes...

kcrisman commented 11 years ago
comment:85

This is after installing the 12.12.1 ECL and then immediately rebasing:

Summary:
ECL enabled. Executable name: "ecl"
default lisp: ecl
wish executable name: "wish"

Now building Maxima...
Making all in admin
make[1]: Entering directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/admin'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/admin'
Making all in src
make[1]: Entering directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
test -d binary-ecl || mkdir binary-ecl
ecl -norc -eval '(progn (load "../lisp-utils/defsystem.lisp") (load "../lisp-utils/make-depends.lisp") (funcall (intern "CREATE-DEPENDENCY-FILE" :mk) "binary-ecl/maxima" "ecl-depends.mk") (quit))'
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/../lisp-utils/defsystem.lisp"
;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/cmp.fas"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/../lisp-utils/make-depends.lisp"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima.system"
 cd .. && /bin/sh /home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/missing --run automake-1.9 --gnu  src/Makefile
/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/missing: line 52: automake-1.9: command not found
WARNING: `automake-1.9' is missing on your system.  You should only need it if
         you modified `Makefile.am', `acinclude.m4' or `configure.in'.
         You might want to install the `Automake' and `Perl' packages.
         Grab them from any GNU archive site.
 cd .. && /bin/sh ./config.status src/Makefile
config.status: creating src/Makefile
make[1]: Leaving directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
make[1]: Entering directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
../admin/make_share_list
test -d binary-ecl || mkdir binary-ecl
ecl -norc -eval '(progn (load "../lisp-utils/defsystem.lisp") (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :compile :verbose t) (build-maxima-lib))' -eval '(ext:quit)'
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/../lisp-utils/defsystem.lisp"
;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/cmp.fas"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima.system"

;  - Compiling defsystem "maxima"
;    - Compiling module "package"
;      - Compiling source file
;        "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima-package.lisp"
;;;
;;; Compiling /home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima-package.lisp.
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=2
;;;
;;; End of Pass 1.
;;; Finished compiling /home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima-package.lisp.
;;;

;      - Loading binary file "binary-ecl/maxima-package.fas"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/binary-ecl/maxima-package.fas"

Condition of type: SEGMENTATION-VIOLATION
Detected access to an invalid or protected memory address.
Available restarts:

1. (CONTINUE) Ignore signal
2. (CONTINUE) Ignore initialization errors and continue.
3. (ABORT) Quit ECL unsafely, ignoring all existing threads.

Top level.
>

(I didn't include the configuration stuff.)

I couldn't get out of the debugger with 1 or 2 and so I just did Ctrl-D, which led to a lot more stuff, then

make[1]: Entering directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
../admin/make_share_list
test -d binary-ecl || mkdir binary-ecl
ecl -norc -eval '(progn (load "../lisp-utils/defsystem.lisp") (funcall (intern (symbol-name :operate-on-system) :mk) "maxima" :compile :verbose t) (build-maxima-lib))' -eval '(ext:quit)'
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/../lisp-utils/defsystem.lisp"
;;; Loading #P"/home/newsagetest/sage-5.5.rc0/local/lib/ecl/cmp.fas"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/maxima.system"

;  - Compiling defsystem "maxima"
;    - Compiling module "package"
;      - Loading binary file "binary-ecl/maxima-package.fas"
;;; Loading "/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src/binary-ecl/maxima-package.fas"

Condition of type: SEGMENTATION-VIOLATION
Detected access to an invalid or protected memory address.
Available restarts:

1. (CONTINUE) Ignore signal
2. (CONTINUE) Ignore initialization errors and continue.
3. (ABORT) Quit ECL unsafely, ignoring all existing threads.

Top level.
>

and after Ctrl-D again,

make[2]: Entering directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
test -z "/home/newsagetest/sage-5.5.rc0/local/bin" || mkdir -p -- "/home/newsagetest/sage-5.5.rc0/local/bin"
 /usr/bin/install -c 'maxima' '/home/newsagetest/sage-5.5.rc0/local/bin/maxima'
 /usr/bin/install -c 'maxima-command.ico' '/home/newsagetest/sage-5.5.rc0/local/bin/maxima-command.ico'
 /usr/bin/install -c 'maxima.bat' '/home/newsagetest/sage-5.5.rc0/local/bin/maxima.bat'
 /usr/bin/install -c 'set_lang.vbs' '/home/newsagetest/sage-5.5.rc0/local/bin/set_lang.vbs'
/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/install-sh -d "/home/newsagetest/sage-5.5.rc0/local/lib/maxima/5.26.0/binary-ecl"
/usr/bin/install -c binary-ecl/maxima "/home/newsagetest/sage-5.5.rc0/local/lib/maxima/5.26.0/binary-ecl/maxima"
/usr/bin/install: cannot stat `binary-ecl/maxima': No such file or directory
Makefile:3088: recipe for target `install-ecl' failed
make[2]: *** [install-ecl] Error 1
make[2]: Leaving directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
Makefile:676: recipe for target `install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/newsagetest/sage-5.5.rc0/spkg/build/maxima-5.26.0.p0/src/src'
Makefile:320: recipe for target `install-recursive' failed
make: *** [install-recursive] Error 1
***********************************************************
Error: Failed to install Maxima.
***********************************************************

real    7m38.501s
user    1m58.201s
sys     1m37.148s
************************************************************************
Error installing package maxima-5.26.0.p0
************************************************************************

I have no idea why, especially since rebasing seems to have nothing to do with it even though there is this inaccessible comment. There is indeed a maxima-package.{fas,o} in the build directory in src/src/binary-ecl, but I don't see any maxima-system. Is this similar to the problem you had? And if you have an idea on how to continue in the ECL debugger, that would be great - probably that is part of my problem...

kcrisman commented 11 years ago

Changed reviewer from François Bissey to François Bissey, Karl-Dieter Crisman

jpflori commented 11 years ago
comment:86

That looks very scary and completely different from what I get.

I think that in my case (on Cygwin, not on Linux where the problem looks different and much easier to solve), the compilation goes much further.

jpflori commented 11 years ago

Changed work issues from correct options passed to configure to none

jpflori commented 11 years ago
comment:87

Ok here comes an updated 12.7.1 spkg. It should be fine although I'm not sure anymore it properly compiles on my Cygwin.

We can postpone 12.12.1 to another ticket if it looks even more problematic.