# Using Julia package which is calling C library?

**URL:** <https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172>\
**Category:** New to Julia\
**Tags:** calling-c\
**Created:** [December 3, 2022, 11:34am UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172 "2022-12-03T11:34:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tienviitta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tienviitta/32/34108_2.png) [@tienviitta](https://discourse.julialang.org/u/tienviitta)\
**Post date:** [December 3, 2022, 11:34am UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172/1 "2022-12-03T11:34:11Z")

</div>

Hello fellow Julians,

We have a FEC C-library and a Julia wrapper as Julia module/package for it build and now there is of course a need to use this amazing piece of error correcting software. I can compile the C-library (CMake project) and use it in that Julia wrapper module but how to I bring this to my own project? Will I need to compile the library there or is it just sufficient to add it as an dependency with package manager?

Then after that of course using or import should be sufficient but I’m not familiar with this type of Julia package (located BTW in bitbucket) which have C-library dependencies.

Br,  
Petri V.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [December 3, 2022, 12:09pm UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172/2 "2022-12-03T12:09:52Z")

</div>

You could use [GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl](https://github.com/JuliaPackaging/Yggdrasil) to build a JLL package(or use BinaryBuilder.jl locally) and then add the JLL package to your project’s toml file as a dependency.

---

<div class="post-metadata">

**Author:** ![tienviitta](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tienviitta/32/34108_2.png) [@tienviitta](https://discourse.julialang.org/u/tienviitta)\
**Post date:** [December 6, 2022, 10:18am UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172/3 "2022-12-06T10:18:36Z")

</div>

Thank you, this sounds as a good solution to this, I’ll study it and try. My first attempt just using “add ” didn’t work since there was a fixed path to the library within the Julia package. At the moment I’m using “develop ” and then cmake/make locally.

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [December 6, 2022, 1:13pm UTC](https://discourse.julialang.org/t/using-julia-package-which-is-calling-c-library/91172/4 "2022-12-06T13:13:43Z")

</div>

You could take [ClangCompiler.jl/build\_local.jl at master · Gnimuc/ClangCompiler.jl · GitHub](https://github.com/Gnimuc/ClangCompiler.jl/blob/master/deps/build_local.jl) as an example for how to dev an JLL package locally.
