# NCDatasets precompile error

**URL:** <https://discourse.julialang.org/t/ncdatasets-precompile-error/81132>\
**Category:** General Usage\
**Tags:** package, error, precompilation\
**Created:** [May 16, 2022, 6:36am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132 "2022-05-16T06:36:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [May 16, 2022, 6:36am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/1 "2022-05-16T06:36:18Z")

</div>

`pkg> add NCDatasets` gave an error message `1 dependency errored. To see a full report either run import Pkg; Pkg.precompile()`.

So, I did `import Pkg; Pkg.precompile()` and got the messages at the bottom.

I use macOS Catalina (10.15.7) and install julia by homebrew. It’s Julia stable 1.7.2.

How can one solve this problem?

* * *

```julia
Precompiling project...
  ✗ NCDatasets
  0 dependencies successfully precompiled in 2 seconds (15 already precompiled)

ERROR: The following 1 direct dependency failed to precompile:

NCDatasets [85f8d34a-cbdd-5861-8df4-14fed0d494ab]

Failed to precompile NCDatasets [85f8d34a-cbdd-5861-8df4-14fed0d494ab] to /Users/furue/.julia/compiled/v1.7/NCDatasets/jl_l1MBJh.
ERROR: LoadError: InitError: could not load library "/Users/furue/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib"
dlopen(/Users/furue/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib, 1): Library not loaded: @rpath/libmbedtls.13.dylib
  Referenced from: /Users/furue/.julia/artifacts/0b92c3ca1de2e9dc46a381553278edd25af54980/lib/libnetcdf.18.dylib
  Reason: image not found
Stacktrace:
  [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
    @ Base.Libc.Libdl ./libdl.jl:117
  [2] dlopen(s::String, flags::UInt32)
    @ Base.Libc.Libdl ./libdl.jl:117
  [3] macro expansion
    @ ~/.julia/packages/JLLWrappers/QpMQW/src/products/library_generators.jl:54 [inlined]
  [4] __init__ ()
    @ NetCDF_jll ~/.julia/packages/NetCDF_jll/xjKDT/src/wrappers/x86_64-apple-darwin.jl:14
  [5] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:768
  [6] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:854
  [7] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:1097
  [8] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:1013
  [9] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:997
 [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::Nothing)
    @ 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
during initialization of module NetCDF_jll
in expression starting at /Users/furue/.julia/packages/NCDatasets/XVX8L/src/NCDatasets.jl:1
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types /usr/local/Cellar/julia/1.7.2/share/julia/stdlib/v1.7/Pkg/src/Types.jl:68
 [2] precompile(ctx::Pkg.Types.Context; internal_call::Bool, strict::Bool, warn_loaded::Bool, already_instantiated::Bool, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Pkg.API /usr/local/Cellar/julia/1.7.2/share/julia/stdlib/v1.7/Pkg/src/API.jl:1362
 [3] precompile
   @ /usr/local/Cellar/julia/1.7.2/share/julia/stdlib/v1.7/Pkg/src/API.jl:1013 [inlined]
 [4] #precompile#220
   @ /usr/local/Cellar/julia/1.7.2/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011 [inlined]
 [5] precompile()
   @ Pkg.API /usr/local/Cellar/julia/1.7.2/share/julia/stdlib/v1.7/Pkg/src/API.jl:1011
 [6] top-level scope
   @ REPL[6]:1

```

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 16, 2022, 7:51am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/2 "2022-05-16T07:51:57Z")

</div>

It’s impossible to support Homebrew Julia here since we cannot control their build process or how they integrate with dependencies.

