# BinaryBuilder specifying strict dependencies versions

**URL:** <https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739>\
**Category:** General Usage\
**Tags:** question, binarybuilder\
**Created:** [June 1, 2023, 6:19pm UTC](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739 "2023-06-01T18:19:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vfonov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vfonov/32/31828_2.png) [@vfonov](https://discourse.julialang.org/u/vfonov)\
**Post date:** [June 1, 2023, 6:19pm UTC](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739/1 "2023-06-01T18:19:49Z")

</div>

I have a small binary package, that I am building with BinaryBuilder, it links to HDF5 and NetCDF4.  
I would like to specify exact versions of these packages, currently I am using following code:

```julia
...
Dependency(PackageSpec(;name="HDF5_jll", uuid="0234f1f7-429e-5d53-9886-15a909be8d59"),v"1.12.2+2",compat="1.12.2"),
Dependency(PackageSpec(;name="NetCDF_jll",uuid="7243133f-43d8-5620-bbf4-c2c921802cf3"),v"400.902.5+1",compat="400.902.5"), #
...

```

However, when I install the package (julia version 1.9.0) it installs HDF5\_jll version **1.14.0+0** and NetCDF\_jll version **400.902.208+0**  
Consequently, when I try using my package, I am receiving an error: _libhdf5.so.200: cannot open shared object file: No such file or directory_

So, what’s the correct way to pin the binary dependency ?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [June 1, 2023, 6:36pm UTC](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739/2 "2023-06-01T18:36:13Z")

</div>

The problem is that hdf5 breaks the ABI nilly willy between minor versions (please direct any complaints about this to the upstream developers, we have no control over that), so you can either be compatible with hdf5 1.12 _or_ 1.14. You don’t have the same problem with netcdf, I think. The `compat` argument uses the [Pkg compat syntax](https://pkgdocs.julialang.org/v1/compatibility/), so you can use

```julia
Dependency(PackageSpec(;name="HDF5_jll", uuid="0234f1f7-429e-5d53-9886-15a909be8d59"); compat="~1.14.0"),
Dependency(PackageSpec(;name="NetCDF_jll",uuid="7243133f-43d8-5620-bbf4-c2c921802cf3"); compat="400.902.208"),

```

---

<div class="post-metadata">

**Author:** ![vfonov](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vfonov/32/31828_2.png) [@vfonov](https://discourse.julialang.org/u/vfonov)\
**Post date:** [June 1, 2023, 6:53pm UTC](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739/3 "2023-06-01T18:53:50Z")

</div>

Thank you, that works!
