torrance / Casacore.jl

A high level Julia interface to Casacore
MIT License
9 stars 0 forks source link

Error precompiling #6

Closed david-macmahon closed 1 year ago

david-macmahon commented 1 year ago

I can ]add Casacore (v 0.2.0) in Julia 1.8.3 , but when it tries to precompile it gives this error:

julia> import Pkg; Pkg.precompile()
Precompiling project...
  ✗ Casacore
  0 dependencies successfully precompiled in 1 seconds. 381 already precompiled.

ERROR: The following 1 direct dependency failed to precompile:

Casacore [72bb1062-94f5-49fa-bb69-94b615203ad9]

Failed to precompile Casacore [72bb1062-94f5-49fa-bb69-94b615203ad9] to /Users/davidm/.julia/compiled/v1.8/Casacore/jl_pJbmQl.
ERROR: LoadError: UndefVarError: libcasacorecxx not defined
Stacktrace:
 [1] top-level scope
   @ ~/.julia/packages/Casacore/Xzq3F/src/LibCasacore.jl:7
 [2] include(mod::Module, _path::String)
   @ Base ./Base.jl:419
 [3] include(x::String)
   @ Casacore ~/.julia/packages/Casacore/Xzq3F/src/Casacore.jl:1
 [4] top-level scope
   @ ~/.julia/packages/Casacore/Xzq3F/src/Casacore.jl:3
 [5] include
   @ ./Base.jl:419 [inlined]
 [6] 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::Nothing)
   @ Base ./loading.jl:1554
 [7] top-level scope
   @ stdin:1
in expression starting at /Users/davidm/.julia/packages/Casacore/Xzq3F/src/LibCasacore.jl:1
in expression starting at /Users/davidm/.julia/packages/Casacore/Xzq3F/src/Casacore.jl:1
in expression starting at stdin:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/Types.jl:67
 [2] precompile(ctx::Pkg.Types.Context, pkgs::Vector{String}; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:1432
 [3] precompile
   @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:1063 [inlined]
 [4] #precompile#225
   @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:1062 [inlined]
 [5] precompile (repeats 2 times)
   @ /Applications/Julia-1.8.app/Contents/Resources/julia/share/julia/stdlib/v1.8/Pkg/src/API.jl:1062 [inlined]
 [6] top-level scope
   @ REPL[26]:1

Here is my version info:

julia> versioninfo()
Julia Version 1.8.3
Commit 0434deb161e (2022-11-14 20:14 UTC)
Platform Info:
  OS: macOS (arm64-apple-darwin21.3.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores

Is this due to lack of M2 support in casacore itself? If it can't (yet) work, it would at least be nice to get a friendlier error message.

torrance commented 1 year ago

Hi David, thanks for the bug report.

The error you're seeing is because the casacorecxx binary for your system is missing. Now, I haven't tested this on an ARM system but from the build instructions I'm reading for casacore_jll and casacorecxx_jll, it seems like we should be building for a system if:

So I think (??) actually this should work on MacOS/M{1,2}. I should get a chance this weekend to test properly on that hardware.

torrance commented 1 year ago

After a little investigation, it turns out the requirement libc == glibc essentially blocked macOS builds of casacorecxx_jll.

@david-macmahon I have posted a PR to enable macOS builds, and once this is accepted, I'll ask if you could update casacorecxx_jll and run the test suite to see how things go.

torrance commented 1 year ago

@david-macmahon The package has been rebuilt. From the Pkg REPL, run pkg> up Casacore and then run pkg> test Casacore and let me know if the test suite passes on macOS aarch64.

david-macmahon commented 1 year ago

Thanks! It passed the tests on my MacBook Air M2 laptop (see above for versioninfo() output). Here's what I got:

     Testing Running tests...
Test Summary: | Pass  Broken  Total  Time
Casacore.jl   |  188       1    189  8.2s
     Testing Casacore tests passed 
torrance commented 1 year ago

Great news!