DMD(1)

NAME
dmd - Digital Mars D2.x Compiler

SYNOPSIS
dmd files ... [ -switch ... ]

DESCRIPTION
dmd Compiles source code written in the D programming language.

OPTIONS

file, file.d, file.htm, file.html
    D source files to compile

file.di
    D interface files

file.o
    Object files to link in

file.a
    Library files to link in

@cmdfile
    A file to read more command-line arguments from, which may contain # single-line comments

-c  Compile only, do not link

-cov
    Include code coverage analysis

-D  Generate documentation

-Dddocdir
    Write documentation file to docdir directory

-Dffilename
    Write documentation file to filename

-d  Silently allow deprecated features.

-dw Show use of deprecated features as warnings (default).

-de Show use of deprecated features as errors (halt compilation).

-debug
    Compile in debug code

-debug=level
    Compile in debug code <= level

-debug=ident
    Compile in debug code identified by ident

-debuglib=name
    Set the symbolic debug library to name

-defaultlib=name
    Set the default library to name

-deps=filename
    Write module dependencies to filename

-fPIC
    Generate position independent code.

-g  Add symbolic debug info.

-gc Add symbolic debug info in C format (for older gdb's.)

-gs Always emit stack frame.

-H  Generate D interface file.

-Hddir
    Write D interface file to dir directory.

-Hffilename
    Write D interface file to filename

--help
    Print help

-Ipath
    Where to look for imports. path is a : separated list of paths. Multiple -I s can be used, and the paths are searched in the same order.

-ignore
    Ignore unsupported pragmas

-inline
    Inline expand functions

-Jpath
    Where to look for string imports. path is a : separated list of paths. Multiple -J s can be used, and the paths are searched in the same order.

-Llinkerflag
    Pass linkerflag to the linker, for example, -M

-lib
    Generate a library rather than object files

-man
    Open web browser on manual page

-map
    Generate linker .map file

-O  Optimize

-o- Suppress generation of object file

-odobjdir
    write object files relative to directory objdir instead of the current directory

-offilename
    set output file name to filename in the output directory

-op normally the path for .d source files is stripped off when generating an object file name. -op will leave it on.

-profile
    Profile the runtime performance of the generated code

-property
    Enforce property syntax

-quiet
    Suppress non-essential compiler messages

-release
    Compile release version

-run srcfile args...
    Compile, link, and run the program srcfile with the rest of the command line, args..., as the arguments to the program. No .o or executable file is left behind.

-unittest
    Compile in unittest code

-v  verbose

-version=level
    compile in version code >= level

-version=ident
    compile in version code identified by ident

-vtls
    List all variables going into thread local storage

-w  Enable warnings

-wi Enable informational warnings

-m32
    Compile to 32 bit code.

-m64
    Compile to 64 bit code.

-X  Generate JSON file.

-Xffilename
    Write JSON file to filename

LINKING
Linking is done directly by the dmd compiler after a successful compile. To prevent dmd from running the linker, use the -c switch.

The actual linking is done by running gcc. This ensures compatibility with modules compiled with gcc.

FILES
/etc/dmd.conf dmd will look for the initialization file dmd.conf in the directory /etc. If found, environment variable settings in the file will override any existing settings.

ENVIRONMENT
The D compiler dmd uses the following environment variables:

DFLAGS
    The value of DFLAGS is treated as if it were appended on the command line to dmd.

BUGS
-g is only implemented for line numbers, not local symbols, because I haven't figured out how to do it yet. gdb still works, though, at the global symbol level.

The code generator output has not been tuned yet, so it can be bloated.

Shared libraries cannot be generated.

The exception handling is not compatible with the way g++ does it. I don't know if this is an issue or not.

The compiler sometimes gets the line number wrong on an error.

AUTHOR
Copyright (c) 1999-2009 by Digital Mars written by Walter Bright

ONLINE DOCUMENTATION
http://www.digitalmars.com/d/index.html (http://www.digitalmars.com/d/index.html)

SEE ALSO
dmd.conf(5) rdmd(1) dumpobj(1) obj2asm(1) gcc(1)