Skip to content

Prepare juliainterface for GAP 4.15 - #1239

Closed
lgoettgens wants to merge 3 commits into
masterfrom
lg/gap-4.15.0
Closed

Prepare juliainterface for GAP 4.15#1239
lgoettgens wants to merge 3 commits into
masterfrom
lg/gap-4.15.0

Conversation

@lgoettgens

Copy link
Copy Markdown
Member

This collects changes and patches needed to update to GAP v4.15.0.

For the meantime, I use this branch to collect all patches needed to get v4.15.0-beta1 running with Oscar.

Comment thread pkg/JuliaInterface/src/JuliaInterface.c Outdated
#include "sync.h"

#include <julia_gc.h> // GAP header
#include <gap/julia_gc.h> // GAP header

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this will only work with an "installed" GAP, not with an uninstalled GAP. This shouldn't currently be a problem because of course when using the JLLs, GAP is installed; and also etc/setup_override_dir.jl does make install.

So, no objection here.

Comment thread src/setup.jl
gap_include = joinpath(gap_prefix, "include", "gap")
sysinfo["GAP_CPPFLAGS"] = "-I$(gap_include) -DUSE_JULIA_GC=1"
gap_include = joinpath(gap_prefix, "include", "gap", "extra")
sysinfo["GAP_CPPFLAGS"] = "-I$(gap_include) -DUSE_JULIA_GC=1 -DUSE_GAP_INSIDE_JULIA=1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

USE_GAP_INSIDE_JULIA is only used in src/julia_gc.c, so it should not be necessary to add it here. Is there something this is meant to fix?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you are trying to collect patches in GAP_jll here? But this patch reallys for the GAP_jll only. If you want to get rid of this one, that would require adding a new configure option to GAP which then ends up adding #define USE_GAP_INSIDE_JULIA to GAP's config.h... but then the GAP_jll recipe does not get easier at all ; just the entire setup gets more complex.

What we could do is to improve the comment in GAP's src/julia_gc.c to explicitly state that USE_GAP_INSIDE_JULIA is set by the GAP_jll recipe

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(oh and of course etc/setup_override_dir.jl also sets it)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was applying the changes to the gap make process to the build instructions here, e.g. change the includedir. And while doing that I also noticed the $(GAP_DEFINES) in https://github.com/gap-system/gap/blob/90820b6dbb2a1bbde5b541f3ff6db9c442e59041/Makefile.rules#L673, which (if I understand correctly) should correspond to -DUSE_GAP_INSIDE_JULIA=1. So I am just trying to replicate the make script as accurately as possible here. This should not make any difference here, so I am open to removing the flag again

@lgoettgens lgoettgens changed the title Update to GAP v4.15.0 Prepare juliainterface for GAP 4.15 Sep 8, 2025
@lgoettgens lgoettgens mentioned this pull request Sep 8, 2025
@lgoettgens

Copy link
Copy Markdown
Member Author

The patches from this branch don't seem to work on macos. At least on munk (with julia 1.11.6), I get the following error:

julia> ENV["FORCE_JULIAINTERFACE_COMPILATION"]=true; using GAP
[ Info: Compiling JuliaInterface ...
In file included from In file included from src/sync.csrc/JuliaInterface.c::1413:
:
src/sync.hsrc/JuliaInterface.h::1816::1010:: In file included from  src/calls.cfatal error: :'gap_all.h' file not found13:

fatal error: src/calls.h:16:10:    In file included from 18 | 'gap_all.h' file not foundfatal error: 
'gap_all.h' file not found
src/convert.c   16: |    12:
#isrc/convert.hn#:c15l:u10idn16ce <ga | p#_inc:lalull.h>    /u/d deGA P< ghaepea_ da<elgrls.h 
>a      p| 
_      a         ^~~~~~~~~~~
|          ^~~~~~~~~~~
ll.h>    // GAP hfatal error: eaders
      |          ^~~~~~~~~~~
'gap_all.h' file not found
   15 | #include <gap_all.h>    // GAP headers
      |          ^~~~~~~~~~~
1 error generated.
make: *** [gen/src/sync.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
1 error generated.
1 error generated.
make: *** [gen/src/calls.o] Error 1
make: *** [gen/src/convert.o] Error 1
make: *** [gen/src/JuliaInterface.o] Error 1
ERROR: InitError: failed process: Process(`make V=1 -j4`, ProcessExited(2)) [2]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:598 [inlined]
  [2] run(::Base.CmdRedirect; wait::Bool)
    @ Base ./process.jl:513
  [3] run
    @ ./process.jl:510 [inlined]
  [4] (::GAP.Setup.var"#19#24"{String})()
    @ GAP.Setup ~/julia/GAP.jl/src/setup.jl:210
[...]

This is either due to gap-system/gap#6007 or some macos weirdness (or both). @fingolfin do you have any idea on where this comes from and how to solve it?

@fingolfin

Copy link
Copy Markdown
Member

Try changing <gap_all.h> to "gap_all.h" or to <gap/gap_all.h> ? If that doesn't help, it would be good to see if gap_all.h exists on the computer on which GAP is being compiled, and where; in particular where in the listed includedirs.

@lgoettgens

Copy link
Copy Markdown
Member Author

The above was of course me being stupid and expecting that the build patches from this branch work with gap 4.14 (which they obviously don't, not even on linux).

The real build issue (after dev'ing all new jlls etc.) is:

julia> ENV["FORCE_JULIAINTERFACE_COMPILATION"]=true; using GAP
[ Info: Compiling JuliaInterface ...
src/JuliaInterface.c:19:10: fatal error: 'gap/julia_gc.h' file not found
   19 | #include <gap/julia_gc.h>   // GAP header
      |          ^~~~~~~~~~~~~~~~
1 error generated.
make: *** [gen/src/JuliaInterface.o] Error 1
make: *** Waiting for unfinished jobs....

but just on macos

@lgoettgens

lgoettgens commented Sep 11, 2025

Copy link
Copy Markdown
Member Author

And for reference, changing the <gap/julia_gc.h> to "gap/julia_gc.h" does not change anything.
The file /Users/goettgen/.julia/artifacts/34a0ebf849e36fca85b2c66db63a316435abe433/include/gap/julia_gc.h exists (where the artifact hash comes from https://github.com/lgoettgens/GAP_jll.jl/blob/main/Artifacts.toml#L13)

@lgoettgens

Copy link
Copy Markdown
Member Author

To reproduce (e.g. on munk):
Checkout the lg/gap-4.15.0-jlls branch, start a julia 1.11.6 (I only build the jlls for julia 1.11) and run the following in Pkg mode:

add https://github.com/lgoettgens/GAP_pkg_ace_jll.jl https://github.com/lgoettgens/GAP_pkg_anupq_jll.jl https://github.com/lgoettgens/GAP_pkg_browse_jll.jl https://github.com/lgoettgens/GAP_pkg_caratinterface_jll.jl https://github.com/lgoettgens/GAP_pkg_cddinterface_jll.jl https://github.com/lgoettgens/GAP_pkg_cohomolo_jll.jl https://github.com/lgoettgens/GAP_pkg_crypting_jll.jl https://github.com/lgoettgens/GAP_pkg_curlinterface_jll.jl https://github.com/lgoettgens/GAP_pkg_cvec_jll.jl https://github.com/lgoettgens/GAP_pkg_datastructures_jll.jl https://github.com/lgoettgens/GAP_pkg_deepthought_jll.jl https://github.com/lgoettgens/GAP_pkg_digraphs_jll.jl https://github.com/lgoettgens/GAP_pkg_edim_jll.jl https://github.com/lgoettgens/GAP_pkg_ferret_jll.jl https://github.com/lgoettgens/GAP_pkg_float_jll.jl https://github.com/lgoettgens/GAP_pkg_fplsa_jll.jl https://github.com/lgoettgens/GAP_pkg_gauss_jll.jl https://github.com/lgoettgens/GAP_pkg_guava_jll.jl https://github.com/lgoettgens/GAP_pkg_io_jll.jl https://github.com/lgoettgens/GAP_pkg_json_jll.jl https://github.com/lgoettgens/GAP_pkg_juliainterface_jll.jl https://github.com/lgoettgens/GAP_pkg_kbmag_jll.jl https://github.com/lgoettgens/GAP_pkg_normalizinterface_jll.jl https://github.com/lgoettgens/GAP_pkg_nq_jll.jl https://github.com/lgoettgens/GAP_pkg_orb_jll.jl https://github.com/lgoettgens/GAP_pkg_profiling_jll.jl https://github.com/lgoettgens/GAP_pkg_semigroups_jll.jl https://github.com/lgoettgens/GAP_pkg_simpcomp_jll.jl https://github.com/lgoettgens/GAP_pkg_zeromqinterface_jll.jl https://github.com/lgoettgens/GAP_jll.jl https://github.com/lgoettgens/GAP_lib_jll.jl

then force a rebuild with ENV["FORCE_JULIAINTERFACE_COMPILATION"]=true; using GAP

@lgoettgens

Copy link
Copy Markdown
Member Author

The macos build failures no longer happen with the newest commit in 00b09a2 (#1239).

@lgoettgens

Copy link
Copy Markdown
Member Author

Closing in favor of #1248

@lgoettgens lgoettgens closed this Sep 23, 2025
@lgoettgens
lgoettgens deleted the lg/gap-4.15.0 branch September 23, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants