adding all gap packages

207 views
Skip to first unread message

multiscalar

unread,
Sep 10, 2016, 2:19:21 PM9/10/16
to sage-support
I just built sage-7.3 under Centos7. Everything seems to have worked well :
sage comes up fine and a few simple calculations work. The gap part on its won
also comes up and works with simple tests, but there are no packages included.

I'm now trying to add all the gap packages to the gap component. I tried to
follow the steps in :


The gap version in sage-7.3 is 4r8p3 which is one version older than the latest gap.
To play it safe I downloaded the version that matches sage and expanded it in a temporary
directory. I then started sage shell :

 sage -sh

and copied the contents of the "pkg" subdirectory from the temporary area to the sage
area (sage/local/gap/latest/pkg/....). I built a couple of the packages and that worked
fine. I then exited the sage shell.

Following the instructions I then called sage and typed :

gap_reset_workspace() 

I got a "WARNING : this should never happen" and it seems that sage got stuck somewhere.
Also calling the gap on its own shows that the package installation didn't work.

I think this shouldn't be too hard to fix, but I'm out of ideas.

Thanks for your help.

John Cremona

unread,
Sep 10, 2016, 2:46:33 PM9/10/16
to SAGE support
I just do "sage -i gap_packages" (and "sage -i database_gap") which sounds a lot simpler if it includes the packages you need.

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscribe@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

multiscalar

unread,
Sep 10, 2016, 4:46:52 PM9/10/16
to sage-support
Thanks, this is definitely simpler and it worked, but only about half of the packages I use are included. How would I add the other ones?
I think these days diskspace isn't much of an issue, it would be nice if there are similar commands to install all accepted packages.


On Saturday, September 10, 2016 at 11:46:33 AM UTC-7, John Cremona wrote:
I just do "sage -i gap_packages" (and "sage -i database_gap") which sounds a lot simpler if it includes the packages you need.
On 10 September 2016 at 18:36, multiscalar <multi...@gmail.com> wrote:
I just built sage-7.3 under Centos7. Everything seems to have worked well :
sage comes up fine and a few simple calculations work. The gap part on its won
also comes up and works with simple tests, but there are no packages included.

I'm now trying to add all the gap packages to the gap component. I tried to
follow the steps in :


The gap version in sage-7.3 is 4r8p3 which is one version older than the latest gap.
To play it safe I downloaded the version that matches sage and expanded it in a temporary
directory. I then started sage shell :

 sage -sh

and copied the contents of the "pkg" subdirectory from the temporary area to the sage
area (sage/local/gap/latest/pkg/....). I built a couple of the packages and that worked
fine. I then exited the sage shell.

Following the instructions I then called sage and typed :

gap_reset_workspace() 

I got a "WARNING : this should never happen" and it seems that sage got stuck somewhere.
Also calling the gap on its own shows that the package installation didn't work.

I think this shouldn't be too hard to fix, but I'm out of ideas.

Thanks for your help.

--
You received this message because you are subscribed to the Google Groups "sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-support...@googlegroups.com.

leif

unread,
Sep 10, 2016, 5:26:02 PM9/10/16
to sage-s...@googlegroups.com
multiscalar wrote:
> Thanks, this is definitely simpler and it worked, but only about half of
> the packages I use are included. How would I add the other ones?

Well, if you're a bit familiar with Sage / Python and the shell, take a
look at

build/pkgs/gap_packages/spkg-install (a shell script)

and

src/sage/interfaces/gap.py (especially gap_reset_workspace(), line
1486 ff.)


The wiki page you mentioned is probably outdated, as it was last updated
in 2013.


The first file above starts with

# WARNING -- if you add a package here, also add it to
# the gap_reset_workspace() command in
# <SAGE_ROOT>/src/sage/interfaces/gap.py

but AFAICS not all of the GAP packages from the current optional
gap_packages package are actually listed / treated there, no idea why.


Otherwise it *may* perhaps help to delete all old GAP workspaces (by
default in $HOME/.sage/gap/) *before* (re)starting Sage, then calling
gap_reset_workspace() again.

If I'm not mistaken, you could afterwards load the GAP packages you
want, before calling gap_reset_workspace() once again, in order to make
them part of your saved workspace.


HTH,

-leif


> I think these days diskspace isn't much of an issue, it would be nice if
> there are similar commands to install all accepted packages.
>
> On Saturday, September 10, 2016 at 11:46:33 AM UTC-7, John Cremona wrote:
>
> I just do "sage -i gap_packages" (and "sage -i database_gap") which
> sounds a lot simpler if it includes the packages you need.
>
> On 10 September 2016 at 18:36, multiscalar <multi...@gmail.com

Dima Pasechnik

