Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing on Mac M1 #403

Closed
VolodyaCO opened this issue Apr 3, 2022 · 5 comments
Closed

Installing on Mac M1 #403

VolodyaCO opened this issue Apr 3, 2022 · 5 comments

Comments

@VolodyaCO
Copy link

I'm trying to install the library using Julia 1.7 with an arm64 arch in a Mac M1. However, I get the following error:

ERROR: Error building `NNlib`: 
┌ Warning: Platform `arm64-apple-darwin21.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:481 [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) (repeats 2 times)
    @ 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:418
  [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:418 [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, UInt64}}, source::String)
    @ Base ./loading.jl:1318
 [12] top-level scope
    @ none:1
 [13] eval
    @ ./boot.jl:373 [inlined]
 [14] eval(x::Expr)
    @ Base.MainInclude ./client.jl:453
 [15] top-level scope
    @ none:1
in expression starting at /Users/vladimirvargas/.julia/packages/BinaryProvider/U2dKK/src/PlatformNames.jl:685
in expression starting at /Users/vladimirvargas/.julia/packages/BinaryProvider/U2dKK/src/BinaryProvider.jl:1
ERROR: LoadError: Failed to precompile BinaryProvider [b99e7846-7c00-51b0-8f62-c81ae34c0232] to /Users/vladimirvargas/.julia/compiled/v1.7/BinaryProvider/jl_EBDAtU.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, ignore_loaded_modules::Bool)
   @ Base ./loading.jl:1466
 [3] compilecache(pkg::Base.PkgId, path::String)
   @ Base ./loading.jl:1410
 [4] _require(pkg::Base.PkgId)
   @ Base ./loading.jl:1120
 [5] require(uuidkey::Base.PkgId)
   @ Base ./loading.jl:1013
 [6] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:997
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:451
 [8] top-level scope
   @ none:5
in expression starting at /Users/vladimirvargas/.julia/packages/NNlib/FAI3o/deps/build.jl:1

This looks to be an error triggered by BinaryProvider as explained here. Latest release was on 2020 before the Mac M1 was released. Apparently the guys from PastaQ reported the same installation issue, but it looks like they were able to find a fix with this PR.

I'm wondering whether a similar fix can be included here. Thanks!

@darsnack
Copy link
Member

darsnack commented Apr 3, 2022

Could you post a larger trace of your REPL like the PastaQ issue commenter? It's not clear what dependency is triggering the error.

I'm wondering whether a similar fix can be included here.

Probably not, since the fix there seemed to depend on SCS being an unnecessary dep anyways. That's probably not the case here.

In general, FluxML isn't officially making a concerted effort for M1 support at this stage. Though we can do what we can when the fix is clear.

@PhilipVinc
Copy link

It's unfortunate Flux does not support M1. More and more people are turning towards them.

Wouldn't it be possible to move the dependency that uses BinaryProvider to standard Artifacts?

@ToucheSir
Copy link
Member

I think we need to know which dependency that is first! NNlib itself doesn't do any binary or artifact management, and the direct deps seem simple enough to not immediately arouse suspicion.

@mcabbott
Copy link
Member

mcabbott commented Apr 5, 2022

Can confirm that Flux, and NNlib, should work on M1. Flux's tests don't finish, at least on Julia nightly, but haven't investigated why. You probably want 1.8beta or 1.9, not 1.7, though.

BinaryProvider doesn't show up as an indirect dependency: https://juliahub.com/ui/Packages/Flux/QdkVy/0.12.9?page=1 . I thought everything stopped using it years ago.

Sometimes package conflicts cause you to get a truly ancient version of some package. Can you post ]st to see what versions you have?

@VolodyaCO
Copy link
Author

So this is my environment:

(@v1.7) pkg>  st
      Status `~/.julia/environments/v1.7/Project.toml`
  [6e4b80f9] BenchmarkTools v1.3.1
  [98e50ef6] JuliaFormatter v0.22.7
  [438e738f] PyCall v1.93.1
  [6aa20fa7] TensorOperations v2.0.1

I tried installing NeuralQuantum.jl which depends on NNlib, and I saw the error above. However, I started a new julia environment. First I installed NNlib without any issue, and then I installed NeuralQuantum.jl without any issue too. Finally, from a fresh new environment I directly installed NeuralQuantum.jl and it installed without any issue as well... It seems that somehow my environment was poisoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants