Table of Contents
Installation Guide for Tango used with DMD
This page details three ways of installing Tango for DMD on Linux. One of the first two is recommended unless you want to hack Tango itself.
For some, it may make more sense to use DSSS for installation, or use a tool like build/bud or rebuild, the alternatives are suggested at further down on the page.
If you're using Bud as your build program, please read the notes at the bottom of this page.
Install Binary Bundle
- Download Tango, one of the .tar.gz options will suffice
- Extract the package
- If your download is with DMD and you want to install it, back up any previously installed dmd.conf
- If you have Phobos installed, and want to install Tango in the same place, back up object.d
- Copy the folders import and lib from the extracted folder, and bin for the compiler tool chain, to where you want to install
- If you have root access to your box, installing to /usr/local is recommended
- Make sure your <install path>/bin is part of your PATH and you should be ready to go.
There are two types of installers available for a given release. Which one you choose, depends on your existing setup.
- Installers for those only wishing to upgrade Tango, but otherwise have a complete system
- Installers for those wishing to upgrade DMD.
- Download a Tango installer.
- All installers are shell scripts with an embedded tar.gz and should be made executable once downloaded.
chmod +x <name of installer>.sh
- Run the installer. For most setups this will probably require the use of the root account, e.g. by using sudo.
sudo ./<name of installer>.sh
- If you don't specify a prefix, the installer will ask if /usr/local is ok, or if you want to specify one.
At this point, Tango and the necessary tooling should be installed.
Manual Build and Install
- Download or check out Tango sources.
- Enter the Tango directory where the build files are:
$ cd <tango base>/build
- At this point you can run build.sh with various arguments, to see the instructions do
$ ./build.sh --help
- typically what you want is
that creates the optimized and debug versions of the libraries and installs them
- Make .d source files accessible by copying the .d source into this path like so:
$ cp -Rf <tango base>/user/* <DMD install prefix>/include/d
- Update your dmd.conf (either alongside your DMD binary, or in /etc)
[Environment] DFLAGS=-I<DMD install prefix>/include/d -defaultlib=tango-base-dmd -debuglib=tango-base-dmd -version=Tango -version=Posix
- you can build the unittests with
$ ./build.sh --version tst $ ./unittest-dmd.sh
- If you use the installer on a clean linux system without DMD previously installed, you will have to make sure libstdc++5 is installed prior to running the Tango installation script, otherwise it will fail.
DSSS can be used to install Tango, either just the user targeted API, or all of it. All of Tango, including the runtime, can be installed using DSSS' net install feature. Also, if you have installed the runtime, the user API can be installed for use with DSSS by doing
dsss build && dsss install
in the Tango root directory.
Using Rebuild / Bud (build)
This is similar to using DSSS (rebuild is indeed a part of DSSS), but where you instead of installing libraries, give the build tools the path to Tango, having the objects rebuilt when needed by the built application.
Notes on using Build
- If you have trouble, be sure your dmd.conf is correct. Note that quotes in the parameter list are probably wrong.
- Build on Linux won't correctly process the libraries unless you specify the -op parameter, thus:
build target.d -op
- The clean parameter of build causes it to remove the object files generated prior to linking. If you specify:
build target.d -clean -opthen you will have your target executable produced, but target.o will be deleted.