The LLVM-based D Compiler.
Find a file
2024-12-15 13:57:53 +01:00
.circleci CircleCI: Switch jobs from Docker container to full VM 2024-11-26 03:29:37 +01:00
.github Vanilla-LLVM GHA: Bump Linux jobs to Ubuntu 24 and use distro LLVM 15/18 packages (#4797) 2024-12-07 08:46:08 +01:00
cmake Add preliminary support for LLVM 19 2024-11-26 08:46:15 -07:00
dmd Merge remote-tracking branch 'origin/dmd-rewrite-stable' into merge_stable 2024-12-07 23:59:12 +01:00
docs
driver Improve Objective-C support (#4777) 2024-12-03 04:26:27 +01:00
gen Windows: Fix build regressions with pure MSVC toolchain (#4802) 2024-12-13 13:58:46 +01:00
ir Fix #4790: Make sure TypeInfo_Class.base is always a TypeInfo_Class ref (#4796) 2024-12-07 08:48:20 +01:00
packaging Bump bundled dub to latest stable with crucial regression fix (#4791) 2024-11-30 20:50:15 +01:00
runtime Bump Phobos 2024-12-08 00:13:24 +01:00
tests Merge remote-tracking branch 'origin/dmd-rewrite-stable' into merge_stable 2024-12-07 23:59:12 +01:00
tools update-dmd-rewrite.sh: Work around filter-repo weirdness (#4788) 2024-11-27 22:56:40 +01:00
utils Add preliminary support for LLVM 19 2024-11-26 08:46:15 -07:00
.cirrus.yml Cirrus CI: Fix Ubuntu rolling job (#4793) 2024-12-01 06:10:00 +00:00
.clang-format
.clang-tidy
.editorconfig
.gitattributes
.gitmodules
bitrise.yml CI: Use LDC-LLVM v15.0.7 for prebuilt packages 2023-02-24 15:23:40 +01:00
CHANGELOG.md Finalize changelog for v1.40.0 2024-12-15 13:57:53 +01:00
CMakeCPack.cmake
CMakeLists.txt Support building phobos against a system copy of zlib 2024-09-04 22:08:38 +03:00
Doxyfile
ldc2.conf.in Support out-of-llvm compiler-rt installations 2024-05-20 16:55:41 +08:00
ldc2_install.conf.in Support out-of-llvm compiler-rt installations 2024-05-20 16:55:41 +08:00
ldc2_phobos.conf.in Support out-of-llvm compiler-rt installations 2024-05-20 16:55:41 +08:00
LICENSE
README.md README.md: Fix min LLVM version 2024-12-13 14:00:39 +01:00

LDC the LLVM-based D Compiler

Latest release Latest stable release Build status Build status Build status Build status

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.

Installation

From a pre-built package

Portable stand-alone binary builds (and a Windows installer) for common platforms (incl. Linux, macOS, Windows, FreeBSD and Android) are available at the GitHub release page. For Windows, the Visual D installer also comes with a bundled LDC.

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 these official packages from GitHub:

curl -fsS https://dlang.org/install.sh | bash -s ldc

In addition, LDC is available from various package managers (but note that these packages are community-maintained, might be outdated and not offer the full feature set of official packages from GitHub):

Command
Alpine Linux apk add ldc
Android in Termux app: pkg install ldc
Arch Linux pacman -S ldc
Chocolatey choco install ldc
Debian apt install ldc
Docker docker pull dlang2/ldc-ubuntu
Fedora dnf install ldc
FreeBSD pkg install ldc
Gentoo layman -a ldc
Homebrew brew install ldc
Nix/NixOS nix-env -i ldc
OpenBSD pkg_add ldc
Snap snap install --classic --channel=edge ldc2
Ubuntu apt install ldc
Void xbps-install -S ldc

Building from source

In-depth material on building and installing LDC and the standard libraries is available on the project wiki for Linux, macOS, BSD, and Android and Windows.

If you have a working C++/D build environment, CMake, and a recent LLVM version (≥ 15) available, there should be no big surprises. Do not forget to make sure the Phobos submodule is up to date:

$ cd ldc
$ git submodule update --init

(DMD, GDC and LDC are supported as host compilers. For bootstrapping purposes, we recommend GDC via its gdmd wrapper.)

Cross-compilation

Similar to other LLVM-based compilers, cross-compiling with LDC is simple. Full instructions and example invocations are provided on the dedicated Wiki page.

Targeting Android

You can find full instructions on cross-compiling or natively compiling for Android on the wiki.

Contact

The best way to get in touch with the developers is either via the digitalmars.D.ldc forum/newsgroup/mailing list or our Gitter chat. There is also the #ldc IRC channel on FreeNode.

For further documentation, contributor information, etc. please see the D wiki.

Feedback of any kind is very much appreciated!