Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Installing Tango with GDC on Unix operating systems

Tango for GDC on Unix operating systems can be installed in different manners. The first approach described is fully manual, for the other solutions, there are downloadable installers. Be aware that not all arches have ready made installers or binary downloads.

At the end, there are some instructions for those who want to install GDC manually.

Manual Installation

1. Check out / update Tango from SVN.

The released version available for download contains Makefiles that don't work on Posix systems, so the latest Tango must be checked out from SVN (replace 0.99.3 with the currently released version of Tango, and replace <tango base> with whatever directory you want to checkout Tango into):

svn co http://svn.dsource.org/projects/tango/tags/releases/0.99.3/ <tango base>
cd <tango base>/lib

If you are updating rather than checking out for the first time perform the following commands:

cd <tango base>
svn update
cd lib

2. Build the core Tango library.

./build-gdc.sh

For Mac OS X: Alternatively, you can build a Universal Binary with:

./build-gdc-mac.sh

3. Install Tango files.

./install-gdc.sh

For information on arguments accepted by this script, run

./install-gdc.sh --help

Please report any problems with the script. If you're still unable to make it work, you can still perform this step manually:

export GDC_TEMP="`gdc -print-file-name=libgcc.a`"
export GDC_LIB_DIR="`dirname $GDC_TEMP`"
sudo cp $GDC_LIB_DIR/libgphobos.a $GDC_LIB_DIR/libgphobos.a.phobos
sudo cp -Rf libgphobos.a $GDC_LIB_DIR
sudo cp -f ../object.di <GDC install prefix>/include/d/<GDC version>

Note that line 3 makes a backup copy of libgphobos.a should you desire ever to switch back to Phobos from Tango.

Also note that <GDC install prefix> is most likely /usr, however it could be /usr/local, or any other path you (or your distro) chose at compile time.

4. Make .d source files accessible.

This can be done by several means. You can add a -I path to your $DFLAGS, or you can copy the .d source into GDC's prefix like so:

sudo cp -Rf ../tango <GDC install prefix>/include/d/<GDC version>
sudo cp -Rf ../std <GDC install prefix>/include/d/<GDC version>

5. Fix incorrect permissions on the files (these commands requires bash / zsh):

cd <GDC install prefix>/include/d/<GDC version>/tango
for dir in `find . -type d` ; do sudo chmod 755 $dir ; done
for file in `find . -type f` ; do sudo chmod 644 $file ; done

6. If your project requires linking against libgtango you can install it via the following method: (Note that this isn't required for most people who are using an automated build tool!)

./build-tango.sh gdc

For Mac OS X: Alternatively, you can build a Universal Binary with:

./build-tango.sh mac

Then install libgtango.a as follows:

export GDC_TEMP="`gdc -print-file-name=libgcc.a`"
export GDC_LIB_DIR="`dirname $GDC_TEMP`"
sudo cp libgtango.a $GDC_LIB_DIR

Installers

There are several 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 using DSSS
  • Installers for those wishing to install DSSS and/or GDC.

All installers are shell scripts with an embedded tar.gz and should be made executable once downloaded.

chmod +x <name of installer>.sh

At this point the installer can be run. For most setups this will probably require the use of the root account, e.g. by using sudo.

sudo ./<name of installer>.sh

At this point, Tango and the necessary tooling should be installed.

Troubleshooting

Tango fails to generate all files properly with GDC 0.24 due to a bug in gdmd (the wrapper script that emulates dmd) -- it does not build the header (.di) files. You can fix gdmd by setting "$header = 1" for the -Hf argument (approx line 190):

    } elsif ( $arg =~ m/^-Hf(.*)$/ ) {
        $header = 1;
        $header_file = $1;
    } elseif ...

References

User Comments

Comments