Opened 5 years ago

Last modified 3 years ago

#22626 closed enhancement

Upgrade to GAP 4.9 — at Version 5

Reported by: nthiery Owned by:
Priority: critical Milestone: sage-8.6
Component: interfaces Keywords: days85, libgap
Cc: alexk, dimpase, embray, fbissey, arojas, gh-sebasguts, jpflori, markuspf, nthiery, slelievre, vbraun, wstein, gh-timokau Merged in:
Authors: Nicolas M. Thiéry, ... Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by nthiery)

GAP 4.9 will come with a completely rewritten build system that will simplify our packaging. It will also enable building GAP as a library, so that we can get rid of our separate libgap package.

The branch to be attached to this ticket is a preliminary experiment from a fork by Markus to be merged in the devel version of GAP.

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 (Foo -> libGAP_Foo). 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 worked around by duplicating and forcing their value in gap_include.pxd. Another conflict in objects.h currently needs to be worked around by hand (see below).
  • 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.
  • ???


  • Automatic handling of headers (see below for how to do it by hand). GAP's build system will eventuall provide a rule to install headers which will make this trivial.
  • Use GAP's own make install when it will be implemented.
  • Update the documentation in to not mention the libgap_ prefix

Fetching Markus's GAP sources:

    git clone $LIBGAP
    cd $LIBGAP
    git remote add markuspf
    git fetch markuspf
    git checkout -b markuspf/hpc-merge-libgap
    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
    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 <src/...> -> #include <gap/...>
  • Replace T_INT by 0 in TNUM_OBJ, around line 414 of objects.h


    sage -b

Basic tests on libgap:

    sage: libgap.eval("GAPInfo.Version")
    sage: libgap.DihedralGroup(10).CharacterTable()
    CharacterTable( <pc group of size 10 with 2 generators> )
    sage: libgap.Group(libgap.eval("[(1,2,3),(1,2)]")).Size()

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
    tar xvf /tmp/io-4.4.6.tar.gz
    mv io-4.4.6 io
    cd io

Test it locally:

    cd ../..
    ./gap -l .
    gap> LoadPackage("IO");

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/' not found

This should be fixed once GAP's gap binary is built on top of libgap. See:

Change History (5)

comment:1 Changed 5 years ago by nthiery

  • Description modified (diff)

comment:2 Changed 5 years ago by nthiery

  • Description modified (diff)

comment:3 Changed 5 years ago by nthiery

  • Description modified (diff)

comment:4 Changed 5 years ago by nthiery

  • Description modified (diff)

comment:5 Changed 5 years ago by nthiery

  • Description modified (diff)
Note: See TracTickets for help on using tickets.