HomeAbout RISC-V

Swift Hello Riscv64 World

By futurejones
Published in Development
August 16, 2024
1 min read
Swift Hello Riscv64 World

How to install Swift on riscv64 in 3 easy steps using the Swift Community Apt Repository.

Prerequisites

To use swift on riscv64 you will need a riscv64 machine running a recent version of a Ubuntu or Debian based distrubtion.
GLibc version 2.38 or later is required and libPython3.11 needs be available.

Installation has been tested on the following devices:

  • VisionFive 2
  • Banana Pi BPI-F3
  • DC-ROMA laptop 1
  • DC-ROMA laptop 2
  • Milk-V Pioneer Box

Installation has been tested on the following distributions:

  • Ubuntu 23.10 (mantic)
  • Ubuntu 24.04 (noble)
  • Debian 13 (trixie/sid/unstable)
  • Bianbu OS

Step One

Install curl

sudo apt install -y curl

Step Two

Install the Swift Community Apt Repository

curl -s https://archive.swiftlang.xyz/install.sh | sudo bash

install repo

A big thank you to PackageCloud for hosting the Swift Community Apt Repository.

Step Three

Install Swift

sudo apt install swiftlang

Check Swift Version

swift --version

install swiftlang


A Quick Hello World

In a terminal enter the following commands:

# make a new directory called hello
mkdir hello
# change into the hello directory
cd hello
# initialize a new swift project --type executable
swift package init --type executable
# run the project
swift run

hello world screen


Coming next: Installing VSCode (VSCodium) on riscv64 and more swift.


Tags

#development#technology#swift
Previous Article
Swift 5.10.1 Released for Riscv64

Quick Links

About RISC-V

Social Media