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.)
Yes.
1 Like
OK, I just need to run BinaryBuilder.runshell()
to get into a bash shell with the cross compilers.
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:
BinaryBuilderBase.runshell(Platform("aarch64", "linux"); preferred_gcc_version=v"6")
BinaryBuilderBase.runshell(Platform("x86_64", "windows"); compilers=[:c, :rust])
1 Like
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
.
It is cached already, you’re probably downloading different versions of the toolchains, or for different platforms.
1 Like