Swift available for all the ARMv6 RaspberryPi (1,Zero)

Posted by Umberto Raimondi on February 10, 2016 也可以阅读中文版

Update December 2016: Swift 3.0.2 for all the RaspberryPi boards is now available here.

UPDATE: Swift 3.0 (snapshot) is now available, more info here

After a few hundred hours of compilation, various attempts and some broken usb pen drives, i can finally share an initial build of Swift 2.2 for ARMv6 (built on Raspbian):

Get it from DropBox

This will work with every RaspberryPi 1 (A,B,A+,B+) and the RaspberryPi Zero. This package is based on the same sources of the ARMv7 build but lacks Foundation, XCTest, LLDB and the REPL.

This should not be a problem in the vast majority of cases, I’m in the process of compiling a new build from Swift:master (now that William Dillon’s ARM port has been merged, read about other ports here), that likely will be more complete.

Once you have installed clang, that is the only dependency we need, to use the swift compiler, just download and decompress the archive:

sudo apt-get update
sudo apt-get install clang

wget https://www.dropbox.com/s/he47c47bywm10nv/swift-armv6.tgz
tar xzf swift-armv6.tgz

To compile a helloworld.swift:

./usr/bin/swiftc helloworld.swift

SwiftyGPIO has been finally tested on a RaspberryPi A and works perfectly. Thanks to Dan Leonard that was kind enough to test it on the Raspberry Zero!

If you have a RaspberryPi 2 or any other ARMv7 board remember you can find pre-built Swift binaries here.

Did you like this article? Let me know on Twitter!

This is the blog of Umberto Raimondi, you can reach me at me@this domain.

I'm also on Twitter and GitHub.

Subscribe via RSS or email.