Why do package.jl depend on package_jll

Why do package.jl often depend on package_jll?
Isn’t the jll just a wrapper around the .jl?

No, a jll is a wrapper around a library written in another language like C or rust or Fortran. Often there will be a similarly named .jl package which depends on the jll and provides a nicer API for that library.

4 Likes

You can read more about the JLL’s packages in the BinaryBuilder.jl’s documentation.

1 Like

To expand a little further on this, the typical packaging of a foreign library in Julia follows these steps:

  1. Build the library for different platforms (combination of OS and CPU variants) via cross-compilation using BinaryBuilder.jl. This produces platform specific artifacts, compressed archives containing the libraries, binaries etc. that came out of the build.
  2. Make a JLL package which contains information needed for Julia to download the right artifact for the platform being used, plus a minimal wrapper for the library.
  3. Make a normal Julia package, which provides a more user friendly Julia API to the library.

Steps 1 and 2 are in the majority of cases orchestrated by the repository GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl. Step 1 requires information about sources, what to build and how to build it. Step 2 is fully automated.

Step 3 is optional and usually done for user-facing packages where there is enough value in providing a more Julia-native interface.

5 Likes