Ask Your Question
0

How to load optional gap packages

asked 2013-07-17 17:01:53 +0100

niles gravatar image

updated 2023-01-09 23:59:33 +0100

tmonteil gravatar image

I would like to use the GAP package HAP in Sage. This is used, for example, to calculate cohomology of permutation groups as in (from the sage reference manual):

sage: G = SymmetricGroup(4)
sage: G.cohomology(1,2)                            # optional - gap_packages

In Sage 5.10, this raises

RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

Note that this is the error after installing gap_packages with sage -i gap_packages. I verified this with sage -optional, which gives:

Using SAGE Server http://www.sagemath.org/packages
 ***********************************
    ***  optional Packages   ***
 ***********************************

INSTALLED:
gap_packages-4.5.7

NOT INSTALLED:
4ti2-1.3.2.p1
autotools-20121217
beautifulsoup-3.2.1
biopython-1.61
...

Now I can track this error a little bit, to find the following bugs:

sage: from sage.groups.perm_gps.permgroup import load_hap
sage: load_hap()
...
RuntimeError: Error loading Gap package hap. You may want to install the gap_packages SPKG.

sage: gap.eval('LoadPackage("hap")')
'fail'
sage: gap.eval('LoadPackage("HAP")')
'fail'
sage: gap.eval('LoadPackage("Hap")')
'fail'
sage: gap.eval('LoadPackage("Hap1.10")')
'fail'

That last guess comes from listing the contents of SAGEROOT//local/gap/gap-4.5.7/pkg/, but seems to not work. Moreover, when I run gap directly with sage -gap, loading HAP fails there too. When I run LoadAllPackages(); in gap, HAP is not on the list of those that load.

edit retag flag offensive close merge delete

Comments

p.s. Yes, I know this is a bug and should be reported on Trac, but since we're right in the middle of migrating Trac to a new (virtual) machine, I'd rather wait a bit. Also, I don't have a solution for this, and I think the bigger problem is that `#optional` doctests are skipped too often. That's a different complaint :\

niles gravatar imageniles ( 2013-07-17 17:03:58 +0100 )edit

See also http://trac.sagemath.org/13540 to automatically run the optional doctests if the optional package has been installed.

Volker Braun gravatar imageVolker Braun ( 2013-07-17 20:27:41 +0100 )edit

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-07-18 16:35:13 +0100

Volker Braun gravatar image

updated 2013-07-19 14:55:34 +0100

Looks like we also need to package polycyclic:

gap> LoadPackage("hap");
fail
gap> DisplayPackageLoadingLog(PACKAGE_DEBUG);
[...]
#I  HAP: PackageAvailabilityInfo for version 1.10.10.2
#I  HAP: PackageAvailabilityInfo: the AvailabilityTest function returned 'true'
#I  HAP: PackageAvailabilityInfo: check needed packages
#I       polycyclic (>=1.1)
#I  polycyclic: PackageAvailabilityInfo: no installed version fits
#I  HAP: PackageAvailabilityInfo: dependency 'polycyclic' is not satisfied
#I  HAP: PackageAvailabilityInfo: check of needed packages done
#I  HAP: PackageAvailabilityInfo: no installed version fits
#I  HAP: return from LoadPackage, package is not available

This is now http://trac.sagemath.org/14909 (needs review)

edit flag offensive delete link more

Comments

Ah -- thanks!! At some stage I tried `DisplayPackageLoadingLog` but got no output -- I think I didn't know to put `PACKAGE_DEBUG` as an argument.

niles gravatar imageniles ( 2013-07-18 17:28:21 +0100 )edit
1

answered 2013-07-17 18:21:10 +0100

Nathann gravatar image

updated 2013-07-17 18:22:07 +0100

I've got no idea, but there is something strange, though. In the Hap directory there is a compile.sh file which contains stuff like that :

PKGDIR=/home/graham/pkg;

It also looks like some GAP pkg need to be compiled (they appear in the spkg-install file of the gap_packages spkg)

Don't get it O_o

This being said, there is something weird :

~/.Sage/spkg/installed$ ls *gap*
gap-4.6.4.p0  gap_packages-4.5.7  libgap-4.6.4.p0

Not the same version... O_O

Nathann

edit flag offensive delete link more

Comments

interesting! I tried explicitly installing gap_packages-4.6.4, but unfortunately this did not help. I've noticed some grumbling about gap_packages on the sage-devel list, so I guess I'll take my complaints there

niles gravatar imageniles ( 2013-07-18 12:07:05 +0100 )edit

In the Hap readme, I see that compiling Hap is not necessary, and that changing the hard-coded paths is only necessary if one compiles Hap. Sage doesn't seem to do this, so I guess that's not the problem.

niles gravatar imageniles ( 2013-07-18 13:09:31 +0100 )edit

Fixed, now the correct version is on the server.

Volker Braun gravatar imageVolker Braun ( 2013-07-18 16:36:01 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-07-17 17:01:53 +0100

Seen: 2,247 times

Last updated: Jul 19 '13