Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Build Instructions


  • LLVM 2.9
  • cmake 2.6+
  • libconfig
    • Need to install from source? Use './configure --prefix=/usr' to configure libconfig, otherwise you will get the error 'can't find' from ldc
    • For MacOS you can use libconfig-hr from MacPorts
    • Beware, there are other libraries with the same name.
    • 1.4.7 is fine (maybe?)
  • GNU make (not the default on FreeBSD, use gmake)
  • optional: Hans Boehm GC 7.0 (direct download link) (for ldc itself, works, but needs special treatment #49)
  • optional: Faster build of llvm and ldc with make -j N, where N is number of processor cores + 1.

Download, Compile and install LLVM 2.9:

tar -xvzf llvm-2.9.tgz
mkdir llvm-obj
cd llvm-obj
../llvm-2.9/configure --enable-optimized --enable-assertions
su -c 'make install'
cd ..

Grab LDC from the Mercurial repository:

hg clone

Generate the makefiles

cd ldc
ccmake ./

Now press 'c' as often as necessary and then 'g' to exit ccmake. You can set D_VERSION to 1 or 2 to build LDC with D1 or D2 language support.


  • If you have libconfig installed in /usr/local/lib, you also need to set LIBCONFIG_LDFLAGS="-L/usr/local/lib -lconfig++" in advanced options of ccmake (while configuring, press 't', scroll down).
  • If you are a Debian user, the ccmake command comes in the cmake-curses-gui package, so you have to get that too or just use plain cmake.
  • On FreeBSD/Solaris, use gmake instead of make.

Compile ldc

Copyright © 2008, LDC Development Team.