LinuxCommandLibrary

ldc

LLVM-based D compiler

TLDR

Compile D program

$ ldc2 [source.d]
copy
Output executable name
$ ldc2 -of=[output] [source.d]
copy
Compile with optimization
$ ldc2 -O2 [source.d]
copy
Release build
$ ldc2 -release [source.d]
copy
Debug build
$ ldc2 -g [source.d]
copy
Compile only
$ ldc2 -c [source.d]
copy

SYNOPSIS

ldc2 [options] files

DESCRIPTION

ldc is the LLVM-based D compiler. It compiles D language source code to native executables.
The compiler produces fast code using LLVM optimizations. It's one of the main D compilers alongside DMD.

PARAMETERS

FILES

D source files.
-of FILE
Output filename.
-O LEVEL
Optimization level.
-release
Disable runtime checks.
-g
Include debug info.
-c
Compile only, no link.
--help
Display help information.

CAVEATS

Requires LLVM. D language specific. May lag DMD features.

HISTORY

LDC was created to provide LLVM-based compilation for the D programming language, offering better optimization.

SEE ALSO

dmd(1), gdc(1), dub(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community