# Distributing a julia package that contains Fortran and C code

**URL:** https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024
**Category:** Tooling
**Created:** [June 30, 2023, 5:07pm UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024 "2023-06-30T17:07:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mesonepigreco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mesonepigreco/32/46262_2.png) [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)
#### Post date: [June 30, 2023, 5:07pm UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024/1 "2023-06-30T17:07:47Z")

</div>

Dear julia experts  
I am developing a package that requires a lot of fortran code with Lapack and Blas dependencies developed long time ago.  
While it should be straightforward to compile it manually for myself as a shared library, I was wandering if there is a better tool (like the wonderful numpy.distutils that they sadistically want to remove from python 3.12) to let users just do something like

```julia
] add mypackage 

```

in a julia terminal to automatically download and compile the fortran code, without having to worry to compile the code with boring make and cmake and whatever.  
It would be much easier to distribute the code in this way, but googleing I did not find anything

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [June 30, 2023, 5:45pm UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024/2 "2023-06-30T17:45:02Z")

</div>

This is the tool: [GitHub - JuliaPackaging/BinaryBuilder.jl: Binary Dependency Builder for Julia](https://github.com/JuliaPackaging/BinaryBuilder.jl)

---

<div class="post-metadata">

### Author: ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)
#### Post date: [June 30, 2023, 5:50pm UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024/3 "2023-06-30T17:50:46Z")

</div>

> [@mesonepigreco](#):
>
> to automatically download and compile the fortran code

Better yet, BinaryBuilder allows the users to automatically download already built binary artifacts for their specific platform.

---

<div class="post-metadata">

### Author: ![mesonepigreco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mesonepigreco/32/46262_2.png) [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)
#### Post date: [July 1, 2023, 7:33am UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024/4 "2023-07-01T07:33:39Z")

</div>

Wow this is exactly what I was looking for, thank you very much!!

---

<div class="post-metadata">

### Author: ![mkitti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkitti/32/12459_2.png) [@mkitti](https://discourse.julialang.org/u/mkitti)
#### Post date: [July 1, 2023, 3:05pm UTC](https://discourse.julialang.org/t/distributing-a-julia-package-that-contains-fortran-and-c-code/101024/5 "2023-07-01T15:05:40Z")

</div>

It maybe helpful to look at the existing recipes in Yggdrasil.

> **[GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for...](https://github.com/JuliaPackaging/Yggdrasil)**
>
> Collection of builder repositories for BinaryBuilder.jl - GitHub - JuliaPackaging/Yggdrasil: Collection of builder repositories for BinaryBuilder.jl

These generate JLL packages.

For example,

> **[GitHub - JuliaBinaryWrappers/HDF5\_jll.jl](https://github.com/JuliaBinaryWrappers/HDF5_jll.jl)**
>
> Contribute to JuliaBinaryWrappers/HDF5\_jll.jl development by creating an account on GitHub.

We cross compile these from a Linux “container” to multiple platforms for the user.
