oscar-system / GAP.jl

GAP packages for Julia integration
https://oscar-system.github.io/GAP.jl/
GNU Lesser General Public License v3.0
64 stars 21 forks source link

Error "undefined symbol" when trying to load Digraphs after installation with `GAP.Packages.install` #851

Closed zickgraf closed 1 year ago

zickgraf commented 1 year ago

When installing Digraphs using GAP.Packages.install and trying to load it, the following error occurs:

ERROR: Error thrown by GAP: Error, LOAD_DYN: failed to load kernel module ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1/bin/x86_64-pc-linux-gnu-julia1.8-64-kv8/digraphs.so, ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1/bin/x86_64-pc-linux-gnu-julia1.8-64-kv8/digraphs.so: undefined symbol: LenListFuncs

See below for steps to reproduce. Since there are many parties involved (GAP, Julia, GAP.jl, PackageManager, Digraphs) I'm not sure where to start with debugging and if this even is the correct place to report this.

$ /usr/bin/julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.8.2 (2022-09-29)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

(@v1.8) pkg> status
Status `~/.julia/environments/v1.8/Project.toml`
  [c863536a] GAP v0.9.2

julia> using GAP
 ┌───────┐   GAP 4.12.2 of 2022-12-18
 │  GAP  │   https://www.gap-system.org
 └───────┘   Architecture: x86_64-pc-linux-gnu-julia1.8-64-kv8
 Configuration:  gmp 6.2.1, Julia GC, Julia 1.8.2, readline
 Loading the library and packages ...
 Packages:   GAPDoc 1.6.6, JuliaInterface 0.9.2, PrimGrp 3.4.2, SmallGrp 1.5, TransGrp 3.6.3
 Try '??help' for help. See also '?copyright', '?cite' and '?authors'

julia> GAP.Packages.install("Digraphs")
#I  Getting PackageInfo URLs...
#I  Retrieving PackageInfo.g from https://digraphs.github.io/Digraphs/PackageInfo.g ...
#I  Downloading archive from URL https://github.com/digraphs/Digraphs/releases/download/v1.6.1/digraphs-1.6.1.tar.gz ...
#I  Saved archive to /tmp/gaptempdirsMSdE5/digraphs-1.6.1.tar.gz.pkgman
#I  Extracting to ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1 ...
#I  Checking dependencies for Digraphs...
#I    io >=4.5.1: false
#I    orb >=4.8.2: true
#I    datastructures >=0.2.5: false
#I  Retrieving PackageInfo.g from https://gap-packages.github.io/io/PackageInfo.g ...
#I  Retrieving PackageInfo.g from https://gap-packages.github.io/datastructures/PackageInfo.g ...
#I  Installing dependency IO 4.8.0 ...
#I  Downloading archive from URL https://github.com/gap-packages/io/releases/download/v4.8.0/io-4.8.0.tar.gz ...
#I  Saved archive to /tmp/gaptempdir5MuoTz/io-4.8.0.tar.gz.pkgman
#I  Extracting to ~/.julia/gaproot/v4.12/pkg/io-4.8.0 ...
#I  Running compilation script on ~/.julia/gaproot/v4.12/pkg/io-4.8.0 ...
#I  Installing dependency datastructures 0.3.0 ...
#I  Downloading archive from URL https://github.com/gap-packages/datastructures/releases/download/v0.3.0/datastructures-0.3.0.tar.gz ...
#I  Saved archive to /tmp/gaptempdirO22GvL/datastructures-0.3.0.tar.gz.pkgman
#I  Extracting to ~/.julia/gaproot/v4.12/pkg/datastructures-0.3.0 ...
#I  Checking dependencies for datastructures...
#I    GAPDoc 1.5: true
#I  Running compilation script on ~/.julia/gaproot/v4.12/pkg/datastructures-0.3.0 ...
#I  Running compilation script on ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1 ...
true

