# Interdependent libraries in BinDeps

**URL:** <https://discourse.julialang.org/t/interdependent-libraries-in-bindeps/6086>\
**Category:** General Usage\
**Tags:** package\
**Created:** [September 26, 2017, 1:11pm UTC](https://discourse.julialang.org/t/interdependent-libraries-in-bindeps/6086 "2017-09-26T13:11:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbo/32/9357_2.png) [@tbo](https://discourse.julialang.org/u/tbo)\
**Post date:** [September 26, 2017, 1:11pm UTC](https://discourse.julialang.org/t/interdependent-libraries-in-bindeps/6086/1 "2017-09-26T13:11:11Z")

</div>

I am writing a wrapper for a library `foo`, which contains symbols from another helper library `bar`, but does not contain shared object dependencies to `bar`. My goal is to build and install both `foo` and `bar` within a single package using BinDeps. BinDeps will successfully build both libs and will find `bar`, but keeps failing for `foo` due to non-satisfied dependencies.

`Provider BinDeps.BuildProcess failed to satisfy dependency - Library foo`

This is due to fact that BinDeps performs some checks using `dlopen`, which fail since the symbols from `bar` are not (yet) available. I could avoid that by loading `bar` globally to avoid problems for the checks  
`Libdl.dlopen(:libbar, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL )`  
however this only works once both libs have already been built.  
Similarly even if I prebuild the libs and load `bar`, the autogenerated deps.jl will be missing the `Libdl.RTLD_GLOBAL` flag.

I wonder what’s the suggested way of dealing with such a problem?
