# How to properly reference binary dependencies during builds with BinaryBuilder?

**URL:** <https://discourse.julialang.org/t/how-to-properly-reference-binary-dependencies-during-builds-with-binarybuilder/35008>\
**Category:** Tooling\
**Tags:** binarybuilder\
**Created:** [February 22, 2020, 7:52am UTC](https://discourse.julialang.org/t/how-to-properly-reference-binary-dependencies-during-builds-with-binarybuilder/35008 "2020-02-22T07:52:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)\
**Post date:** [February 22, 2020, 7:52am UTC](https://discourse.julialang.org/t/how-to-properly-reference-binary-dependencies-during-builds-with-binarybuilder/35008/1 "2020-02-22T07:52:29Z")

</div>

I am trying to wrap a library with BinaryBuilder that depends on libz. If I use the wizard, specifying “Zlib” as a dependency, I actually do get all the library files from zlib in my workspace that I need. However, for my library to find the dependencies, I seem to have to pass the full path to the library dependency to configure, like so:

```bash
CFLAGS=-I/workspace/artifacts/7846a2956a213715c2c76632f3461cef87d9d545/include \
LDFLAGS=-L/workspace/artifacts/7846a2956a213715c2c76632f3461cef87d9d545/lib \
./configure ...

```

However, the exact artifacts path changes from platform to platform, thus I have no way to write a build script that is portable and looks sane. I checked other libraries that have binary dependencies (e.g., [Yggdrasil/build\_tarballs.jl at 029e588412f232f215e5e6a7564693d3dbf8e922 · JuliaPackaging/Yggdrasil · GitHub](https://github.com/JuliaPackaging/Yggdrasil/blob/029e588412f232f215e5e6a7564693d3dbf8e922/I/ImageMagick/build_tarballs.jl#L32-L35)), but they do not seem to suffer from this problem.

Could someone tell me a better way to reference to binary dependencies than this (there must be a better way…)?

---

<div class="post-metadata">

**Author:** ![fredrikekre](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fredrikekre/32/1688_2.png) [@fredrikekre](https://discourse.julialang.org/u/fredrikekre)\
**Post date:** [February 22, 2020, 8:43am UTC](https://discourse.julialang.org/t/how-to-properly-reference-binary-dependencies-during-builds-with-binarybuilder/35008/2 "2020-02-22T08:43:02Z")

</div>

The content of the artifacts are installed to proper locations the environment, see [Build Tricks · JuliaPackaging/Yggdrasil Wiki · GitHub](https://github.com/JuliaPackaging/Yggdrasil/wiki/Build-Tricks#header-files-of-the-dependencies-cant-be-found) and [Build Tricks · JuliaPackaging/Yggdrasil Wiki · GitHub](https://github.com/JuliaPackaging/Yggdrasil/wiki/Build-Tricks#libraries-of-the-dependencies-cant-be-found)

---

<div class="post-metadata">

**Author:** ![sloede](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sloede/32/44787_2.png) [@sloede](https://discourse.julialang.org/u/sloede)\
**Post date:** [February 22, 2020, 11:32am UTC](https://discourse.julialang.org/t/how-to-properly-reference-binary-dependencies-during-builds-with-binarybuilder/35008/3 "2020-02-22T11:32:30Z")

</div>

Thanks for the fast reply, this is exactly what I was looking for. I created a PR in BinaryBuilder.jl to try to get these two items included in the official docs - it seems counter-intuitive to me to have build tips at two different locations, especially since these are clearly targeting novice users.
