.TH DMD 1 "2011-02-22" "Digital Mars" "Digital Mars D" .SH NAME dmd \- Digital Mars D2.x Compiler .SH SYNOPSIS .B dmd \fIfiles\fR ... [ \fI-switch\fR ... ] .SH DESCRIPTION .B dmd Compiles source code written in the D programming language. .SH OPTIONS .IP "file, file.d, file.htm, file.html" D source files to compile .IP file.di D interface files .IP file.o Object files to link in .IP file.a Library files to link in .IP @cmdfile A file to read more command-line arguments from, which may contain # single-line comments .IP -allinst Generate code for all template instantiations .IP -betterC Omit generating some runtime information and helper functions .IP -boundscheck=[on|safeonly|off] bounds checks on, in @safe only, or off .IP -c Compile only, do not link .IP -color[=on|off] Force colored console output on or off .IP -conf=path Use config file at path .IP -cov Include code coverage analysis .IP -cov=nnn Require at least nnn% code coverage .IP -D Generate documentation .IP -Dd\fIdocdir\fR Write documentation file to .I docdir directory .IP -Df\fIfilename\fR Write documentation file to .I filename .IP -d Silently allow deprecated features. .IP -dw Show use of deprecated features as warnings (default). .IP -de Show use of deprecated features as errors (halt compilation). .IP -debug Compile in debug code .IP -debug=\fIlevel\fR Compile in debug code <= .I level .IP -debug=\fIident\fR Compile in debug code identified by .I ident .IP -debuglib=\fIname\fR Set the symbolic debug library to .I name .IP -defaultlib=\fIname\fR Set the default library to .I name .IP -deps=\fIfilename\fR Write module dependencies to .I filename .IP -fPIC Generate position independent code. .IP -dip25 Implement http://wiki.dlang.org/DIP25 (experimental) .IP -g Add symbolic debug info. .IP -gc Add symbolic debug info in C format (for older \fBgdb\fR's.) .IP -gs Always emit stack frame. .IP -gx Add stack stomp code. .IP -H Generate D interface file. .IP -Hd\fIdir\fR Write D interface file to .I dir directory. .IP -Hf\fIfilename\fR Write D interface file to .I filename .IP --help Print help .IP -I\fIpath\fR Where to look for imports. .I path is a : separated list of paths. Multiple .B -I s can be used, and the paths are searched in the same order. .IP -ignore Ignore unsupported pragmas .IP -inline Inline expand functions .IP -J\fIpath\fR Where to look for string imports. .I path is a : separated list of paths. Multiple .B -J s can be used, and the paths are searched in the same order. .IP -L\fIlinkerflag\fR Pass .I linkerflag to the linker, for example, -M .IP -lib Generate a library rather than object files .IP -m32 Generate 32 bit code .IP -m64 Generate 64 bit code .IP -man Open web browser on manual page .IP -map Generate linker .map file .IP -noboundscheck No array bounds checking (deprecated, use -boundscheck=off) .IP -O Optimize .IP -o- Suppress generation of object file .IP -od\fIobjdir\fR write object files relative to directory .I objdir instead of the current directory .IP -of\fIfilename\fR set output file name to .I filename in the output directory .IP -op normally the path for .B .d source files is stripped off when generating an object file name. .B -op will leave it on. .IP -profile Profile the runtime performance of the generated code .IP -profile=\fgc\f Profile runtime allocations .IP -property Enforce property syntax .IP -quiet Suppress non-essential compiler messages .IP -release Compile release version .IP "-run \fIsrcfile args...\fR" Compile, link, and run the program .I srcfile with the rest of the command line, \fI args...\fR, as the arguments to the program. No .o or executable file is left behind. .IP -shared Generate shared library (DLL) .IP -transition=id With language change identified by 'id' .IP -transition=? List all language changes .IP -unittest Compile in unittest code .IP -v verbose .IP -vcolumns Print character (column) numbers in diagnostics .IP -verrors=num Limit the number of error messages (0 means unlimited) .IP -verrors=spec Show error messages from speculative compiles, such as __traits(compiles, ...) .IP -vgc List all gc allocations including hidden ones .IP -vtls List all variables going into thread local storage .IP -version=\fIlevel\fR compile in version code >= .I level .IP -version=\fIident\fR compile in version code identified by .I ident .IP -w Warnings as errors (compilation will halt) .IP -wi Warnings as messages (compilation will continue) .IP -X Generate JSON file. .IP -Xf\fIfilename\fR Write JSON file to .I filename .SH LINKING Linking is done directly by the .B dmd compiler after a successful compile. To prevent .B dmd from running the linker, use the .B -c switch. .PP The actual linking is done by running \fBgcc\fR. This ensures compatibility with modules compiled with \fBgcc\fR. .SH FILES .I /etc/dmd.conf dmd will look for the initialization file .I dmd.conf in the directory \fI/etc\fR. If found, environment variable settings in the file will override any existing settings. .SH ENVIRONMENT The D compiler dmd uses the following environment variables: .IP DFLAGS 10 The value of .B DFLAGS is treated as if it were appended on the command line to \fBdmd\fR. .SH BUGS .B -g is only implemented for line numbers, not local symbols, because I haven't figured out how to do it yet. .B gdb still works, though, at the global symbol level. .PP The code generator output has not been tuned yet, so it can be bloated. .PP Shared libraries cannot be generated. .PP The exception handling is not compatible with the way .B g++ does it. I don't know if this is an issue or not. .PP The compiler sometimes gets the line number wrong on an error. .SH AUTHOR Copyright (c) 1999-2016 by Digital Mars written by Walter Bright .SH "ONLINE DOCUMENTATION" .UR http://www.digitalmars.com/d/index.html http://www.digitalmars.com/d/index.html .UE .SH "SEE ALSO" .BR dmd.conf (5) .BR rdmd (1) .BR dumpobj (1) .BR obj2asm (1) .BR gcc (1)