id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
22626 Upgrade to GAP 4.9 nthiery "GAP 4.9 comes with a completely rewritten build system that will simplify
our packaging. In fact, it may well enable Sage to use a vanilla GAP
installation as provided by the distribution.
The GAP team will not provide libGAP with GAP 4.9, but only with GAP 4.10.
The branch attached to this ticket updates Sage to run on top of
[[https://github.com/markuspf/gap/tree/hpc-merge-libgap|a branch of GAP]]
by Markus Pfeiffer that adds libgap compilation and
[[https://github.com/gap-system/gap/pull/1205|might be merged]]
soon in the devel version of GAP.
See https://github.com/markuspf/gap/issues/2 for the few sticking points
that could prevent using a vanilla GAP from the distribution (please edit
further if you think about more of them).
What the branch does:
- Remove the libgap spkg
- Update the gap spkg to the new build system and build and install libgap
- Replace `gap.shi.patch` by a plain gap startup script for Sage
Rationale: GAP used to provide a startup shell script. The GAP devs
are in the process of getting rid of it and provide a very minimal
one. They recommend to just write our own rather than patching it.
- Update a few doctests w.r.t. changes of output of some GAP functions
- **Possibly controversial:** The new libgap currently *does not come*
with symbol rewriting (`foobar` -> `libGAP_foobar`). This avoids messing
around with GAP's sources; in particular opening the door for using
a stock GAP from the OS distribution. However there always is a risk
of name conflict. And indeed, GAP's constants (actually cpp macros)
T_INT, T_FLOAT, ... conflict with Python's constants. This is
currently worked around by forcing the inclusion of Python's
`structmember.h` before the gap headers.
Something similar was started by Volker at #19915.
- Removes configure.patch: it was patching configure for better GMP
detection under Cygwin (#13954). This should not be needed anymore
with the new build system and use of --with-gmp. If it is, upstream
asked for it to be reported and they will fix it.
- Revert #19726 (not needed anymore)
Status: Most long test pass. Tentatively, the 38 remaining failing
tests are due to changes in GAP since 4.8.6: Max mentioned that the
library has been cleaned up to always use the same random generation
source, and some of the group algorithms were changed as well, which
can explain, e.g. change of orders in lists of elements. So those
should be nothing to worry about. There is not much point in updating
those doctests right away; we may as well wait for a more final
version of 4.9 to be out.
TODO:
- Automatic handling of headers (see below for how to do it by hand).
GAP's build system will eventually provide a rule to install headers
which will make this trivial.
- Use GAP's own `make install` [[https://github.com/fingolfin/gap/issues/44|when it will be implemented]].
- Check against #19915 to see if any of the changes there should be
ported here. Then close as won't fix.
- Update doctests as needed
- ???
Fetching Markus's GAP sources:
{{{
git clone git@github.com:markuspf/gap.git $LIBGAP
cd $LIBGAP
git remote add markuspf git@github.com:markuspf/gap.git
git fetch markuspf
git checkout -b markuspf/hpc-merge-libgap
./autogen.sh
./configure
make bootstrap-pkg-minimal
}}}
Testing libgap:
{{{
./configure --enable-libgap
make -j4 libgap
make test-libgap
}}}
Build and install a tardist for Sage, and rebuild the spkg:
{{{
make distclean
./autogen.sh
./configure
make manuals
make clean
(cd ..; tar zcvf $SAGE/upstream/$GAP.tar.gz --exclude .git $GAP)
sage --package fix-checksum
sage -f gap # -s
}}}
Header files:
- Copy GAP's header files, as well as gen/config.h to $SAGE/local/include
- Fix them to adapt the include path: #include -> #include
- **Replace T_INT by 0 in TNUM_OBJ, around line 414 of objects.h**
Run:
{{{
sage -b
}}}
Basic tests on libgap:
{{{
sage: libgap.eval(""GAPInfo.Version"")
sage: libgap.DihedralGroup(10).CharacterTable()
CharacterTable( )
sage: libgap.Group(libgap.eval(""[(1,2,3),(1,2)]"")).Size()
6
}}}
Running most relevant tests:
{{{
sage -tp 8 sage/groups sage/libs/gap
}}}
Current status: all tests pass!
Testing packages with dynamic loading (e.g. IO):
Install IO:
{{{
cd $SAGE/local/gap/latest/pkg
wget http://www.gap-system.org/pub/gap/gap4/tar.gz/packages/io-4.4.6.tar.gz
tar xvf /tmp/io-4.4.6.tar.gz
mv io-4.4.6 io
cd io
./configure
make
}}}
Test it locally:
{{{
cd ../..
./gap -l .
gap> LoadPackage(""IO"");
true
}}}
This does not yet work:
{{{
sage: libgap.LoadPackage(""IO"")
ValueError: libGAP: Error, module '/opt/sage-git/local/gap/latest/pkg/io/bin/x86_64-pc-linux-gnu-gcc-default64/io.so' not found
}}}
This should be fixed once GAP's gap binary is built on top of libgap.
See: https://github.com/markuspf/gap/issues/1.
Note:
- [[http://www.gap-system.org/Releases/4.9.2.html|GAP 4.9.2]] was released in July 2018.
- [[http://www.gap-system.org/Releases/4.9.1.html|GAP 4.9.1]], released in May 2018,
was the first stable release of GAP 4.9 (GAP 4.9.0 was a beta for GAP 4.9).
- Max Horn reviewed the list of GAP symbols we use in Sage; some have already changed in 4.9. See this [[https://hackmd.io/emNi76svSWCh1fBeLKqPdA?edit#|pad]] for notes." enhancement new major sage-8.3 interfaces days85, libgap alexk dimpase embray fbissey arojas gh-sebasguts jpflori markuspf nthiery slelievre vbraun wstein Nicolas M. Thiéry, ... N/A Wait for gap 4.9 release u/jdemeyer/upgrade_to_gap_4_9 40e644a16bafa77e4b93e72c215f53a4afb19cc1 #25273