The Julia Package manager¶
A key strength of Julia is that it is easy to reuse other peoples code. To facilitate this, Julia includes a package manager, named Pkg. Here are some of the things it does:
- adding and removing packages
- create project environments using Project.toml
- allow fully reproducible projects using Manifest.toml
- specifying compatibility with dependencies
- facilitate developing packages
Links¶
- Pkg documentation - https://julialang.github.io/Pkg.jl/v1/
- BinaryBuilder, package binary dependencies - https://binarybuilder.org/
- Package compiler, bundle relocatable projects - https://julialang.github.io/PackageCompiler.jl/dev/
- General package registry - https://github.com/JuliaRegistries/General/
- JuliaHub, browse available packages - https://juliahub.com/
versioninfo()
Julia Version 1.9.3 Commit bed2cd540a1 (2023-08-24 14:43 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (arm64-apple-darwin22.4.0) CPU: 10 × Apple M1 Max WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1) Threads: 9 on 8 virtual cores Environment: JULIA_NUM_THREADS = 8
Adding and removing packages¶
The most convenient way to use the package manager is to use the Pkg REPL-mode. To enter the Pkg REPL-mode in an interactive session, type ]
in the prompt. The prompt indicator will go from julia>
to pkg>
. In a Jupyter notebook, just start the cell with ]
for the same effect. Remember that with ]?
you can always get help on the Pkg REPL-mode, and ]?add
for specific help for add
, or any other command.
]?
Welcome to the Pkg REPL-mode. To return to the julia> prompt, either press backspace when the input line is empty or press Ctrl+C. Full documentation available at https://pkgdocs.julialang.org/ Synopsis pkg> cmd [opts] [args] Multiple commands can be given on the same line by interleaving a ; between the commands. Some commands have an alias, indicated below. Commands activate: set the primary environment the package manager manipulates add: add packages to project build: run the build script for packages compat: edit compat entries in the current Project and re-resolve develop, dev: clone the full package repo locally for development free: undoes a pin, develop, or stops tracking a repo gc: garbage collect packages not used for a significant time generate: generate files for a new project help, ?: show this message instantiate: downloads all the dependencies for the project pin: pins the version of packages precompile: precompile all the project dependencies redo: redo the latest change to the active project remove, rm: remove packages from project or manifest resolve: resolves to update the manifest from changes in dependencies of developed packages status, st: summarize contents of and changes to environment test: run tests for packages undo: undo the latest change to the active project update, up: update packages in manifest why: shows why a package is in the manifest registry add: add package registries registry remove, rm: remove package registries registry status, st: information about installed registries registry update, up: update package registries
You can add packages to your current environment using ]add Example
. It is also possible to add multiple packages at the same time, or specify a desired version. By default it will add the most recent version that is compatible with the packages that are already installed.
using Pkg
Pkg.add("UnicodePlots")
Updating registry at `~/.julia/registries/General.toml` Resolving package versions... No Changes to `~/code/Project.toml` Updating `~/code/Manifest.toml` [44cfe95a] ↑ Pkg v1.9.0 ⇒ v1.9.2 [e66e0078] ↑ CompilerSupportLibraries_jll v1.0.2+0 ⇒ v1.0.5+0 [8e850b90] ↑ libblastrampoline_jll v5.4.0+0 ⇒ v5.8.0+0 Precompiling project... ✓ Example ✓ ExprTools ✓ AbstractFFTs ✓ Compat ✓ IterTools ✓ LocalFilters ✓ Distances ✓ SentinelArrays ✓ MacroTools ✓ URIs ✓ CompositionsBase ✓ ArrowTypes ✓ Parameters ✓ ConstructionBase ✓ DataAPI ✓ TranscodingStreams ✓ Adapt ✓ StaticArraysCore ✓ MappedArrays ✓ LoggingExtras ✓ LogExpFunctions ✓ MLJModelInterface ✓ FillArrays ✓ GeoInterface ✓ LASzip_jll ✓ OpenSSL_jll ✓ Libmount_jll ✓ Graphite2_jll ✓ RecipesBase ✓ boost_jll ✓ FileIO ✓ Bzip2_jll ✓ Xorg_libXau_jll ✓ libfdk_aac_jll ✓ Rmath_jll ✓ Lz4_jll ✓ libpng_jll ✓ LAME_jll ✓ Pixman_jll ✓ IntelOpenMP_jll ✓ LERC_jll ✓ Xorg_libXdmcp_jll ✓ Ogg_jll ✓ x264_jll ✓ libaom_jll ✓ Zstd_jll ✓ fzf_jll ✓ x265_jll ✓ SQLite_jll ✓ JpegTurbo_jll ✓ Xorg_xtrans_jll ✓ LZO_jll ✓ Libiconv_jll ✓ Expat_jll ✓ GEOS_jll ✓ Opus_jll ✓ Libgpg_error_jll ✓ Wayland_protocols_jll ✓ Libffi_jll ✓ Kerberos_krb5_jll ✓ FFTW_jll ✓ Libuuid_jll ✓ SodiumSeal ✓ Xorg_libpthread_stubs_jll ✓ FriBidi_jll ✓ InlineStrings ✓ OpenSpecFun_jll ✓ Compat → CompatLinearAlgebraExt ✓ CommonSubexpressions ✓ PooledArrays ✓ Missings ✓ Tables ✓ CodecZlib ✓ DiffResults ✓ Latexify ✓ JSON3 ✓ Mocking ✓ FilePathsBase ✓ ChainRulesCore ✓ HDF5_jll ✓ Measurements ✓ GeoInterfaceRecipes ✓ OpenSSL ✓ LossFunctions ✓ MKL_jll ✓ FreeType2_jll ✓ Rmath ✓ Thrift_jll ✓ libvorbis_jll ✓ LibPQ_jll ✓ JLFzf ✓ Libgcrypt_jll ✓ XML2_jll ✓ snappy_jll ✓ WeakRefStrings ✓ Libtiff_jll ✓ StaticArrays ✓ TableOperations ✓ CategoricalArrays ✓ ZygoteRules ✓ AbstractFFTs → AbstractFFTsChainRulesCoreExt ✓ TypedTables ✓ DataStructures ✓ LogExpFunctions → LogExpFunctionsChainRulesCoreExt ✓ NetCDF_jll ✓ Gettext_jll ✓ EzXML ✓ XSLT_jll ✓ TimeZones ✓ Fontconfig_jll ✓ Wayland_jll ✓ DBFTables ✓ LittleCMS_jll ✓ PROJ_jll ✓ HTTP ✓ Arrow_jll ✓ ReferenceFrameRotations ✓ HDF5 ✓ GeometryTypes ✓ CoordinateTransformations ✓ Adapt → AdaptStaticArraysExt ✓ MarchingCubes ✓ ConstructionBase → StaticArraysExt ✓ PrettyTables ✓ NearestNeighbors ✓ SortingAlgorithms ✓ Xorg_libxcb_jll ✓ QuadGK ✓ XMLDict ✓ libgeotiff_jll ✓ Glib_jll ✓ OpenJpeg_jll ✓ SpecialFunctions ✓ OffsetArrays ✓ Shapefile ✓ ArrayInterface ✓ Proj ✓ Xorg_libX11_jll ✓ Xorg_xcb_util_jll ✓ LasIO ✓ Setfield ✓ GitHub ✓ DiffRules ✓ StatsBase ✓ DualNumbers ✓ TiledIteration ✓ SpecialFunctions → SpecialFunctionsChainRulesCoreExt ✓ FFTW ✓ CatIndices ✓ StackViews ✓ ColorVectorSpace ✓ CircularArrays ✓ PaddedViews ✓ Xorg_libXrender_jll ✓ DiskArrays ✓ ArrayInterface → ArrayInterfaceStaticArraysCoreExt ✓ Xorg_libXext_jll ✓ GDAL_jll ✓ Xorg_libXfixes_jll ✓ Xorg_libxkbfile_jll ✓ Xorg_xcb_util_image_jll ✓ Xorg_xcb_util_keysyms_jll ✓ Xorg_xcb_util_renderutil_jll ✓ Xorg_xcb_util_wm_jll ✓ SplittablesBase ✓ BangBang ✓ HypergeometricFunctions ✓ FFTViews ✓ DensityRatioEstimation ✓ LazIO ✓ AWS ✓ Libglvnd_jll ✓ Xorg_libXinerama_jll ✓ MosaicViews ✓ ForwardDiff ✓ FiniteDiff ✓ Xorg_libXrandr_jll ✓ Xorg_libXcursor_jll ✓ Xorg_libXi_jll ✓ Xorg_xkbcomp_jll ✓ Cairo_jll ✓ MicroCollections ✓ ColorSchemes ✓ Meshes ✓ Xorg_xkeyboard_config_jll ✓ GLFW_jll ✓ StatsFuns ✓ GDAL ✓ AWSS3 ✓ ForwardDiff → ForwardDiffStaticArraysExt ✓ xkbcommon_jll ✓ HarfBuzz_jll ✓ Unitful ✓ StatsFuns → StatsFunsChainRulesCoreExt ✓ Transducers ✓ Qt5Base_jll ✓ NLSolversBase ✓ libass_jll ✓ LineSearches ✓ Distributions ✓ PlotUtils ✓ FFMPEG_jll ✓ Distributions → DistributionsChainRulesCoreExt ✓ Optim ✓ FFMPEG ✓ PlotThemes ✓ GR_jll ✓ RecipesPipeline ✓ ScientificTypes ✓ DataFrames ✓ GR ✓ TableTransforms ✓ ImageCore ✓ ImageBase ✓ GeoStatsBase ✓ SpaceLiDAR ✓ ArchGDAL ✓ Variography ✓ KrigingEstimators ✓ UnicodePlots ✓ GeoStatsSolvers ? GeoArrays ✓ UnicodePlots → UnitfulExt ✓ GeoDataFrames ✓ PointCloudRasterizers ✓ Plots ✓ ImageFiltering ✓ Plots → FileIOExt ✓ Plots → UnitfulExt ✓ GeoArrayOps 229 dependencies successfully precompiled in 141 seconds. 77 already precompiled. 1 dependency failed but may be precompilable after restarting julia 3 dependencies had warnings during precompilation: ┌ Mocking [78c3b35d-d492-501b-9361-3d52fe80e533] │ ┌ Warning: The call to compilecache failed to create a usable precompiled cache file for CompatLinearAlgebraExt [dbe5ba0b-aecc-598a-a867-79051b540f49] │ │ exception = ArgumentError: Invalid checksum in cache file /Users/evetion/.julia/compiled/v1.9/CompatLinearAlgebraExt/Zxpzq_Q7dWR.dylib. │ └ @ Base loading.jl:1818 │ ┌ Error: Error during loading of extension CompatLinearAlgebraExt of Compat, use `Base.retry_load_extensions()` to retry. │ │ exception = │ │ 1-element ExceptionStack: │ │ Declaring __precompile__(false) is not allowed in files that are being precompiled. │ │ Stacktrace: │ │ [1] _require(pkg::Base.PkgId, env::Nothing) │ │ @ Base ./loading.jl:1825 │ │ [2] _require_prelocked(uuidkey::Base.PkgId, env::Nothing) │ │ @ Base ./loading.jl:1660 │ │ [3] _require_prelocked(uuidkey::Base.PkgId) │ │ @ Base ./loading.jl:1658 │ │ [4] run_extension_callbacks(extid::Base.ExtensionId) │ │ @ Base ./loading.jl:1255 │ │ [5] run_extension_callbacks(pkgid::Base.PkgId) │ │ @ Base ./loading.jl:1290 │ │ [6] run_package_callbacks(modkey::Base.PkgId) │ │ @ Base ./loading.jl:1124 │ │ [7] _require_prelocked(uuidkey::Base.PkgId, env::String) │ │ @ Base ./loading.jl:1667 │ │ [8] macro expansion │ │ @ ./loading.jl:1648 [inlined] │ │ [9] macro expansion │ │ @ ./lock.jl:267 [inlined] │ │ [10] require(into::Module, mod::Symbol) │ │ @ Base ./loading.jl:1611 │ │ [11] include │ │ @ ./Base.jl:457 [inlined] │ │ [12] 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:2049 │ │ [13] top-level scope │ │ @ stdin:3 │ │ [14] eval │ │ @ ./boot.jl:370 [inlined] │ │ [15] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String) │ │ @ Base ./loading.jl:1903 │ │ [16] include_string │ │ @ ./loading.jl:1913 [inlined] │ │ [17] exec_options(opts::Base.JLOptions) │ │ @ Base ./client.jl:305 │ │ [18] _start() │ │ @ Base ./client.jl:522 │ └ @ Base loading.jl:1261 └ ┌ ChainRulesCore [d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4] │ ┌ Warning: The call to compilecache failed to create a usable precompiled cache file for CompatLinearAlgebraExt [dbe5ba0b-aecc-598a-a867-79051b540f49] │ │ exception = ArgumentError: Invalid checksum in cache file /Users/evetion/.julia/compiled/v1.9/CompatLinearAlgebraExt/Zxpzq_Q7dWR.dylib. │ └ @ Base loading.jl:1818 │ ┌ Error: Error during loading of extension CompatLinearAlgebraExt of Compat, use `Base.retry_load_extensions()` to retry. │ │ exception = │ │ 1-element ExceptionStack: │ │ Declaring __precompile__(false) is not allowed in files that are being precompiled. │ │ Stacktrace: │ │ [1] _require(pkg::Base.PkgId, env::Nothing) │ │ @ Base ./loading.jl:1825 │ │ [2] _require_prelocked(uuidkey::Base.PkgId, env::Nothing) │ │ @ Base ./loading.jl:1660 │ │ [3] _require_prelocked(uuidkey::Base.PkgId) │ │ @ Base ./loading.jl:1658 │ │ [4] run_extension_callbacks(extid::Base.ExtensionId) │ │ @ Base ./loading.jl:1255 │ │ [5] run_extension_callbacks(pkgid::Base.PkgId) │ │ @ Base ./loading.jl:1290 │ │ [6] run_package_callbacks(modkey::Base.PkgId) │ │ @ Base ./loading.jl:1124 │ │ [7] _require_prelocked(uuidkey::Base.PkgId, env::String) │ │ @ Base ./loading.jl:1667 │ │ [8] macro expansion │ │ @ ./loading.jl:1648 [inlined] │ │ [9] macro expansion │ │ @ ./lock.jl:267 [inlined] │ │ [10] require(into::Module, mod::Symbol) │ │ @ Base ./loading.jl:1611 │ │ [11] include │ │ @ ./Base.jl:457 [inlined] │ │ [12] 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:2049 │ │ [13] top-level scope │ │ @ stdin:3 │ │ [14] eval │ │ @ ./boot.jl:370 [inlined] │ │ [15] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String) │ │ @ Base ./loading.jl:1903 │ │ [16] include_string │ │ @ ./loading.jl:1913 [inlined] │ │ [17] exec_options(opts::Base.JLOptions) │ │ @ Base ./client.jl:305 │ │ [18] _start() │ │ @ Base ./client.jl:522 │ └ @ Base loading.jl:1261 └ ┌ GeoArrays [2fb1d81b-e6a0-5fc5-82e6-8e06903437ab] │ ┌ Warning: The call to compilecache failed to create a usable precompiled cache file for ArchGDAL [c9ce4bd3-c3d5-55b8-8973-c0e20141b8c3] │ │ exception = ArgumentError: Invalid checksum in cache file /Users/evetion/.julia/compiled/v1.9/ArchGDAL/MCIiB_Q7dWR.dylib. │ └ @ Base loading.jl:1818 └
When packages are added to an environment, they can directly be used. The first time a (new version of a) package is loaded, it will precompile the code, to make it faster to load in the future. If you want, you can also force this to happen for all packages using ]precompile
.
using UnicodePlots
UnicodePlots is a fun package, which allows making plots composed entirely of text characters. We can try it out by generating 10 thousand normally distributed random numbers, and making a histogram.
histogram(randn(10_000))
┌ ┐ [-3.5, -3.0) ┤▎ 10 [-3.0, -2.5) ┤▊ 48 [-2.5, -2.0) ┤██▍ 144 [-2.0, -1.5) ┤███████▌ 448 [-1.5, -1.0) ┤███████████████▌ 926 [-1.0, -0.5) ┤████████████████████████▌ 1 470 [-0.5, 0.0) ┤███████████████████████████████▎ 1 872 [ 0.0, 0.5) ┤█████████████████████████████████ 1 980 [ 0.5, 1.0) ┤████████████████████████▍ 1 460 [ 1.0, 1.5) ┤███████████████▍ 923 [ 1.5, 2.0) ┤███████▋ 459 [ 2.0, 2.5) ┤███▏ 182 [ 2.5, 3.0) ┤█▏ 63 [ 3.0, 3.5) ┤▎ 14 [ 3.5, 4.0) ┤▏ 1 └ ┘ Frequency
Note that packages can rely on binaries. This is integrated into the design of Pkg, to provide a smooth installation experience. So, for example, people installing the Julia wrapper for the GDAL library, will automatically download a compatible GDAL installation compiled for their system. This is not installed globally, so will not interfere with the rest of the system. See https://binarybuilder.org/ to learn more about how this system works.
Working with environments¶
When collaborating on a project, you want it to work the same on everyones computer. However, the default environment probably looks different for everybody, depending on the packages they have installed. This can mean not everyone has the same version of packages your project depends on. Not great for reproducible science!
Luckily Julia's package manager has the concept of environments. They can be created using ]activate path
, where path is the directory where the project is located, so ]activate .
creates an environment in the current directory.
]activate MyJuliaProject
Activating new project at `~/code/OGH2023/MyJuliaProject`
Now you can add packages that your project relies on. Note that if the same version of the package is already installed on your computer, for instance in another environment, it will use the same copy, to save space.
]add Example
Resolving package versions... Updating `~/code/OGH2023/MyJuliaProject/Project.toml` [7876af07] + Example v0.5.3 Updating `~/code/OGH2023/MyJuliaProject/Manifest.toml` [7876af07] + Example v0.5.3
To see the packages added to your current environment, use ]status
, or use ]status Example
to only display a single package.
]status
Status `~/code/OGH2023/MyJuliaProject/Project.toml` [7876af07] Example v0.5.3
The state of your environment is captured in two files, the Project.toml
and Manifest.toml
files. We can print out their contents below.
println(read("MyJuliaProject/Project.toml", String))
[deps] Example = "7876af07-990d-54b4-ab0e-23690620f79a"
println(read("MyJuliaProject/Manifest.toml", String))
# This file is machine-generated - editing it directly is not advised julia_version = "1.9.3" manifest_format = "2.0" project_hash = "2ca1c6c58cb30e79e021fb54e5626c96d05d5fdc" [[deps.Example]] git-tree-sha1 = "46e44e869b4d90b96bd8ed1fdcf32244fddfb6cc" uuid = "7876af07-990d-54b4-ab0e-23690620f79a" version = "0.5.3"
In short, the Project.toml
file lists the dependencies under a [deps]
section. It also supports other entries that can be added manually, for instance to add metadata or specify compatibility. The Manifest.toml
specifies exactly which versions of both direct and indirect dependencies are used. If you share a Manifest.toml
with someone, and someone uses ]instantiate
on it, they will be able to run your project with exactly the same dependencies.
More information can be found in these chapters of the documentation:
Binary packages¶
We stand on the shoulders of giants. This goes for most research, but also for our geospatial stack. Everyone uses GDAL, GEOS and PROJ directly, or indirectly. These C(++) packages need to be compiled to work on our systems and this has often been difficult. In Julia, we've tried to solve this, much like conda does, but more built into the language itself.
]add GDAL
Resolving package versions... Updating `~/code/OGH2023/MyJuliaProject/Project.toml` [add2ef01] + GDAL v1.6.0 Updating `~/code/OGH2023/MyJuliaProject/Manifest.toml` [fa961155] + CEnum v0.4.2 [add2ef01] + GDAL v1.6.0 [692b3bcd] + JLLWrappers v1.5.0 [21216c6a] + Preferences v1.4.0 [8ce61222] + Arrow_jll v10.0.0+1 [6e34b625] + Bzip2_jll v1.0.8+0 [2e619515] + Expat_jll v2.5.0+0 [a7073274] + GDAL_jll v301.600.200+0 [d604d12d] + GEOS_jll v3.11.2+0 ⌅ [0234f1f7] + HDF5_jll v1.12.2+2 [aacddb02] + JpegTurbo_jll v2.1.91+0 [b39eb1a6] + Kerberos_krb5_jll v1.19.3+0 [88015f11] + LERC_jll v3.0.0+1 [dd4b983a] + LZO_jll v2.10.1+0 [08be9ffa] + LibPQ_jll v14.3.0+1 [94ce4f54] + Libiconv_jll v1.16.1+2 ⌅ [89763e89] + Libtiff_jll v4.4.0+0 [d3a379c0] + LittleCMS_jll v2.12.0+0 [5ced341a] + Lz4_jll v1.9.3+0 ⌃ [7243133f] + NetCDF_jll v400.902.206+0 [643b3616] + OpenJpeg_jll v2.4.0+0 ⌅ [458c3c95] + OpenSSL_jll v1.1.22+0 ⌅ [58948b4f] + PROJ_jll v900.100.0+0 [76ed43ae] + SQLite_jll v3.42.0+0 [e0b8ae26] + Thrift_jll v0.16.0+0 [02c8fc9c] + XML2_jll v2.10.3+0 [3161d3a3] + Zstd_jll v1.5.5+0 ⌅ [28df3c45] + boost_jll v1.76.0+1 ⌃ [06c338fa] + libgeotiff_jll v100.700.100+0 [b53b4c65] + libpng_jll v1.6.38+0 [fe1e1685] + snappy_jll v1.1.9+1 [0dad84c5] + ArgTools v1.1.1 [56f22d72] + Artifacts [2a0f44e3] + Base64 [ade2ca70] + Dates [f43a241f] + Downloads v1.6.0 [7b1f6079] + FileWatching [b77e0a4c] + InteractiveUtils [b27032c2] + LibCURL v0.6.3 [76f85450] + LibGit2 [8f399da3] + Libdl [56ddb016] + Logging [d6f4376e] + Markdown [ca575930] + NetworkOptions v1.2.0 [44cfe95a] + Pkg v1.9.2 [de0858da] + Printf [3fa0cd96] + REPL [9a3f8284] + Random [ea8e919c] + SHA v0.7.0 [9e88b42a] + Serialization [6462fe0b] + Sockets [fa267f1f] + TOML v1.0.3 [a4e569a6] + Tar v1.10.0 [cf7118a7] + UUIDs [4ec0a83e] + Unicode [e66e0078] + CompilerSupportLibraries_jll v1.0.5+0 [deac9b47] + LibCURL_jll v7.84.0+0 [29816b5a] + LibSSH2_jll v1.10.2+0 [c8ffd9c3] + MbedTLS_jll v2.28.2+0 [14a3606d] + MozillaCACerts_jll v2022.10.11 [83775a58] + Zlib_jll v1.2.13+0 [8e850ede] + nghttp2_jll v1.48.0+0 [3f19e933] + p7zip_jll v17.4.0+0 Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated -m` Precompiling project... ✓ NetCDF_jll ✓ GDAL_jll ✓ GDAL 3 dependencies successfully precompiled in 7 seconds. 33 already precompiled.
]test GDAL
Testing GDAL Status `/private/var/folders/w_/152mmjvx4cx7y55ky886tp1h0000gn/T/jl_o3cHAt/Project.toml` [fa961155] CEnum v0.4.2 [add2ef01] GDAL v1.6.0 [a7073274] GDAL_jll v301.600.200+0 ⌅ [58948b4f] PROJ_jll v900.100.0+0 [ca575930] NetworkOptions v1.2.0 `@stdlib/NetworkOptions` [8dfed614] Test `@stdlib/Test` Status `/private/var/folders/w_/152mmjvx4cx7y55ky886tp1h0000gn/T/jl_o3cHAt/Manifest.toml` [fa961155] CEnum v0.4.2 [add2ef01] GDAL v1.6.0 [692b3bcd] JLLWrappers v1.5.0 [21216c6a] Preferences v1.4.0 [8ce61222] Arrow_jll v10.0.0+1 [6e34b625] Bzip2_jll v1.0.8+0 [2e619515] Expat_jll v2.5.0+0 [a7073274] GDAL_jll v301.600.200+0 [d604d12d] GEOS_jll v3.11.2+0 ⌅ [0234f1f7] HDF5_jll v1.12.2+2 [aacddb02] JpegTurbo_jll v2.1.91+0 [b39eb1a6] Kerberos_krb5_jll v1.19.3+0 [88015f11] LERC_jll v3.0.0+1 [dd4b983a] LZO_jll v2.10.1+0 [08be9ffa] LibPQ_jll v14.3.0+1 [94ce4f54] Libiconv_jll v1.16.1+2 ⌅ [89763e89] Libtiff_jll v4.4.0+0 [d3a379c0] LittleCMS_jll v2.12.0+0 [5ced341a] Lz4_jll v1.9.3+0 ⌃ [7243133f] NetCDF_jll v400.902.206+0 [643b3616] OpenJpeg_jll v2.4.0+0 ⌅ [458c3c95] OpenSSL_jll v1.1.22+0 ⌅ [58948b4f] PROJ_jll v900.100.0+0 [76ed43ae] SQLite_jll v3.42.0+0 [e0b8ae26] Thrift_jll v0.16.0+0 [02c8fc9c] XML2_jll v2.10.3+0 [3161d3a3] Zstd_jll v1.5.5+0 ⌅ [28df3c45] boost_jll v1.76.0+1 ⌃ [06c338fa] libgeotiff_jll v100.700.100+0 [b53b4c65] libpng_jll v1.6.38+0 [fe1e1685] snappy_jll v1.1.9+1 [0dad84c5] ArgTools v1.1.1 `@stdlib/ArgTools` [56f22d72] Artifacts `@stdlib/Artifacts` [2a0f44e3] Base64 `@stdlib/Base64` [ade2ca70] Dates `@stdlib/Dates` [f43a241f] Downloads v1.6.0 `@stdlib/Downloads` [7b1f6079] FileWatching `@stdlib/FileWatching` [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils` [b27032c2] LibCURL v0.6.3 `@stdlib/LibCURL` [76f85450] LibGit2 `@stdlib/LibGit2` [8f399da3] Libdl `@stdlib/Libdl` [56ddb016] Logging `@stdlib/Logging` [d6f4376e] Markdown `@stdlib/Markdown` [ca575930] NetworkOptions v1.2.0 `@stdlib/NetworkOptions` [44cfe95a] Pkg v1.9.2 `@stdlib/Pkg` [de0858da] Printf `@stdlib/Printf` [3fa0cd96] REPL `@stdlib/REPL` [9a3f8284] Random `@stdlib/Random` [ea8e919c] SHA v0.7.0 `@stdlib/SHA` [9e88b42a] Serialization `@stdlib/Serialization` [6462fe0b] Sockets `@stdlib/Sockets` [fa267f1f] TOML v1.0.3 `@stdlib/TOML` [a4e569a6] Tar v1.10.0 `@stdlib/Tar` [8dfed614] Test `@stdlib/Test` [cf7118a7] UUIDs `@stdlib/UUIDs` [4ec0a83e] Unicode `@stdlib/Unicode` [e66e0078] CompilerSupportLibraries_jll v1.0.5+0 `@stdlib/CompilerSupportLibraries_jll` [deac9b47] LibCURL_jll v7.84.0+0 `@stdlib/LibCURL_jll` [29816b5a] LibSSH2_jll v1.10.2+0 `@stdlib/LibSSH2_jll` [c8ffd9c3] MbedTLS_jll v2.28.2+0 `@stdlib/MbedTLS_jll` [14a3606d] MozillaCACerts_jll v2022.10.11 `@stdlib/MozillaCACerts_jll` [83775a58] Zlib_jll v1.2.13+0 `@stdlib/Zlib_jll` [8e850ede] nghttp2_jll v1.48.0+0 `@stdlib/nghttp2_jll` [3f19e933] p7zip_jll v17.4.0+0 `@stdlib/p7zip_jll` Info Packages marked with ⌃ and ⌅ have new versions available, but those with ⌅ are restricted by compatibility constraints from upgrading. Precompiling project... ✓ JLLWrappers ✓ Bzip2_jll ✓ LZO_jll ✓ GEOS_jll ✓ Expat_jll ✓ Libiconv_jll ✓ OpenSSL_jll ✓ Lz4_jll ✓ libpng_jll ✓ boost_jll ✓ Kerberos_krb5_jll ✓ LERC_jll ✓ Zstd_jll ✓ JpegTurbo_jll ✓ SQLite_jll ✓ snappy_jll ✓ XML2_jll ✓ Thrift_jll ✓ HDF5_jll ✓ LibPQ_jll ✓ Libtiff_jll ✓ NetCDF_jll ✓ Arrow_jll ✓ LittleCMS_jll ✓ PROJ_jll ✓ libgeotiff_jll ✓ OpenJpeg_jll ✓ GDAL_jll ✓ GDAL 29 dependencies successfully precompiled in 13 seconds. 6 already precompiled. Testing Running tests... ┌ Info: GDAL 3.6.2, released 2023/01/02 │ 195 GDAL drivers found └ 68 OGR drivers found ┌ Warning: gdalinfo_path() is deprecated, use the non-do-block form │ caller = ip:0x0 └ @ Core :-1 Test Summary: | Pass Total Time GDAL | 146 146 3.2s Testing GDAL tests passed
Developing a package¶
How to create your own package or make changes to someone elses package is out of scope for this tutorial. We can give you some references however.
If you want to make changes to an existing package, you can run ]dev Example
to put the git repository in your home directory under .julia/dev/Example
. See also the usage example of the Revise package linked below.
- Revise.jl https://timholy.github.io/Revise.jl/stable/
- Look at a simple example package for how to structure code https://github.com/JuliaLang/Example.jl
- Video tutorial on developing Julia packages https://youtu.be/QVmU29rCjaA
- This automates creating packages including testing services and more https://github.com/invenia/PkgTemplates.jl
Exercise¶
Use https://juliahub.com/ui/Search?q=&type=packages, https://discourse.julialang.org/ or simply a web search to browse and find packages that seem interesting to you, and install them using the package manager.
If you have time, you can use the documentation or GitHub page of a package to try it out.
This is intended simply as an open ended exercise to make you more familiar with discovering and installing packages.
To help, here is a small list of packages that some of you may be interested in:
- ShallowWaters - hydrodynamic model
- Oceananigans - hydrodynamic model
- MPI - parallel computing
- ArchGDAL - geospatial data
- NCDatasets - NetCDF data
- GeometryBasics - geometry primitives
- MLJ - machine learning
- Turing - probabilistic programming
- Flux - deep learning
- Unitful - track units
- Measurements - track uncertainty
- DataAssim - data assimilation
- GeoStats - geostatistics