Skip to content

Adding support for Arm64 #12

@gilesknap

Description

@gilesknap

Intro

I have successfully got arm64 builds of epics-base to work.

However there are a couple of reasons not to merge this into main.

  • DLS does not actually need arm64
  • arm64 builds are prohibitively slow on Github Actions - see more details below.

Arm at DLS

Arm64 is useful for people using new macs for dev or running IOCs.

DLS's arm IOCs run on 32bit architectures armv7 and armv8 both of which have cross compilation in our current build system.

Even if we wanted to switch to doing native compile of these IOCs we could not as the 32 bit arm variants are lacking in package support and are not supported on GHA.

Hence these would be supported in containers as cross compile on linux:x86_64 just like RTEMS.

Arm64 Build Performance

I have tried two mechanisms for targeting arm64.

  • use buildx and specify platform=linux/arm64,linux/amd64
  • do a native MacOS build using the os matrix in GHA

In both cases, this snippet in the Dockerfile instructs the epics build system of the target os:

FROM base AS environment-amd64
ENV EPICS_HOST_ARCH=linux-x86_64

FROM base AS environment-arm64
ENV EPICS_HOST_ARCH=linux-arm

FROM environment-$TARGETARCH AS environment

The buildx approach uses QEMU to emulate arm64 for the compilation. This results in a build time of 1hr18m, see https://github.com/epics-containers/epics-base/actions/runs/5155081287

I had hoped that a native build on MacOS would improve things, but for whatever reason this is way worse at 3hr36m https://github.com/epics-containers/epics-base/actions/runs/5155705777.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedwaiting on a dependencyenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions