New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libGAP! -- create a Cython library interface to gap #6391
Comments
comment:1
To try out the first demo libgap.a use of GAP as a library:
Then
|
comment:2
Before the above, be sure to do
|
comment:3
Attachment: trac_6391-part2.patch.gz Make sure to use the latest spkg, which I'll keep in the ticket description. |
This comment has been minimized.
This comment has been minimized.
Attachment: trac_6391-part3-error_handling.patch.gz |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Attachment: trac_6391-part4.patch.gz |
This comment has been minimized.
This comment has been minimized.
Attachment: trac_6391-part1.patch.gz |
This comment has been minimized.
This comment has been minimized.
comment:9
This log pretty much explains what/why/what next:
|
comment:10
Overview:
To rebuild:
If you change gap.pyx, do |
comment:14
I get an error when importing libgap on sage 4.3.5 on OSX 10.6.3:
The cached_function decorator works at the interpreter level so I really do not see what is happening. When the line is removed the import works fine and from what I understand about cache_function this should be okay.
|
This comment has been minimized.
This comment has been minimized.
comment:19
Replying to @sagetrac-davidm:
I see exactly the same with the new spkg on OSX 10.6. |
comment:20
Replying to @dimpase:
moreover, I get the same problem (and solition(?)) on Linux (on boxen). So this is certainly not OSX-specific. |
Attachment: 6391.6.patch.gz cumulative patch for sage 4.6.1 |
comment:21
Replying to @dimpase:
it turns out that cached_function won't work in Cython at all, so indeed this needs to be changed. To install for Sage 4.6.1, install the updated spkg, and this patch. Dima |
comment:22
Perhaps someone who understands libs/gap/gap.pyx better than me can comment on few sticking points I encounter: class Gap(ParentWithBase) is instantiated only once, for base=ZZ. Is it meant that it should be instantiated for other bases, too? And if so, which ones? (I must say it's very puzzling to me piece of code...) in the class GapElement, What |
comment:23
Replying to @dimpase:
No, only once for base=ZZ.
Yes. I don't know if GAP uses "interrupts" though. You are basically above asking: "Here is a problem nobody has solved yet, which is why libgap hasn't moved forward. What is the solution?"
See {{dealloc}} at http://docs.cython.org/src/reference/extension_types.html for the definition of dealloc. It is like |
comment:24
Replying to @williamstein:
From printing contents of the GAP interpreter output_buffer (introduced in the patch of GAP's scanner.c), I see that during the fatal a.div(g.libgap('0'))_ it starts getting the contents of the usual GAP error message, like Entering break read-eval-print loop (i.e. it does a "GAP interrupt"). And then the crash happens in the Python interpreter. So I suppose more reverse engineering/understanding of the GAP interpreter is needed here, in order to avoid replicating it in Python... |
comment:25
I updated the patch to work with Sage-4.7.alpha1. I also added a bunch of doctests while trying to understand what is going on and replaced the deprecated I'll be doing some more work on libgap during Sage Days 29, so let me know if you have any suggestions. |
comment:148
So the only hope for my project is to rewrite kbmag to be able to communicate with shared libraries? I am afraid that is way beyond my skills now. Anyways, if you can help me a little bit i can try to learn about it. |
comment:149
I don't think you need to do anything with shared libraries. As far as I can see, the package communicates with external stand-alone executables via Anyway, if you can't get the Grep for |
comment:150
How hard would it be to make Gap's Exec work through libgap? |
comment:151
If
There is a segfault when returning the result, I'll fix that in another ticket (maybe #13588). How did you install |
comment:152
Replying to @vbraun:
the googledocs link above will give you the spkg... Or, perhaps, even easier, a bitbucket or github account. |
comment:153
And open a ticket to make kbmag an experimental spkg so we have a place to discuss it. This issue is really done so nobody should post to it. |
comment:154
I have opened #13673. |
comment:155
Thanks for this great contribution! I just want to mention a problem with the assertion `strlen(libGAP_stdin_buffer) < length' which
|
comment:156
Will be done in #13588 |
comment:158
Now that it seems that gap upgrading has moved to 4.5.7, will this need to change? |
comment:159
Indeed, the actual version of libgap is incompatible with the gap-4.5.7 spkg:
|
comment:160
Replying to @miguelmarco:
SPKG.txt contains brief instructions about upgrading. You'll need to increase the version and rerun autotools to produce new spkg. I never tried this myself though. |
comment:161
I'm working on it. |
comment:162
Replying to @vbraun:
I've built the new package from your bitbucket repo, and it at least installs OK. |
comment:163
Replying to @dimpase:
http://boxen.math.washington.edu/home/dima/packages/libgap-4.5.7.p1.spkg It also passes the tests in To create the package on MacOSX, I had to install |
comment:165
So the patches to the sage library and the root repository should be moved to #13588, right? I am techically unable to review the code, all i can do is test it and report. |
comment:166
Yes, I've moved the patches from here to #13588 to make Jeroen's life easier. |
Changed author from Dima Pasechnik, Ivan Andrus, Volker Braun, William Stein to none |
Changed reviewer from Dima Pasechnik, Ivan Andrus, Volker Braun, William Stein to Dmitrii Pasechnik, Ivan Andrus, Volker Braun, William Stein |
There's libSingular, there's libPari, and next we need to create libGAP.
To try it out,
Code in
sage/libs/gap/test/
demonstrates an interface tolibgap
from C.Depends on #13415
Depends on #13123
Depends on #13211
CC: @burcin @sagetrac-nborie @robertwb @sagetrac-jeremywest @gvol @sagetrac-davidm @kini @kcrisman @nthiery @jpflori @simon-king-jena
Component: group theory
Reviewer: Dmitrii Pasechnik, Ivan Andrus, Volker Braun, William Stein
Issue created by migration from https://trac.sagemath.org/ticket/6391
The text was updated successfully, but these errors were encountered: