D Programming Language – How To Install on Raspberry Pi 3

These are my notes on how to install a D Programming Language compiler along with it’s package management tool Dub and how to set-up a first “Hello World” project on a Raspberry PI running Raspbian.

I’ve chosen the GDC compiler due to its comprehensive architecture support (https://wiki.dlang.org/Compilers#Comparison), and ease of install:
sudo apt-get install -y gdc

DUB is a D Programming Language package manager similar to NodeJS npm and PHP Composer. Installing DUB on Raspbian can be done by downloading the latest release:
wget https://code.dlang.org/files/dub-0.9.24-linux-arm.tar.gz && tar -zxvf dub-0.9.24-linux-arm.tar.gz

Optionally, the ‘dub’ binary can be copied to /usr/local/bin/:
cp dub /usr/local/bin

Once installed, you can create a project using:
dub init helloworld

This command will generate the directory structure for your application. Your code can be found in:

Compiling and running it can be done by issuing the following in ./helloworld:

2 thoughts on “D Programming Language – How To Install on Raspberry Pi 3”

  1. Hi there,

    I followed some of the initial discussions on dlang on the raspi – there was something about the standard library not working, or not working completely, before I lost track of the matter. Does everything work when you use gdc? Is there anything I should pay attention to when switching from dmd?

    Most interesting for me: Does vibe.d work?

Leave a Reply

Your email address will not be published. Required fields are marked *