LinuxCommandLibrary

dmd

D programming language reference compiler

TLDR

Compile D source file

$ dmd [file.d]
copy
Compile with output name
$ dmd -of=[output] [file.d]
copy
Compile with optimizations
$ dmd -O [file.d]
copy
Compile to object file only
$ dmd -c [file.d]
copy
Include import paths
$ dmd -I[/path/to/imports] [file.d]
copy
Enable all warnings
$ dmd -w [file.d]
copy
Generate debug info
$ dmd -g [file.d]
copy

SYNOPSIS

dmd [options] file...

DESCRIPTION

dmd is the reference compiler for the D programming language. It compiles D source code to native machine code, supporting the full D language specification including templates, mixins, and compile-time function execution.
D combines the power of low-level programming with modern language features like garbage collection, closures, and built-in unit testing. dmd provides fast compilation suitable for rapid development cycles.
The compiler includes a standard library (Phobos) with extensive functionality for common programming tasks, and supports interfacing with C and C++ code.

PARAMETERS

FILE

D source file(s) to compile.
-of=FILE
Output file name.
-O
Enable optimizations.
-c
Compile only (no link).
-IPATH
Add import path.
-w
Enable all warnings.
-g
Generate debug information.
-release
Compile for release (disable asserts).
-unittest
Compile and run unit tests.
--help
Display help information.

CONFIGURATION

/etc/dmd.conf or ~/.dmd/dmd.conf

Import paths, library paths, and default compiler flags.

CAVEATS

Reference implementation may have performance differences from alternative compilers (LDC, GDC). Some optimizations less aggressive than LLVM-based compilers. Platform support varies.

HISTORY

dmd was created by Walter Bright, who began developing D in 1999 as a successor to C and C++. The first public release was in 2001. D draws on experience from compiler development and aims to fix perceived issues in C++.

SEE ALSO

ldc(1), gdc(1), rdmd(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community