Nemocas / Nemo.jl

Julia bindings for various mathematical libraries (including flint2)
http://nemocas.github.io/Nemo.jl/
Other
176 stars 57 forks source link

Cannot use Nemo.jl on MacBook Pro with M1 #1721

Closed its-popplewell closed 2 months ago

its-popplewell commented 2 months ago

On a 2021 14" MacBook Pro with an Apple M1 Pro, running Sonoma 14.1.2.

I am getting this issue with a number of packages, and I think it all comes back to the (closed) BinaryProvider.jl library.

However, to reproduce: I uninstalled Julia using homebrew, wiped its config directories on my machine, and then reinstalled. Open Julia, and run Pkg.Add("Nemo"); using Nemo;".

Error:

Precompiling Nemo
        Info Given Nemo was explicitly requested, output will be shown live
ERROR: LoadError: InitError: there should be exactly one libflint, but we have: String[]
Stacktrace:
  [1] error
    @ ./error.jl:44
  [2] __init__()
    @ LoadFlint ~/.julia/packages/LoadFlint/jHlQx/src/LoadFlint.jl:29
  [3] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [4] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [5] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [7] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
  [8] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
  [9] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [10] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [11] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [12] macro expansion
    @ ./loading.jl:1790 [inlined]
 [13] macro expansion
    @ ./lock.jl:267 [inlined]
 [14] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [15] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [16] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [17] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [18] include
    @ ./Base.jl:495 [inlined]
 [19] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2222
 [20] top-level scope
    @ stdin:3
during initialization of module LoadFlint
in expression starting at /Users/<>/.julia/packages/Nemo/vCIJx/src/Nemo.jl:1
in expression starting at stdin:3
  ✗ BinaryProvider
  ✗ Nemo
  0 dependencies successfully precompiled in 2 seconds. 10 already precompiled.

ERROR: The following 2 direct dependencies failed to precompile:

BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232]

Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to "/Users/<>/.julia/compiled/v1.10/BinaryProvider/jl_Af7Iry".
┌ Warning: Platform `arm64-apple-darwin23.2.0` is not an officially supported platform
└ @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:450
ERROR: LoadError: KeyError: key "unknown" not found
Stacktrace:
  [1] getindex
    @ ./dict.jl:498 [inlined]
  [2] parse_dl_name_version
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:511 [inlined]
  [3] detect_libgfortran_abi(libgfortran_name::String, platform::BinaryProvider.UnknownPlatform)
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:555
  [4] detect_libgfortran_abi
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:584 [inlined]
  [5] detect_compiler_abi()
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:667
  [6] top-level scope
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:685
  [7] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
  [8] include(x::String)
    @ BinaryProvider ~/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:1
  [9] top-level scope
    @ ~/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:12
 [10] include
    @ ./Base.jl:495 [inlined]
 [11] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2222
 [12] top-level scope
    @ stdin:3
in expression starting at /Users/<>/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:685
in expression starting at /Users/<>/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:1
in expression starting at stdin:3
Nemo [2edaba10-b0f1-5616-af89-8c11ac63239a]

Failed to precompile Nemo [2edaba10-b0f1-5616-af89-8c11ac63239a] to "/Users/<>/.julia/compiled/v1.10/Nemo/jl_mlxcJe".
ERROR: LoadError: InitError: there should be exactly one libflint, but we have: String[]
Stacktrace:
  [1] error
    @ ./error.jl:44
  [2] __init__()
    @ LoadFlint ~/.julia/packages/LoadFlint/jHlQx/src/LoadFlint.jl:29
  [3] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [4] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [5] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1581
  [7] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
  [8] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
  [9] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [10] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [11] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [12] macro expansion
    @ ./loading.jl:1790 [inlined]
 [13] macro expansion
    @ ./lock.jl:267 [inlined]
 [14] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [15] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [16] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [17] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [18] include
    @ ./Base.jl:495 [inlined]
 [19] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
    @ Base ./loading.jl:2222
 [20] top-level scope
    @ stdin:3
during initialization of module LoadFlint
in expression starting at /Users/<>/.julia/packages/Nemo/vCIJx/src/Nemo.jl:1
in expression starting at stdin:3
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types /opt/homebrew/Cellar/julia/1.10.2/share/julia/stdlib/v1.10/Pkg/src/Types.jl:70
  [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{…}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, timing::Bool, _from_loading::Bool, kwargs::@Kwargs{…})
    @ Pkg.API /opt/homebrew/Cellar/julia/1.10.2/share/julia/stdlib/v1.10/Pkg/src/API.jl:1659
  [3] precompile(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{_from_loading::Bool})
    @ Pkg.API /opt/homebrew/Cellar/julia/1.10.2/share/julia/stdlib/v1.10/Pkg/src/API.jl:159
  [4] precompile
    @ /opt/homebrew/Cellar/julia/1.10.2/share/julia/stdlib/v1.10/Pkg/src/API.jl:147 [inlined]
  [5] #precompile#114
    @ /opt/homebrew/Cellar/julia/1.10.2/share/julia/stdlib/v1.10/Pkg/src/API.jl:146 [inlined]
  [6] #invokelatest#2
    @ ./essentials.jl:894 [inlined]
  [7] invokelatest
    @ ./essentials.jl:889 [inlined]
  [8] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1963
  [9] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [10] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [11] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [12] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [13] macro expansion
    @ ./loading.jl:1790 [inlined]
 [14] macro expansion
    @ ./lock.jl:267 [inlined]
 [15] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [16] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [17] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [18] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
Some type information was truncated. Use `show(err)` to see complete types.
thofma commented 2 months ago

What is your versioninfo()? And also using Pkg; Pkg.status() would be interesting. There are few issues: 1) BinaryProvider is not used since a few years, so you must be installing a very old version of Nemo. 2) I don't think installing brew is a supported way to install julia on OSX. (If you want to use brew, I would suggest to uninstall julia and and then brew install juliaup.

albinahlback commented 2 months ago

Furthermore, LoadFLINT is deprecated, no?

its-popplewell commented 2 months ago

I needed to switch to Juliaup -- should've known better. Thank you all!