Install GAP Packages in SAGE 8.9

527 Views Asked by At

I'm running SageMath 8.9 on Windows 10. I'd like to run the following code:

gap.eval('LoadPackage("grape")')
gap.eval("n := 5")
gap.eval("grp := Group([ (1,2,3,4,5), (1,2,4,3) ])")
gap.eval("Der := []; for x in grp do if NrMovedPoints(x)=n then AddSet(Der,x); fi; od;")
gap.eval("Cay := CayleyGraph(grp, Der)")

This raises a RuntimeError. When I run:

from sage.features.gap import GapPackage
GapPackage("grape", spkg="gap_packages").is_present()

It indicates that 'grape' is not available. So I'd like to install it; however, with some searching online I encounter commands like:

sage -i gap_packages

But this does not work as 'sage' is not added to PATH (and I don't know how to do that).

Now I have GAP 4.10.2 installed independently of Sage, which does have 'grape' installed. If I can't install grape into sage, how can I direct Sage to look at another installation of GAP? I tried this (from here):

import sage.interfaces.gap
sage.interfaces.gap.gap_cmd = "/usr/local/bin/gap"

Where I changed "/usr/local/bin/gap" to "C:/gap-4.10.2/bin/gap.bat", which is how I normally launch GAP. It did not work.

Note: I've read the solutions here, but it doesn't work for me (as I mentioned above). That user seems to have been running OSX, where I'm running Windows 10. Also, the question is 7 years old, and perhaps the method is obsolete. Other methods online (such as found here) seem to have become obsolete. I can't find anything recent (regarding Sage version 8.9 on Windows).

Any help on this would be greatly appreciated!

1

There are 1 best solutions below

0
On

If you can get a terminal prompt, you might be able to run ./sage -i gap_packages while in the sage root directory (this preempts the need to add sage to your PATH). I don't use Sage on Windows though, so I'm not sure if this will work.

Another approach is that you can copy folders from the package folder of a functional gap installation into the appropriate place in your sage installation. You should copy the grape folder from $GAP_ROOT/pkg to $SAGE_ROOT/local/lib/gap/pkg/.