unread,
Sep 10, 2016, 5:33:41 PM9/10/16
to sage-support
This is not a good idea to install all GAP packages, if you don't want to break your Sage install.
Not all GAP packages are compatible with libGAP (namely, ones that use GAP's dynamic loaded modules, e.g. IO); that is, installing them will break libGAP (and everything that uses it in Sage, which is quite a bit).


Once a GAP workspace with IO or another package like this is saved, it won't load properly into libGAP,
wrecking havoc...

On the other hand there are lots of GAP packages that are safe to install in this sense.

Dima

Dima Pasechnik

unread,
Sep 10, 2016, 5:41:35 PM9/10/16
to sage-support


On Saturday, September 10, 2016 at 9:26:02 PM UTC, leif wrote:
multiscalar wrote:
> Thanks, this is definitely simpler and it worked, but only about half of
> the packages I use are included. How would I add the other ones?

Well, if you're a bit familiar with Sage / Python and the shell, take a
look at

    build/pkgs/gap_packages/spkg-install (a shell script)

and

    src/sage/interfaces/gap.py (especially gap_reset_workspace(), line
1486 ff.)


The wiki page you mentioned is probably outdated, as it was last updated
in 2013.


The first file above starts with

# WARNING -- if you add a package here, also add it to
# the gap_reset_workspace() command in
#    <SAGE_ROOT>/src/sage/interfaces/gap.py

but AFAICS not all of the GAP packages from the current optional
gap_packages package are actually listed / treated there, no idea why.


Otherwise it *may* perhaps help to delete all old GAP workspaces (by
default in $HOME/.sage/gap/) *before* (re)starting Sage, then calling
gap_reset_workspace() again.

If I'm not mistaken, you could afterwards load the GAP packages you
want, before calling gap_reset_workspace() once again, in order to make
them part of your saved workspace.

there are GAP packages that break libGAP (see my other message in this thread), so you cannot allow a GAP workspace with them to be used by libGAP.

This probably can be fixed, or libGAP can be made compatible with them (although the latter is perpetuating what is basically a GAP fork).

Dima  

multiscalar

unread,
Sep 10, 2016, 6:07:29 PM9/10/16
to sage-support
How can I tell if the package I need is safe to add or not?
These are the ones I'd like to add for now : gbnp,sla,corelg,repsn; are these safe?
if they are, what's the recommended procedure with sage-7.3?

Dima Pasechnik

unread,
Sep 10, 2016, 6:31:37 PM9/10/16
to sage-support


On Saturday, September 10, 2016 at 10:07:29 PM UTC, multiscalar wrote:
How can I tell if the package I need is safe to add or not?
These are the ones I'd like to add for now : gbnp,sla,corelg,repsn; are these safe?
if they are, what's the recommended procedure with sage-7.3?
The culprit is GAP's LoadDynamicModule (functionality that uses compiled GAP kernel extensions), I think.
Anything that does not use it, e.g. just pure GAP code (not dependent on another package that
does use LoadDynamicModule), or GAP code calling standalone executables (like GRAPE does)
should be OK.

gbnp and repsn are OK, as it's just pure GAP code.
sla, corelg (and quagroup, a package they require) also look like pure GAP code.

To install them, follow the standard GAP procedure to install such a package, i.e. just unpack the corresponding
archive into pkg/ subdirectory of the GAP install---and GAP in Sage is installed in
SAGE_ROOT/local/gap/latest/

HTH,
Dima

multiscalar

unread,
Sep 10, 2016, 7:05:44 PM9/10/16
to sage-support
These four packages seem to be working fine now. I just copied their source (+quagroup) into the "pkg" directory.
I also had to issue gap_reset_workspace() in sage. I'll do more extensive tests later, but for now all these packages seem to be fine.
Thanks for your help.

leif

unread,
Sep 10, 2016, 7:06:04 PM9/10/16
to sage-s...@googlegroups.com
Dima Pasechnik wrote:
> # WARNING -- if you add a package here, also add it to
> # the gap_reset_workspace() command in
> # <SAGE_ROOT>/src/sage/interfaces/gap.py
>
> but AFAICS not all of the GAP packages from the current optional
> gap_packages package are actually listed / treated there, no idea why.
>
>
> Otherwise it *may* perhaps help to delete all old GAP workspaces (by
> default in $HOME/.sage/gap/) *before* (re)starting Sage, then calling
> gap_reset_workspace() again.
>
> If I'm not mistaken, you could afterwards load the GAP packages you
> want, before calling gap_reset_workspace() once again, in order to make
> them part of your saved workspace.
>
>
> there are GAP packages that break libGAP (see my other message in this
> thread), so you cannot allow a GAP workspace with them to be used by libGAP.

Well, both seem to have separate workspaces (workspace-XXX vs.
libgap-workspace-XXX, not always "in sync", i.e., not always both
present), so it should be possible to exclude "critical" GAP packages
from libGAP's.

With some effort, it would IMHO also be possible to even automatically
blacklist packages (completely, or just for use with libGAP).


-leif
Reply all
Reply to author
Forward
0 new messages