I realized that I ran sage: gap.eval('LoadAllPackages();') which broke libgap. For anyone else reading this, the following fixed the problem (taken from gap_reset_workspace, with sonata and guava removed due to "Warning: this should never happen" and braid removed because I don't have it installed):
g = Gap(use_workspace_cache=False, max_workspace_size=None) g.eval('SetUserPreference("HistoryMaxLines", 30)') for pkg in ['GAPDoc', 'ctbllib', 'factint', 'gapdoc', 'grape', 'design', 'toric', 'laguna']: g.load_package(pkg, verbose=True) g.save_workspace() g.quit() Thanks for the help Dima: my calculations are running smoothly again! David On Sat, Feb 17, 2018 at 12:57 AM, David Roe <roed.m...@gmail.com> wrote: > Thanks, that helps a lot. After some experimentation, it seems like > gap> LoadPackage("CRISP"); > is sufficient. > > However, when I try to do it from sage I get the following: > sage: gap.eval('LoadPackage("CRISP");') > Warning: this should never happen > > and sage hangs. Googling leads me to https://groups.google.com/ > forum/#!topic/sage-support/60HHHL8Bw_8, which I interpret as suggesting > that CRISP is using LoadDynamicModule. However, searching on > https://github.com/bh11/crisp, I don't see any calls to that function. > Is there something else that could be responsible? Is there a way to use > CRISP through gap.eval in Sage? > David > > On Fri, Feb 16, 2018 at 11:40 PM, Dima Pasechnik <dimp...@gmail.com> > wrote: > >> The problem is in the packages loaded (or not) by Sage's GAP vs by GAP's >> GAP. >> Namely, if I start Sage's gap by ./sage --gap >> and do >> gap> LoadAllPackages(); >> gap> NormalSubgroups(SmallGroup(1458,1180)); >> I'd get your error >> >> Now, if I take GAP's source for 4.8.6: >> https://www.gap-system.org/pub/gap/gap48/tar.bz2/gap4r8p6_ >> 2016_11_12-14_25.tar.bz2 >> untar it, and copy its pkg/ directory to $SAGEROOT/local/gap/latest/ >> start Sage's gap by ./sage --gap >> and do >> gap> LoadAllPackages(); >> gap> NormalSubgroups(SmallGroup(1458,1180)); >> [ <pc group of size 1458 with 7 generators>, Group([ f1, f2, f3^2*f4, f5, >> f6, f7 ]), Group([ f2, f3^2*f4, f4, f5, f6, f7 ]), >> Group([ f1, f3^2*f4, f4, f5, f6, f7 ]), Group([ f1, f2*f4*f6, f3^2*f4, >> f5, f6, f7 ]), Group([ f1, f2^2*f4*f6^2, f3^2*f4, f5, f6, f7 ]), >> Group([ f1, f3^2*f4, f5, f6, f7 ]), Group([ f3^2*f4, f4, f5, f6, f7 ]), >> Group([ f2*f4*f6, f3^2*f4, f5, f6, f7 ]), >> Group([ f2^2*f4*f6^2, f3^2*f4, f5, f6, f7 ]), Group([ f2, f3^2*f4, f5, >> f6, f7 ]), Group([ f1, f3^2*f4, f5*f6^2, f7 ]), Group([ f3^2*f4, f5, f6, f7 >> ]), >> Group([ f2*f3^2*f4, f3^2*f4^2, f5*f6^2, f6, f7 ]), Group([ f3^2*f4^2, >> f5*f6^2, f6, f7 ]), Group([ f2*f3*f6*f7, f5*f6^2, f6, f7 ]), >> Group([ f2^2*f4*f6^2, f5*f6^2, f6, f7 ]), Group([ f2*f3^2*f4, f5*f6^2, >> f6, f7 ]), Group([ f5*f6^2, f6, f7 ]), Group([ f3^2*f4, f5*f6^2, f7 ]), >> Group([ f3^2*f4^2, f5^2*f6^2, f7 ]), Group([ f5^2*f6^2, f7 ]), Group([ >> f5*f6^2, f7 ]), Group([ f7 ]), Group([ ]) ] >> >> --- it works. >> Note that LoadAllPackages() is necessary, as apparently the GAP code uses >> one of these packages for these >> computation without telling us. >> >> So this is a sort of bug, yes, in our way of packaging GAP packages (and >> it's a sort of GAP's bug to call a code from a package >> without loading it explicitly...) >> I don't know what package it is yet. >> It's very early Sat. morning here, I'll have a look at it over the >> weekend. >> >> >> On Saturday, February 17, 2018 at 3:12:25 AM UTC, David Roe wrote: >>> >>> I'm trying to use GAP's small groups library (after installing >>> gap_packages) and getting strange errors that don't occur in GAP when built >>> from source. In particular (using gap_console to get more traceback) >>> >>> sage: gap_console() >>> ... >>> gap> NormalSubgroups(SmallGroup(1458,1180)); >>> Error, List Element: <list>[4] must have an assigned value in >>> if map[d] > max then >>> elm := id; >>> else >>> if not IsBound( map[d] ) then >>> Error( "<elm> lies not in group defined by <pcgs>" ); >>> fi; >>> ll := LeadingExponentOfPcElement( pa, elm ); >>> lr := lc[d]; >>> exp[map[d]] := ll / lr mod ros[d]; >>> elm := LeftQuotientPowerPcgsElement( pcgs, map[d], exp[map[d]], elm >>> ); >>> fi; at /home/roed/sage/local/gap/latest/lib/pcgsind.gi:1411 called from >>> ExponentsOfPcElement( NumeratorOfModuloPcgs( pcgs ), elm, pcgs!.depthMap >>> ) at /home/roed/sage/local/gap/latest/lib/pcgsmodu.gi:931 called from >>> ExponentsOfPcElement( ocr.modulePcgs, x ) at >>> /home/roed/sage/local/gap/latest/lib/onecohom.gi:264 called from >>> ocr.moduleMap( n ) at /home/roed/sage/local/gap/latest/lib/ >>> onecohom.gi:339 called from >>> ocr.listToCocycle( lc ) at /home/roed/sage/local/gap/latest/lib/ >>> grplatt.gi:1926 called from >>> opr( Zero( vs ), k ) at /home/roed/sage/local/gap/latest/lib/ >>> grplatt.gi:1932 called from >>> ... at line 2 of *stdin* >>> >>> Similar problems are occurring with other groups and some other >>> functions. >>> >>> In the interest of finishing my calculation, I tried the following in an >>> attempt to have Sage use a functional GAP: >>> >>> sage: import sage.interfaces.gap >>> sage: sage.interfaces.gap.gap_cmd = "/home/roed/gap4r8/bin/gap.sh" >>> sage: gap.eval('1+1') >>> >>> which hangs. Similarly, I tried copying my functional gap installation >>> to $SAGE_LOCAL/gap/ and updating the "latest" symlink; this allows >>> gap_console() to function correctly but gap.eval() still hangs. >>> >>> I don't tend to work with spkgs very often, so I feel like there's >>> probably something simple I'm overlooking. Any help in installing a >>> functioning gap would be appreciated. I'm also happy to help investigate >>> what's wrong with our process for installing the small groups library. >>> David >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "sage-devel" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to sage-devel+unsubscr...@googlegroups.com. >> To post to this group, send email to sage-devel@googlegroups.com. >> Visit this group at https://groups.google.com/group/sage-devel. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.