Installation

Index:
  1. MonoDevelop installation / Build MonoDevelop manually
  2. D Compiler Setup
  3. Mono-D installation & setup
  4. Upgrading/Downgrading Mono-D

1. MonoDevelop installation

Mac/Windows:

Head to http://monodevelop.com/Download and install the latest release (it may even be an ‘Alpha’ version) of MonoDevelop. After installation it should update to newer MonoDevelop versions automatically.

Linux:

Basically you need Mono, the gtk-sharp2 library and the latest stable (or a version that is 100% compatible to the stable!) MonoDevelop.

First off, check your distribution specific software repository if it contains the latest (!, see monodevelop.com to get an idea of what the latest version number might be at the moment) MonoDevelop version, install that one and go on testing whether Mono-D works with it or not. Head to the lower section on where to install Mono-D from and test if you can already use it. Otherwise, if there are e.g. complications when opening up a D file:

For Ubuntu and Ubuntu derivatives, here  are popular launchpad repos 

1) ppa:keks9n/monodevelop-latest

sudo add-apt-repository ppa:keks9n/monodevelop-latest

sudo apt-get install monodevelop-latest

2) ppa:ermshiperete/monodevelop  or  ppa:ermshiperete/monodevelop-beta

sudo add-apt-repository ppa:ermshiperete/monodevelop
#or for BETA
sudo add-apt repository ppa:ermshiperete/monodevelop-beta

sudo apt-get install monodevelop-4.0

If there’s no latest MonoDevelop available (which is usually the case), I’ve built and uploaded a couple of stand-alone packages that contain Mono 3, Gtk-sharp2 (and several other gtk-like libraries required by MonoDevelop) and MonoDevelop itself. Thank goes out to simendsjo for letting me use some of his server space to store the files! :)

After downloading, untar the archive via

$ sudo tar -xPf MonoDevelop.xXX.Master.tar.xz

The xXX will either be x86 or x64, depending on your system architecture. Afterwards you will be able to launch MonoDevelop directly via

$ /opt/mono/bin/monodevelop

If you get an error that some GnomePlatform addin couldn’t be loaded, please ensure that libgnomeui is installed on your machine (as this occurs on a freshly installed Ubuntu by default)!

2. D Compiler Setup

Basically the installation routine is already made very easy and comprehensive – just go to http://dlang.org/download.html and download the installer which fits most to your operating system.

3. Mono-D installation & setup

Just open the Addin Manager via the Tools menu -> Addin Manager, head to the gallery and install the Mono-D addin as well as the D Gdb debugging addin which is made for debugging D programs with gdb directly inside MonoDevelop.

Mono-D installation from the Beta Addins channel

If this method isn’t working, please try the following instructions:

 

Open the Addin Manager and open the Add-in Repository Management by clicking on the Repository dropdown and selecting the last item in that drop-down list:

Afterwards, hit the “Add” button and type http://mono-d.alexanderbothe.com in the text field.

Confirm the dialog. In the case you can’t reach the repo automatically you can still download the latest and some previous versions of Mono-D right here! The same goes for the parallel repository that is established for stable MonoDevelop versions.

Hit the reload symbol right next to the repository list and the new addin meta information will be downloaded and you should see a “Language bindings” entry in the list box. Install the “D Language Binding” (yes it’s called like this, only the public name is Mono-D :-))

Congratulations. If you made it until this point you basically will be able to create D projects and have fun coding D code now.
There are only few steps missing to enable full code completion ability:

Open the MonoDevelop Settings and open the “Preferences->D->Compiler Toolchains” options panel.

1) If the compiler can’t be reached via the regular command line (e.g. on Windows, if dmd’s bin path hasn’t been set as %PATH% environment variable), browse and set the tool-chain’s binary path (the path where e.g. dmd.exe is stored in)

On Linux/Mac you may skip this first step if you’ve installed dmd via the regular installer package.

2) Enter the include paths to enable full code completion:

In Windows environments, these paths typically are

  • C:\D\dmd2\src\druntime\import
  • C:\D\dmd2\src\phobos

Mac:

  • /usr/share/dmd/src/druntime/import
  • /usr/share/dmd/src/phobos

Linux:

  • /usr/include/dlang/dmd or
  • /usr/include/dmd

It’s often the case that your very personal installation paths differ from the proposed paths – I think you’ll be able to find them out on your own! ;-)

Click on “OK” to let Mono-D scan these paths and provide Meta-Information about phobos and other D modules out there. This should take less than a few seconds on multi-core systems.

For building Win32 Applications:

It’s needed to have a resource compiler installed on your machine – in the case you haven’t done so far – ResourceCompiler.zip – just unzip it, head to the Preferences->D->Win32 Resource Compiler settings and set its executable path so it can be found by Mono-D in order to compile resource scripts (*.rc)

4. Updating/Downgrading Mono-D

Before you update Mono-D, make sure you started MonoDevelop/XamarinStudio WITHOUT having any D project open or opened. If you enabled the automatic loading of the lastly opened project on startup, please disable this option or make sure that it’ll not be loaded before updating/reinstalling Mono-D to prevent installation errors.

Afterwards, you may click the update button in MD/XS or download an other (maybe older) release from http://addins.monodevelop.com/Project/Index/27, uninstall Mono-D and install the downloaded mpack archive via the “Install from file” button. You should be able to immediately use Mono-D from there on.