julia> GAP.Globals.LoadPackage(g"Digraphs")
──────────────────────────────────────────────────────────────────────────────
Loading  datastructures 0.3.0 (datastructures - GAP Data Structures)
by Markus Pfeiffer (http://www.morphism.de/~markusp),
   Max Horn (https://www.quendi.de/math),
   Christopher Jefferson (http://caj.host.cs.st-andrews.ac.uk/), and
   Steve Linton (http://sl4.host.cs.st-andrews.ac.uk/).
Homepage: https://gap-packages.github.io/datastructures
Report issues at https://github.com/gap-packages/datastructures/issues
──────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────
Loading  IO 4.8.0 (Bindings for low level C library I/O routines)
by Max Neunhöffer (max@9hoeffer.de).
maintained by:
   Max Horn (https://www.quendi.de/math).
Homepage: https://gap-packages.github.io/io
Report issues at https://github.com/gap-packages/io/issues
──────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────
Loading  orb 4.9.0 (Methods to enumerate orbits)
by Juergen Mueller (http://www.math.rwth-aachen.de/~Juergen.Mueller),
   Max Neunhöffer (http://www-groups.mcs.st-and.ac.uk/~neunhoef), and
   Felix Noeske (http://www.math.rwth-aachen.de/~Felix.Noeske).
maintained by:
   Juergen Mueller (http://www.math.rwth-aachen.de/~Juergen.Mueller),
   Felix Noeske (http://www.math.rwth-aachen.de/~Felix.Noeske), and
   Max Horn (https://www.quendi.de/math).
Homepage: https://gap-packages.github.io/orb
Report issues at https://github.com/gap-packages/orb/issues
──────────────────────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────────────────────────
Loading  GRAPE 4.8.5 (GRaph Algorithms using PErmutation groups)
by Leonard H. Soicher (http://www.maths.qmul.ac.uk/~lsoicher/).
Homepage: https://gap-packages.github.io/grape
Report issues at https://github.com/gap-packages/grape/issues
──────────────────────────────────────────────────────────────────────────────
ERROR: Error thrown by GAP: Error, LOAD_DYN: failed to load kernel module ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1/bin/x86_64-pc-linux-gnu-julia1.8-64-kv8/digraphs.so, ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1/bin/x86_64-pc-linux-gnu-julia1.8-64-kv8/digraphs.so: undefined symbol: LenListFuncs in
  LOAD_DYN( filename ) at ~/.julia/artifacts/b5c2f0f824457e5c391fb24916f94d5d91c62c4f/share/gap/lib/files.gd:592 called from 
<function "LoadDynamicModule">( <arguments> )
 called from read-eval loop at ~/.julia/gaproot/v4.12/pkg/digraphs-1.6.1/init.g:24

Stacktrace:
 [1] ThrowObserver(depth::Int32)
   @ GAP ~/.julia/packages/GAP/p0xxt/src/GAP.jl:88
 [2] _call_gap_func(func::GapObj, a1::GapObj)
   @ GAP ~/.julia/packages/GAP/p0xxt/src/ccalls.jl:258
 [3] call_gap_func_nokw
   @ ~/.julia/packages/GAP/p0xxt/src/ccalls.jl:224 [inlined]
 [4] (::GapObj)(a1::GapObj)
   @ GAP ~/.julia/packages/GAP/p0xxt/src/ccalls.jl:235
 [5] top-level scope
   @ REPL[10]:1
zickgraf commented 1 year ago

Additional information: The problem appears in our CI with Ubuntu but not with macOS. I could reproduce the issue using Arch Linux.

fingolfin commented 1 year ago

The key is this part of the error message:

digraphs.so: undefined symbol: LenListFuncs

That means it fails to backlink to GAP. That could hint at a deficiency in the digraphs build system.

I'll look into it

fingolfin commented 1 year ago

No, it's a problem in GAP.jl's sysinfo.gap generation. Working on a fix now (but have to head to a GAP council meeting, so don't hold your breath on me finishing this soon)

zickgraf commented 1 year ago

Thanks a lot for investigating and working on a fix!

so don't hold your breath on me finishing this soon

No problem, this is not (yet) urgent for us right now. As long as Julia 1.9 is not released we can continue using GAP.jl 0.8 which does not have this issue.

zickgraf commented 1 year ago

@fingolfin Thanks for the new release! Now CapAndHomalg.jl works with GAP 0.9.3 and Julia nightly again :-)