Skip to content

Commit

Permalink
Use BinaryWrapper to point GAP packages to singular/polymake executables
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 23, 2024
1 parent 55ea957 commit 5c8ee22
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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.1"
Expand Down
21 changes: 21 additions & 0 deletions src/Oscar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Hecke.@include_deprecated_bindings()

include("utils/utils.jl")

import BinaryWrappers

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("""
Expand Down Expand Up @@ -87,6 +92,22 @@ function __init__()
# `Julia.Oscar` if Oscar is loaded indirectly as a package dependency)
GAP.Globals.BindGlobal(GapObj("Oscar"), Oscar)

GAP.Globals.POLYMAKE_COMMAND = GapObj(joinpath(polymake_binpath, "polymake")) # TODO doesn't work on macOS
#=
probably because polymake is just a small perl script and not a binary...
on Linux this seems to work
run(`$(polymake_jll.polymake())`)
perhaps we can try it by adapting the code to also use Perl_jll. Something like this or a variant might work:
run(addenv(`$(polymake_jll.Perl_jll.perl()) $(polymake_jll.polymake_path)`, polymake_jll.JLLWrappers.LIBPATH_env=>polymake_jll.LIBPATH[]))
=#

GAP.Globals.sing_exec = GapObj(joinpath(singular_binpath, "Singular")) # TODO

# 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.)
Expand Down

0 comments on commit 5c8ee22

Please sign in to comment.