-
-
Notifications
You must be signed in to change notification settings - Fork 481
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resurrect #29644 and add an `spkg-configure.m4` for GAP. Some other changes were made to make this possible / nicer: 1. `GAP_LIB_DIR` and `GAP_SHARE_DIR` are merged into `GAP_ROOT_PATHS`. This was suggested by @tornaria and is the right approach, especially now that `GAP_SO` has been removed. Nothing else needs those two directories and GAP itself doesn't care about them -- it only cares about the package search path, i.e. `GAP_ROOT_PATHS`. So changing the variable(s) brings us in line with the way GAP works. 2. We no longer pass the `-r` flag to GAP. Particularly when using the system GAP, we do want the user to be able to install his own packages and run his own initialization. 3. We begin to pass `-A` to GAP. This tells GAP not to autoload the big set of "recommended" packages at start-up, which avoids the inevitable error messages when those packages are not installed on the system GAP. We could check for all of them in `spkg-configure.m4`, but it's a long list, and loading them slows down GAP initialization for no benefit -- Sage itself uses only one such package. Users can autoload them via gaprc or gap.ini in light of (2). 4. After adding `-A` to the initialization, we try to load the PolyCyclic package if it's installed. This is the one "recommended" package that Sage itself uses. 5. The "recommended" packages are all moved from the gap SPKG to gap_packages because we no longer need them, except (maybe) for PolyCyclic. Should keep polycyclic installed by default? The tests all pass without it, but it is used a few places in sagelib. 6. Various stale doctest fixes. 7. The expected output from a few tests has changed. Where possible, I've made the test more robust. In one case I had to drop the printing of a matrix, because if you dig into the source code for GAP's `NormalSubgroups()`, it chooses a `Representative()` inconsistently, and that eventually affects the entries of the matrix. All tests are passing afterwards... except one, a heisenbug: ``` sage -t --warn-long 187.7 --random- seed=96688270013898650573232209016248663009 src/sage/groups/matrix_gps/finitely_generated_gap.py ********************************************************************** File "src/sage/groups/matrix_gps/finitely_generated_gap.py", line 123, in sage.groups.matrix_gps.finitely_generated_gap.FinitelyGeneratedMatrix Group_gap.as_permutation_group Failed example: P == Psmaller Expected: False Got: True ********************************************************************** ``` If anyone knows what's going on there, I'd be grateful. The GAP docs for `SmallerDegreePermutationRepresentation()` say, > The methods used might involve the use of random elements and the permutation representation (or even the degree of the representation) is not guaranteed to be the same for different calls of SmallerDegreePermutationRepresentation. So maybe this isn't really a bug, but I would find it strange if that randomness could mean that sometimes the smaller degree option just wouldn't work at all. Anyway, have at it, and let me know what you think. URL: #36792 Reported by: Michael Orlitzky Reviewer(s): Dima Pasechnik, François Bissey, Gonzalo Tornaría, Matthias Köppe, Michael Orlitzky, Tobias Diez
- Loading branch information
Showing
31 changed files
with
412 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
gap | ||
libgap-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
gap | ||
gap-core | ||
gap-devel | ||
gap-libs | ||
libgap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
SAGE_SPKG_CONFIGURE([gap], [ | ||
# Default to installing the SPKG, if the check is run at all. | ||
sage_spkg_install_gap=yes | ||
m4_pushdef([GAP_MINVER],["4.12.2"]) | ||
SAGE_SPKG_DEPCHECK([ncurses readline zlib], [ | ||
AC_PATH_PROG(GAP, gap) | ||
AS_IF([test -n "${GAP}"], [ | ||
AC_MSG_CHECKING([for gap version GAP_MINVER or newer]) | ||
# GAP will later add the "user" path to the list of root paths | ||
# so long as we don't initialize GAP with -r in Sage. But we | ||
# don't want to include it in the hard-coded list. | ||
GAPRUN="${GAP} -r -q --bare --nointeract -c" | ||
_cmd='Display(GAPInfo.KernelInfo.KERNEL_VERSION);' | ||
GAP_VERSION=$( ${GAPRUN} "${_cmd}" 2>/dev/null ) | ||
AX_COMPARE_VERSION(["${GAP_VERSION}"], [ge], [GAP_MINVER], [ | ||
AC_MSG_RESULT([yes]) | ||
AC_MSG_CHECKING([for gap root paths]) | ||
_cmd='Display(JoinStringsWithSeparator(GAPInfo.RootPaths,";"));' | ||
SYS_GAP_ROOT_PATHS=$( ${GAPRUN} "${_cmd}" 2>/dev/null ) | ||
AC_MSG_RESULT([$SYS_GAP_ROOT_PATHS]) | ||
AS_IF([test -n "${SYS_GAP_ROOT_PATHS}"], [ | ||
AC_MSG_CHECKING([for the PrimGrp, SmallGrp, and TransGrp packages]) | ||
# Check for a very minimal set of packages without which the | ||
# sage test suite will fail. The crazy thing below is a | ||
# "quadrigraph" for a square bracket. | ||
_cmd="Display(@<:@" | ||
_cmd="${_cmd} TestPackageAvailability(\"PrimGrp\")," | ||
_cmd="${_cmd} TestPackageAvailability(\"SmallGrp\")," | ||
_cmd="${_cmd} TestPackageAvailability(\"TransGrp\")" | ||
_cmd="${_cmd} @:>@);" | ||
_output=$( ${GAPRUN} "${_cmd}" 2>/dev/null ) | ||
AS_IF([test $? -eq 0], [ | ||
AS_CASE([$_output], | ||
[*fail*],[AC_MSG_RESULT([no (at least one package missing)])],[ | ||
# default case, i.e. no "fail" | ||
AC_MSG_RESULT([yes]) | ||
AC_MSG_CHECKING([if we can link against libgap]) | ||
# That was all for the CLI. Now we check for libgap, | ||
# too. There's a long list of headers we need in | ||
# src/sage/libs/gap/gap_includes.pxd, but libgap-api.h | ||
# combined with the version test above should be | ||
# sufficient even on systems where the headers are | ||
# packaged separately. | ||
_old_libs=$LIBS | ||
LIBS="${LIBS} -lgap" | ||
AC_LANG_PUSH([C]) | ||
AC_LINK_IFELSE([ | ||
AC_LANG_PROGRAM( | ||
[[#include <gap/libgap-api.h>]], | ||
[[ | ||
int main(int argc, char** argv) { | ||
GAP_Initialize(0, 0, 0, 0, 0); | ||
return 0; | ||
} | ||
]]) | ||
],[ | ||
AC_MSG_RESULT([yes]) | ||
sage_spkg_install_gap=no | ||
],[ | ||
AC_MSG_RESULT([no]) | ||
]) | ||
AC_LANG_POP | ||
LIBS="${_old_libs}" | ||
]) | ||
], [ | ||
# The gap command itself failed | ||
AC_MSG_RESULT([no (package check command failed)]) | ||
]) | ||
]) | ||
],[ | ||
# Version too old | ||
AC_MSG_RESULT([no]) | ||
]) | ||
]) | ||
]) | ||
m4_popdef([GAP_MINVER]) | ||
],[],[],[ | ||
# This is the post-check phase, where we make sage-conf | ||
# substitutions, in this case of GAP_ROOT_PATHS. We begin with the | ||
# two root paths used by the sage distribution. The '${prefix}' is | ||
# a magic string that sage-conf will replace. | ||
GAP_ROOT_PATHS='${prefix}/lib/gap;${prefix}/share/gap'; | ||
AS_IF([test "${sage_spkg_install_gap}" = "no"],[ | ||
# If we're using the system GAP, append the system root | ||
# paths to the existing two sage paths. | ||
GAP_ROOT_PATHS="${GAP_ROOT_PATHS};${SYS_GAP_ROOT_PATHS}" | ||
]) | ||
AC_SUBST(GAP_ROOT_PATHS, "${GAP_ROOT_PATHS}") | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.