gap-system / gap

Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
https://www.gap-system.org
GNU General Public License v2.0
805 stars 161 forks source link

Stabiliser unbound when loading Grape: is 'Transatlantic' being run at the appropriate time? #2828

Closed wilfwilson closed 5 years ago

wilfwilson commented 6 years ago

In GAP master branch, if I load Grape separately after startup, then everything is fine:

$ gap.sh -A
 ┌───────┐   GAP 4.10dev-1163-g94ead70 of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin17.7.0-default64
 Configuration:  gmp 6.1.2
 Loading the library and packages ...
 Packages:   GAPDoc 1.6.1.dev, PrimGrp 3.3.1, SmallGrp 1.3, TransGrp 2.0.4
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
gap> LoadPackage("grape");
─────────────────────────────────────────────────────────────────────────────
Loading  GRAPE 4.8 (GRaph Algorithms using PErmutation groups)
by Leonard H. Soicher (http://www.maths.qmul.ac.uk/~lsoicher/).
Homepage: http://www.maths.qmul.ac.uk/~lsoicher/grape/
─────────────────────────────────────────────────────────────────────────────
true

But if Grape autoloads, then there is a complaint about an unbound global variable:

$ gap.sh
 ┌───────┐   GAP 4.10dev-1163-g94ead70 of today
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-apple-darwin17.7.0-default64
 Configuration:  gmp 6.1.2
 Loading the library and packages ...
Syntax warning: Unbound global variable in /Users/Wilf/gap/pkg/grape/lib/grape\
.g:3963
      newdelta:=InducedSubgraph(delta,A,Stabiliser(delta.group,c,OnSets));
                                                  ^
#I  method installed for Matrix matches more than one declaration
 Packages:   Digraphs 0.13.0, GAPDoc 1.6.1.dev, genss 1.6.5, GRAPE 4.8,
             IO 4.5.3, NautyTracesInterface 0.2, orb 4.8.1, PrimGrp 3.3.1,
             Semigroups 3.0.19, SmallGrp 1.3, Smallsemi 0.6.11,
             TransGrp 2.0.4
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'
gap>

I would guess this is something to do with the British spelling of Stabiliser being used instead of Stabilizer; perhaps this synonym is not known by GAP at the point that Grape is being loaded?

olexandr-konovalov commented 6 years ago

Yes, normally one does not see this since GRAPE is not loaded by default - but it's plausible that users may customise their GAP installation to have it autoloaded. What was the exact way that you've used to do this?

wilfwilson commented 6 years ago

This happens when my gap.ini file contains only

SetUserPreference("PackagesToLoad",
[ "semigroups", "smallsemi" ]);

Semigroups loads Digraphs, which loads Grape if it available.

And I'm simply calling gap.sh with no options.

olexandr-konovalov commented 6 years ago

If you want a workaround, I suggest trying to create a gaprc file and put

LoadPackage("semigroups");
LoadPackage("smallsemi");

there. It will be read at a later stage.