LDC – the LLVM-based D Compiler
The LDC project provides a portable D programming language compiler with modern optimization and code generation capabilities.
The compiler uses the official DMD frontend to support the latest version of D2, and relies on the LLVM Core libraries for code generation.
LDC is fully Open Source; the parts of the source code not taken/adapted from other projects are BSD-licensed (see the LICENSE file for details).
Please consult the D wiki for further information: https://wiki.dlang.org/LDC
D1 is no longer available; see the
d1 Git branch for the last
version supporting it.
From a pre-built package
Portable stand-alone binary builds for common platforms (incl. Linux, macOS and Windows) are available at the GitHub release page.
For bleeding-edge users, we also provide the latest successful Continuous Integration builds with enabled LLVM & LDC assertions (increasing compile times by roughly 50%).
The dlang.org install script can also be used to install LDC:
curl -fsS https://dlang.org/install.sh | bash -s ldc
In addition, LDC is available from various package managers:
|Android||in Termux app:
Note that these packages might be outdated as they are not currently integrated into the project release process.
Notes on Windows
You can find full instructions on cross-compiling or natively compiling for Android on the wiki.
Building from source
If you have a working C++/D build environment, CMake, and a current LLVM version (≥ 3.7) available, there should be no big surprises. Do not forget to make sure all the submodules (druntime, phobos, dmd-testsuite) are up to date:
$ cd ldc $ git submodule update --init
(DMD and LDC are supported as host compilers. For bootstrapping
purposes, LDC 0.17, the last version not to require a D compiler, is
maintained in the
We've recently added a cross-compilation tool to make it easier to build the D
runtime and standard library for other platforms,
instructions and example invocations are provided
on its wiki page.
For further documentation, contributor information, etc. please see the D wiki.
Feedback of any kind is very much appreciated!