From a0aa36e8895215cef8e35ce1d4c9dc2f0b6b3e68 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 24 Sep 2024 10:37:16 +0200 Subject: [PATCH 1/2] Reapply "load the GAP packages sotgrps and sglppow" This reverts commit b07d4c41b2bb352febe2b38f639e5cb51d6a8e77. --- src/Oscar.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Oscar.jl b/src/Oscar.jl index 10f6865a54b5..c87e8a5352f1 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -127,6 +127,8 @@ function __init__() # We want some GAP packages. (It is no error if they cannot be loaded.) for pkg in [ "ferret", # backtrack in permutation groups + "sotgrps", # extend the small groups library + "sglppow", # extend the small groups library ] GAP.Packages.load(pkg) end From 94fb5c3fa5ee6aab9c8c4ba3fec296ab21c84122 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 23 Sep 2024 10:15:44 +0200 Subject: [PATCH 2/2] Use BinaryWrapper to point GAP packages to singular/polymake executables --- Project.toml | 2 ++ src/Oscar.jl | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/Project.toml b/Project.toml index f58c37819f69..60da84784b94 100644 --- a/Project.toml +++ b/Project.toml @@ -6,6 +6,7 @@ version = "1.2.0-DEV" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" AlgebraicSolving = "66b61cbe-0446-4d5d-9090-1ff510639f9d" +BinaryWrappers = "f01c122e-0ea1-4f85-ad8f-907073ad7a9f" Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" GAP = "c863536a-3901-11e9-33e7-d5cd0df7b904" Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" @@ -27,6 +28,7 @@ cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" [compat] AbstractAlgebra = "0.43.1" AlgebraicSolving = "0.7.0" +BinaryWrappers = "0.1" Distributed = "1.6" GAP = "0.11.3" Hecke = "0.34.3" diff --git a/src/Oscar.jl b/src/Oscar.jl index c87e8a5352f1..62a875e0c37b 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -29,6 +29,12 @@ Hecke.@include_deprecated_bindings() include("utils/utils.jl") +import BinaryWrappers + +#const perl_binpath = BinaryWrappers.@generate_wrappers(Polymake.Perl_jll) +#const polymake_binpath = BinaryWrappers.@generate_wrappers(Polymake.polymake_jll) +const singular_binpath = BinaryWrappers.@generate_wrappers(Singular.Singular_jll) + # More helpful error message for users on Windows. windows_error() = error(""" @@ -87,6 +93,36 @@ function __init__() # `Julia.Oscar` if Oscar is loaded indirectly as a package dependency) GAP.Globals.BindGlobal(GapObj("Oscar"), Oscar) + # ensure the GAP package 'singular' finds a Singular interpreter it can actually + # execute, by pointing it at the binary wrapper for the Singular in Singular_jll + GAP.Globals.sing_exec = GapObj(joinpath(singular_binpath, "Singular")) + + # TODO: do the same for the GAP package 'polymaking' and polymake ; this is + # complicated by the fact that the `polymake` executable is just a perl + # script, which begins with `#!/usr/bin/env perl`. Hence the following + # doesn't work: + # + # GAP.Globals.POLYMAKE_COMMAND = GapObj(joinpath(polymake_binpath, "polymake")) + # + # ... as this ends up trying to use a system install version of Perl (which + # may not even exist). So we need to use the perl from our Perl_jll. E.g this + # works to launch polymake: + # + # import Oscar.Polymake: polymake_jll + # run(addenv(`$(polymake_jll.Perl_jll.perl()) $(polymake_jll.polymake_path)`, + # polymake_jll.JLLWrappers.LIBPATH_env=>polymake_jll.LIBPATH[])) + # + # But GAP needs a path to an executable and we can't tell it to set + # environment variables. So we either need to generate our own wrapper shell + # script; or someone needs to generalize BinaryWrappers to teach it to + # generate wrappers that set up environment variables based on one JLL + # (here: polymake_jll), but executes something from another (here: perl from + # Perl_jll). + # + # Since nobody has request anything using `polymaking` right now, we'll leave + # it at that for the moment (ideally any code using it would be rewritten to + # instead use our Julia-GAP and Julia-polymake bridges instead anyway). + # Up to now, hopefully the GAP packages listed below have not been loaded. # We want newer versions of some GAP packages than the distributed ones. # (But we do not complain if the installation fails.)