-
Notifications
You must be signed in to change notification settings - Fork 38
Installation
Table of Contents:
Step 1: Download and install a recent stable version of DMD (unstable versions usually can't compile Tango)
Step 2: Obtain the Tango D2 library. You can do this in two ways:
-
Clone the trunk of the Tango-D2 repository by doing:
git clone git://github.com/SiegeLord/Tango-D2.git
-
OR Download a snapshot using this link: https://github.com/SiegeLord/Tango-D2/tarball/d2port
Step 3: Open up a terminal and navigate to the directory the Tango-D2 source is located at
Step 4: Build the library by running the following commands:
./build/bin/linux32/bob -u .
NOTE: If you don't plan on using Phobos, or you don't have Phobos, you should modify the build command like this:
./build/bin/linux32/bob -u -o="-release -version=NoPhobos" .
Run this to get more options to customize your build:
./build/bin/linux32/bob --help
Step 5: Install the library. Naturally this depends on where you prefer to install things, but in my case I install into the /usr/local/ hierarchy. You'll probably need to run these commands as root (e.g via sudo):
mkdir -p /usr/local/include/d
mkdir -p /usr/local/lib
cp -R tango /usr/local/include/d/
cp libtango*.a /usr/local/lib/
Step 6: Modify dmd.conf to be able to find Tango. What you do here depends on whether you want to use Tango alongside Phobos, or use Phobos exclusively.
-
If you want to use Tango alongside Phobos, just modify dmd.conf to be able to find where you installed Tango. If you used the above directories you'll need to add these things to DFLAGS variable in dmd.conf:
-I/usr/local/include/d/ -L-L/usr/local/lib
-
If you want to use Tango instead of Phobos, you'll need to modify things a bit more. You'll want to remove the Phobos include path and then add these things:
-I/usr/local/include/d/ -L-L/usr/local/lib -defaultlibname=tango-dmd -debuglib=tango-dmd
Step 7: Try it out by compiling a Hello World application:
import tango.io.Stdout;
void main()
{
Stdout("Hello from Tango!").nl;
}
Compile it using this command if you are using it alongside Phobos:
dmd hello.d -L-ltango-dmd
Compile it using this command if you are using it instead of Phobos:
dmd hello.d
You can use the same steps as the DMD guide except for the following steps:
Step 1: Download and install the unstable version of LDC (from here https://github.com/ldc-developers/ldc )
Step 4: Build the library by running the following commands:
./build/bin/linux32/bob -u -c=ldc2 .
NOTE: If you don't plan on using Phobos, or you don't have Phobos, you should modify the build command like this:
./build/bin/linux32/bob -u -c=ldc2 -o="-release -version=NoPhobos" .
Run this to get more options to customize your build:
./build/bin/linux32/bob --help
Step 6: Modify ldc2.conf to be able to find Tango. What you do here depends on whether you want to use Tango alongside Phobos, or use Phobos exclusively.
-
If you want to use Tango alongside Phobos, just modify dmd.conf to be able to find where you installed Tango. If you used the above directories you'll need to add these strings to the switches array in ldc2.conf:
"-I/usr/local/include/d/" "-L-L/usr/local/lib"
-
If you want to use Tango instead of Phobos, you'll need to modify things a bit more. You'll want to remove the Phobos include path and linking switches and then add these things:
"-I/usr/local/include/d/" "-L-L/usr/local/lib" "-defaultlibname=tango-ldc" "-debuglib=tango-ldc"
Step 7: Try it out by compiling a Hello World application:
import tango.io.Stdout;
void main()
{
Stdout("Hello from Tango!").nl;
}
Compile it using this command if you are using it alongside Phobos:
ldc2 hello.d -L-ltango-ldc
Compile it using this command if you are using it instead of Phobos:
ldc2 hello.d
Building on GDC is not supported yet.
TODO
You may be able to follow the Linux guide for this. TODO