Skip to content

Commit

Permalink
Update ARM README (#21737)
Browse files Browse the repository at this point in the history
* Update ARM README

* Document improved ARM support

* Fix wording of file output

* Clarify build dependencies

* Builds are parallel, not multi-threaded

* Split known-good devices into architectures, update AArch64
  • Loading branch information
samuelpowell authored and tkelman committed May 13, 2017
1 parent 1571b62 commit dcffef0
Showing 1 changed file with 68 additions and 73 deletions.
141 changes: 68 additions & 73 deletions README.arm.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
# Julia binaries for ARM
# Julia on ARM (Linux)

[Nightly builds](https://status.julialang.org/download/linux-arm) are
available for ARMv7-A.

# Hardware requirements

Julia requires at least `armv6` and `vfpv2` instruction sets. It's recommended
to use at least `armv7-a`. `armv5` or soft float are not supported.
Julia fully supports ARMv8 (AArch64) processors, and supports ARMv7 and ARMv6
(AArch32) with some caveats. This file provides general guidelines for compilation,
in addition to instructions for specific devices.

# Building Julia on ARM
A list of [known issues](https://github.com/JuliaLang/julia/labels/arm) for ARM is
available. If you encounter difficulties, please create an issue including the output
from `cat /proc/cpuinfo`.

Julia has been compiled on several ARMv7 / Cortex A15 Samsung
Chromebooks running Ubuntu Linux under Crouton, Raspberry Pi systems
and Odroid boards. This is a work in progress - several tests are
known to fail, and backtraces are not available.

Julia on ARM can be built by simply typing `make`, which will download all
the relevant libraries. This is the *recommended* way, and it will take a
few hours.
## Building Julia

If you get SIGILL during sysimg.o creation, it is likely that your cpu
does not support VFP. File an issue on the Julia issue tracker with
the contents of /proc/cpuinfo.
In most cases, Julia can be successfully built by following the platform independent
[build instructions](https://github.com/JuliaLang/julia/blob/master/README.md).

This is the list of known issues on ARM:
[https://github.com/JuliaLang/julia/labels/arm](https://github.com/JuliaLang/julia/labels/arm)

# Build dependencies
### Build dependencies

We recommend using at least Ubuntu 14.04 and gcc 4.8, which is part of the
standard `build-essentials`.
Expand All @@ -45,64 +33,76 @@ override USE_SYSTEM_MPFR=1
override USE_SYSTEM_ARPACK=1
````

The following command will install all the necessary libraries on Ubuntu.
The following command will install all the necessary libraries on Ubuntu:

````
sudo apt-get install libblas3gf liblapack3gf libarpack2 libfftw3-dev libgmp3-dev \
libmpfr-dev libblas-dev liblapack-dev cmake gcc-4.8 \
g++-4.8 gfortran libgfortran3 m4 libedit-dev
````

Note that OpenBLAS only supports ARMv7. For older ARM variants, using the reference BLAS
may be the simplest thing to do.
If you run into issues building LLVM, see [these notes](http://llvm.org/docs/HowToBuildOnARM.html).


## 32-bit (ARMv6, ARMv7)

# ARM specific build problems
Julia has been successfully compiled on several variants of the following ARMv6 & ARMv7 devices:

If you run into issues building LLVM, see these notes:
[http://llvm.org/docs/HowToBuildOnARM.html](http://llvm.org/docs/HowToBuildOnARM.html)
* ARMv7 / Cortex A15 Samsung Chromebooks running Ubuntu Linux under Crouton;
* [Raspberry Pi](https://www.raspberrypi.org).
* [Odroid](http://www.hardkernel.com/main/main.php).


Julia requires at least the `armv6` and `vfpv2` instruction sets. It's recommended to use `armv7-a`.
`armv5` or soft float are not supported.

### Binaries

[Nightly builds](https://status.julialang.org/download/linux-arm) are
available for ARMv7-A.

## Raspberry Pi 1 / Raspberry Pi Zero
### Device specific instructions

Note: These chips use ARMv6, which is not well supported at the moment. However it is
possible to get a working Julia build.
#### Raspberry Pi 1 / Raspberry Pi Zero

The Raspberry Pi ARM CPU type is not detected by LLVM. Before starting the
build, it is recommended to explicitly set the CPU target by adding the
following to `Make.user`:
The type of ARM CPU used in the Raspberry Pi is not detected by LLVM. Explicitly set the
CPU target by adding the following to `Make.user`:

````
JULIA_CPU_TARGET=arm1176jzf-s
````

It is also preferable to use various system provided dependencies on
ARMv6 as described in [Build Dependencies](#build-dependencies).
It is preferable to use various system provided dependencies on ARMv6 as described in
[Build Dependencies](#build-dependencies).

You may need to increase the swap file size: edit the `/etc/dphys-swapfile`, changing the line
To complete the build, you may need to increase the swap file size. To do so, edit
`/etc/dphys-swapfile`, changing the line:

CONF_SWAPSIZE=100

to
to:

CONF_SWAPSIZE=512

Then restart the swapfile service:
before restarting the swapfile service:

sudo /etc/init.d/dphys-swapfile stop
sudo /etc/init.d/dphys-swapfile start

## Raspberry Pi 2
#### Raspberry Pi 2

For Raspberry Pi 2, which is ARMv7, the default build should work. However, the
CPU type is also not detected by LLVM. Fix this by adding
`JULIA_CPU_TARGET=cortex-a7` to `Make.user`.
The type of ARM CPU used in the Raspberry Pi 2 is not detected by LLVM. Explicitly set the
CPU target by adding the following to `Make.user`:

```JULIA_CPU_TARGET=cortex-a7```

Depending on the exact compiler and distribution, there might be a build failure
due to unsupported inline assembly. In that case, add `MARCH=armv7-a` to
`Make.user`.

If building LLVM fails, you can download binaries from the LLVM website:

1. Download the [LLVM 3.7.0 binaries for ARMv7a] (http://llvm.org/releases/3.7.0/clang+llvm-3.7.0-armv7a-linux-gnueabihf.tar.xz) and extract them in a local directory.
1. Download the [LLVM 3.9.0 binaries for ARMv7a] (http://llvm.org/releases/3.9.0/clang+llvm-3.9.0-armv7a-linux-gnueabihf.tar.xz) and extract them in a local directory.
2. Add the following to `Make.user` (adjusting the path to the `llvm-config` binary):

```
Expand All @@ -112,9 +112,9 @@ If building LLVM fails, you can download binaries from the LLVM website:

Please do let us know if you had to download a pre-built LLVM in [#10235](https://github.com/JuliaLang/julia/issues/10235).

## Chromebook
#### Chromebook

On Chromebooks, you have to first install Crouton. If you do not have
On Chromebooks, you have to first install Crouton. If you do not have
an Ubuntu chroot running on your Chromebook using Crouton, you can do
so by following these tutorials.

Expand All @@ -125,47 +125,42 @@ These tutorials will end up installing Ubuntu 12.04, and you have to
upgrade to Ubuntu 14.04, or install Ubuntu 14.04 from scratch by
finding appropriate `crouton` help.

## Scaleway cloud hosted ARM servers
#### Scaleway cloud hosted ARM servers

On the current [Scaleway](http://scaleway.com) ARM servers, the Julia
build works out of the box.

## nVidia Jetson TX2

Julia builds and runs on the [nVidia Jetson TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html) platform with minimal configuration changes. A full multi-threaded build, including LLVM, will complete in around two hours. All tests pass and CUDA functionality is available through, e.g., [CUDAdrv](https://github.com/JuliaGPU/CUDAdrv.jl).
## AArch64 (ARMv8)

Starting from the default configuration flashed by [Jetpack 3.0](https://developer.nvidia.com/embedded/jetpack):
Julia has been successfully built on the following ARMv8 devices:

```
sudo apt-get install libssl-dev
```
* [nVidia Jetson TX1 & TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html);
* [X-Gene 1](https://www.apm.com/products/data-center/x-gene-family/x-gene/);
* [Overdrive 3000](https://softiron.com/products/overdrive-3000/);
* [Cavium ThunderX](http://www.cavium.com/ThunderX_ARM_Processors.html) on [packet.net](https://www.packet.net).

### Julia 0.5.1

The easiest method to build Julia 0.5.1 is to use system provided versions of BLAS and LAPACK:

```
sudo apt-get install libopenblas-dev liblapack-dev
```

Configure Make.user as follows:
Compilation on `ARMv8-A` requires that `Make.user` is configured as follows:

```
MARCH=armv8-a
JULIA_CPU_TARGET=cortex-a57
override USE_SYSTEM_BLAS=1
override USE_SYSTEM_LAPACK=1
```

Note that package manager functions fail with an error regarding SSL certificates. This can be overcome by following the instructions in [this comment](https://github.com/JuliaLang/julia/issues/13399#issuecomment-182018321).
### Device specific instructions

#### nVidia Jetson TX2

### Julia 0.6 beta
Julia builds and runs on the [nVidia Jetson TX2](http://www.nvidia.com/object/embedded-systems-dev-kits-modules.html)
platform with minimal configuration changes.

Configure Make.user as follows:
After configuring `Make.user` as per the `AArch64` instructions in this document,
follow the general [build instructions](https://github.com/JuliaLang/julia/blob/master/README.md).
The majority of the build dependencies specified in the instructions are installed by
the default configuration flashed by [Jetpack 3.0](https://developer.nvidia.com/embedded/jetpack). The remaining tools can be installed by issuing the following command:

```
MARCH=armv8-a
JULIA_CPU_TARGET=cortex-a57
sudo apt-get install gfortran wget cmake
```

No further changes are required.
A full parallel build, including LLVM,
will complete in around two hours. All tests pass and CUDA functionality is available
through, e.g., [CUDAdrv](https://github.com/JuliaGPU/CUDAdrv.jl).

0 comments on commit dcffef0

Please sign in to comment.