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

Here are quick copy&paste instructions to install the newest DMD and Tango:

These instructions install DMD 1.065.
But you can try any higher version.
See the Digitalmars download site.

wget http://ftp.digitalmars.com/dmd.1.065.zip
unzip dmd.1*.zip
mkdir -p /opt/dmd
cp -r dmd/freebsd/* /opt/dmd/
chmod a+x /opt/dmd/bin/dmd
export PATH=/opt/dmd/bin:$PATH

Note:

  • For 64bit FreeBSD you may want to install lib32 or use the native 64bit binary of bob. (on console: sysinstall => Configure => Distributions => lib32)
svn co http://svn.dsource.org/projects/tango/trunk
cd trunk
./build/bin/freebsd32/bob -vu -r=dmd -c=dmd .
cp libtango.a /opt/dmd/lib/libtango.a
mkdir /opt/dmd/import
cp -r object.di tango /opt/dmd/import/

Change the content of /opt/dmd/bin/dmd.conf to:

[Environment]

DFLAGS=-I%@P%/../import -I%@P%/../import/tango/core/vendor -L-L%@P%/../lib -version=Tango -defaultlib=tango -debuglib=tango -version=freebsd

Create a main.d file:

module main;

import tango.io.Stdout;

void main(char[][] args)
{
   Stdout("Hello World").newline;
}

Compile and run it:

dmd main.d
./main
Hello World

Done. :-)

Note:

  • Put "export PATH=/opt/dmd/bin:$PATH" into your ~/.bashrc file to have dmd available in every console.
  • You can take zlib and other libs from the Tango bundle and copy it to your /opt/dmd/lib folder.

Uninstall:

rm -rf /opt/dmd/