diff --git a/Project.toml b/Project.toml index 9f9318fb906e..f828ebd8ba33 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.1" diff --git a/src/Oscar.jl b/src/Oscar.jl index c87e8a5352f1..7435481e14bc 100644 --- a/src/Oscar.jl +++ b/src/Oscar.jl @@ -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(""" @@ -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.)