DMD on Ubuntu 14.04

  • Last Created On Dec 09, 2024
  • 9
0 0

D, a programming language that is considered a superset of C, is a low-level but highly productive language that allows you to develop many types of applications. This includes, but is not limited to console tools and network applications. With D becoming more popular in select programming communities, you may find it beneficial to invest time into learning and using it. This article will show you how to install the D DMD compiler onto Ubuntu 14.04. These steps were only tested on 14.04 – proceed with caution if you are using a different version of Ubuntu.

Update Server

Run the following command to ensure that your server is up to date:

apt-get update
apt-get dist-upgrade

Download and Install Dlang

While there are different versions of D that you can use (LDC, GDC, DMD), we will be downloading and installing DMD.

For 32-bit:

wget http://downloads.dlang.org/releases/2014/dmd_2.066.1-0_i386.deb
dpkg -i dmd_2.066.1-0_i386.deb

For 64-bit:

wget http://downloads.dlang.org/releases/2014/dmd_2.066.1-0_amd64.deb
dpkg -i dmd_2.066.1-0_amd64.deb

After the installation finishes, you may see an error message. If you do, run the following command to complete the installation:

apt-get install -f

This will download any dependencies needed for DMD to operate. Once everything is done, you can proceed to the next step.

Verify Installation

You will want to verify that DMD is fully installed and operational. To do so, you will need to compile a small “Hello World” application. Create a file called test.d and populate it with the following lines of code:

module main;

import std.stdio;

void main(string[] args)
{
    writeln("Hello World!");
}

Once you save the lines of code, run the following to compile it:

dmd test.d

If everything is successful, you will see a test executable file. Type ./test to execute it. The text Hello World! will be printed to your console. You have successfully installed the DMD compiler onto your server.

Views: 9

Recent Articles

  • How to Install JAX with ROCm Acceleratio...
    96
  • Deploy a PyTorch Workspace on a Vultr Cl...
    71
  • Managing Backup Storage
    83
  • Automating FTP Backups in Windows Server
    71
  • Automating FTP Backups in Linux
    75

Popular Articles

  • Our General Terms & Conditions
    2634
  • Our Privacy Policy
    2479
  • Our Cookies Policy
    275
  • Our Terms of Use
    153
  • How to Install JAX with ROCm Acceleratio...
    96