# ITK cross compilation using Julia's BinaryBuilder.jl

**URL:** https://discourse.itk.org/t/itk-cross-compilation-using-julias-binarybuilder-jl/2136
**Category:** Community
**Created:** [August 8, 2019, 10:51pm UTC](https://discourse.itk.org/t/itk-cross-compilation-using-julias-binarybuilder-jl/2136 "2019-08-08T22:51:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ianshmean](https://discourse.itk.org/user_avatar/discourse.itk.org/ianshmean/32/928_2.png) [@ianshmean](https://discourse.itk.org/u/ianshmean)
#### Post date: [August 8, 2019, 10:51pm UTC](https://discourse.itk.org/t/itk-cross-compilation-using-julias-binarybuilder-jl/2136/1 "2019-08-08T22:51:04Z")

</div>

Related to [ITK on Julia, Shared Library Files](https://discourse.itk.org/t/itk-on-julia-shared-library-files/2117/6), @cj-mclaughlin and I are trying to get an automated cross-compiled version of ITK built using the Julia package [BinaryBuilder.jl](https://juliapackaging.github.io/BinaryBuilder.jl/stable/index.html) which manages the cross-compilation process through pre-configured build environments (~13 platforms currently supported, listed below).

To do so, we need to provide a cross-platform bash script for BinaryBuilder to use in each build environment. Currently our build script looks like this, but is suffering from a lot of missing TryRun() variables, and fails seemingly because of this.

Does anyone know of a simple way to make this successful across all the environments? That might be asking a lot.

> <https://github.com/ianshmean/ITKBuilder/blob/7c49784a2b045b85249d208eae903df83c2989e7/build_tarballs.jl#L12-L19>

BinaryProvider.jl supported platforms

```auto
 Linux(:i686, libc=:glibc)                    
 Linux(:x86_64, libc=:glibc)                  
 Linux(:aarch64, libc=:glibc)                 
 Linux(:armv7l, libc=:glibc, call_abi=:eabihf)
 Linux(:powerpc64le, libc=:glibc)             
 Linux(:i686, libc=:musl)                     
 Linux(:x86_64, libc=:musl)                   
 Linux(:aarch64, libc=:musl)                  
 Linux(:armv7l, libc=:musl, call_abi=:eabihf) 
 MacOS(:x86_64)                               
 FreeBSD(:x86_64)                             
 Windows(:i686)                               
 Windows(:x86_64) 

```

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [August 9, 2019, 3:26am UTC](https://discourse.itk.org/t/itk-cross-compilation-using-julias-binarybuilder-jl/2136/2 "2019-08-09T03:26:02Z")

</div>

@ianshmean welcome to the ITK community! ☀

To address the [TryRun](https://cmake.org/cmake/help/latest/command/try_run.html) configuration results, a nice approach is to set the [`CMAKE_CROSSCOMPILING_EMULATOR`](https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html#variable:CMAKE_CROSSCOMPILING_EMULATOR) configuration variable. On a Linux host, for the Linux targets the [QEMU User space emulator](https://qemu.weilnetz.de/doc/qemu-doc.html#QEMU-User-space-emulator) can be used. On a Linux host for a Windows target, [WINE](https://www.winehq.org/) can be used.

Also possibly useful is [dockcross](https://github.com/dockcross/dockcross).

---

<div class="post-metadata">

### Author: ![ianshmean](https://discourse.itk.org/user_avatar/discourse.itk.org/ianshmean/32/928_2.png) [@ianshmean](https://discourse.itk.org/u/ianshmean)
#### Post date: [August 20, 2019, 3:35pm UTC](https://discourse.itk.org/t/itk-cross-compilation-using-julias-binarybuilder-jl/2136/3 "2019-08-20T15:35:55Z")

</div>

Thanks @matt.mccormick. This is really helpful.  
However, unfortunately cross compiling emulators aren’t yet available in Julia’s BinaryBuilder, but they are on the development plan… So I’ve decided to pause my efforts until they’re available. See [https://github.com/ianshmean/ITKBuilder/issues/1](https://github.com/ianshmean/ITKBuilder/issues/1)

I’ll post back here with any progress
