# How to use BinaryBuilder.jl for non-Julia project?

**URL:** <https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560>\
**Category:** General Usage\
**Tags:** binarybuilder, cross-platform\
**Created:** [October 4, 2023, 8:38am UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560 "2023-10-04T08:38:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [October 4, 2023, 8:38am UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/1 "2023-10-04T08:38:07Z")

</div>

I have a C++ project with no external dependencies other than GCC. I’m able to produce tarballs that work across different Linux distributions by compiling on CentOS 7 which has old versions of GCC and glibc. To build tarballs for MacOS and Windows, is it easy to use BinaryBuilder.jl as a convenient way to install and access the various cross-compilers? (More details: actually, all dependencies are bundled as source code and compiled to shared libraries within the project’s build folder. Then the executables are built with the `rpath` option pointing to the relative paths of these shared libraries.)

---

<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:** [October 4, 2023, 3:27pm UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/2 "2023-10-04T15:27:39Z")

</div>

> [@greatpet](#):
>
> is it easy to use BinaryBuilder.jl as a convenient way to install and access the various cross-compilers?

Yes.

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [October 4, 2023, 11:57pm UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/3 "2023-10-04T23:57:02Z")

</div>

OK, I just need to run `BinaryBuilder.runshell()` to get into a bash shell with the cross compilers.

---

<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:** [October 5, 2023, 11:10am UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/4 "2023-10-05T11:10:24Z")

</div>

Yes, but you need to pass the argument of the platform you want to target, and optionally what compilers you want (default only C/C++/Fortran) or what version of gcc (default 4.8.5), for example:

```julia
BinaryBuilderBase.runshell(Platform("aarch64", "linux"); preferred_gcc_version=v"6")
BinaryBuilderBase.runshell(Platform("x86_64", "windows"); compilers=[:c, :rust])

```

---

<div class="post-metadata">

**Author:** ![greatpet](https://avatars.discourse-cdn.com/v4/letter/g/e495f1/32.png) [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Post date:** [October 5, 2023, 11:45am UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/5 "2023-10-05T11:45:40Z")

</div>

I noticed that `runshell` downloads the compilers again in every run. This can be a few GB even for just one platform. Is it possible to cache the downloaded artifacts and reuse them between runs? The same problem also happens for `BinaryBuilders.build_tarballs`.

---

<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:** [October 5, 2023, 12:06pm UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560/6 "2023-10-05T12:06:51Z")

</div>

It is cached already, you’re probably downloading different versions of the toolchains, or for different platforms.