Could you try with a version from [Download Julia](https://julialang.org/downloads/) and see if you still have the same problem? If the problem goes away, please report the issue to Homebrew.

---

<div class="post-metadata">

**Author:** ![skleinbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/skleinbo/32/36080_2.png) [@skleinbo](https://discourse.julialang.org/u/skleinbo)\
**Post date:** [May 16, 2022, 8:00am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/3 "2022-05-16T08:00:10Z")

</div>

Indeed seems to be an issue with Homebrew.

[https://github.com/Alexander-Barth/NCDatasets.jl/issues/153](https://github.com/Alexander-Barth/NCDatasets.jl/issues/153)

I find [`juliaup`](https://github.com/JuliaLang/juliaup) to work very well on MacOS, despite it being marked as prerelease.

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [May 16, 2022, 9:22am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/4 "2022-05-16T09:22:57Z")

</div>

Thank you folks for your help!

I naïvely thought the Homebrew package of Julia was a very thin wrapper around the official Julia package.

Instead of the regular Homebrew Julia package, I switched to the “cask” version of Homebrew, which, if I understand correctly, just downloads the official Julia package and install it.

This cask version works! (`NCDatasets` is installed.)

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 16, 2022, 1:35pm UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/5 "2022-05-16T13:35:09Z")

</div>

From Homebrew, I recommend juliaup: [Homebrew Formulae: juliaup](https://formulae.brew.sh/formula/juliaup) . Juliaup will download official built Julia and keep you up to date.

> [@\[ANN\] Juliaup Preview - Julia version manager and Windows Store installer](https://discourse.julialang.org/t/ann-juliaup-preview-julia-version-manager-and-windows-store-installer/61920):
>
> I am looking for some brave Windows users that are willing to test drive a new installer for Julia on Windows that is called Juliaup. Juliaup is a new Julia version manager for Windows that is distributed via the Windows Store and manages your Julia installation on Windows. Juliaup makes it easy to keep your Julia installation up-to-date and to manage multiple Julia versions on one system. Juliaup is currently in preview, but should be fairly stable and ready for real world usage. If you want …

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [May 17, 2022, 6:25am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/6 "2022-05-17T06:25:14Z")

</div>

> juliaup

Thank you for the information! I’ve also just realized that @skleinbo also mentioned it.

Now, I’m really confused. There are three different packages of Julia for Homebrew.

juliaup offers “stable 1.6.1” whereas the regular julia package and its cask version offer “stable 1.7.2”. I don’t care (so far) about backward compatibility and so I’d like to stick to a reasonably new Julia version.

Also, I don’t know details of differences between the regular and cask packages.

Perhaps I should start a new thread “What are the differences between Homebrew Julia packages?”

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 17, 2022, 7:16am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/7 "2022-05-17T07:16:47Z")

</div>

The version 1.6.1 is for `juliaup` not for Julia. `juliaup` can manage multiple Julia versions for you:

> **[GitHub - JuliaLang/juliaup: Julia installer and version multiplexer](https://github.com/JuliaLang/juliaup)**
>
> Julia installer and version multiplexer. Contribute to JuliaLang/juliaup development by creating an account on GitHub.

juliaup 1.6.1 is capable of installing Julia 1.7.2 for you. It will also update you to 1.7.3 or 1.8.0 when they are released.

---

<div class="post-metadata">

**Author:** ![ryofurue](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ryofurue/32/24531_2.png) [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Post date:** [May 17, 2022, 7:55am UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/8 "2022-05-17T07:55:28Z")

</div>

> The version 1.6.1 is for `juliaup` not for Julia

Oops. I see. Thank you for your help. I’ve just switched to the `juliaup` package. It’s working.

We find this wording:

> Note that the Mac and Linux version are considered prerelease, have known bugs and might often break.

I suppose that what is a prerelease is the `juliaup` package, not the Julia language compiler which is installed by `juilaup` by default. Is that correct?

Although I want the compiler to be “reasonably” up to date, I’d hesitate to use an unstable compiler. As I understand, `juliaup`, by default, follows the latest stable releases. This is a nice default.

---

<div class="post-metadata">

**Author:** ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Post date:** [May 17, 2022, 1:12pm UTC](https://discourse.julialang.org/t/ncdatasets-precompile-error/81132/9 "2022-05-17T13:12:09Z")

</div>

The software, in Rust, was initially released as a Julia manager in the Windows store. The red extension to other platforms came later.

Please take a look at [GitHub - JuliaLang/juliaup: Julia installer and version multiplexer](https://github.com/JuliaLang/juliaup)  
regarding any outstanding issues.
