.TH DMD 1 "2024-04-08" "The D Language Foundation" "The D Language Foundation" .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 -check=[assert|bounds|in|invariant|out|switch][=[on|off]] Enable or disable specific checks .IP -check=[h|help|?] List information on all available checks .IP -checkaction=[D|C|halt|context] Behavior on assert/boundscheck/finalswitch failure .IP -checkaction=[h|help|?] List information on all available check actions .IP -color Turn colored console output on .IP -color=[on|off|auto] Force colored console output on or off, or only when not redirected (default) .IP -conf=\fIfilename\fR Use config file at \fIfilename\fR .IP -cov Do code coverage analysis .IP -cov=ctfe Include code executed during CTFE in coverage report .IP -cov=\fInnn\fR Require at least nnn% code coverage .IP -cpp=\fIfilename\fR Use \fIfilename\fR as the name of the C preprocessor to use for ImportC files .IP -D Generate documentation .IP -Dd\fIdirectory\fR Write documentation file to \fIdirectory\fR .IP -Df\fIfilename\fR Write documentation file to \fIfilename\fR .IP -d Silently allow deprecated features and symbols .IP -de Issue an error when deprecated features or symbols are used (halt compilation) .IP -dw Issue a message when deprecated features or symbols are used (default) .IP -debug Compile in debug code .IP -debug=\fIlevel\fR Compile in debug code <= \fIlevel\fR .IP -debug=\fIident\fR Compile in debug code identified by \fIident\fR .IP -debuglib=\fIname\fR Set symbolic debug library to \fIname\fR .IP -defaultlib=\fIname\fR Set default library to \fIname\fR .IP -deps Print module dependencies (imports/file/version/debug/lib) .IP -deps=\fIfilename\fR Write module dependencies to \fIfilename\fR (only imports) .IP -dllimport=\fIvalue\fR Windows only: select symbols to dllimport (none/defaultLibsOnly/all) .IP -extern-std=\fIstandard\fR Set C++ name mangling compatibility with \fIstandard\fR .IP -extern-std=[h|help|?] List all supported standards .IP -fIBT Generate Indirect Branch Tracking code .IP -fPIC Generate position independent code .IP -fPIE Generate position independent executables .IP -g Add symbolic debug info .IP -gdwarf=\fIversion\fR Add DWARF symbolic debug info .IP -gf Emit debug info for all referenced types .IP -gs Always emit stack frame .IP -gx Add stack stomp code .IP -H Generate 'header' file .IP -Hd=\fIdirectory\fR Write 'header' file to \fIdirectory\fR .IP -Hf=\fIfilename\fR Write 'header' file to \fIfilename\fR .IP -HC[=[?|h|help|silent|verbose]] Write C++ 'header' equivalent to stdout .IP -HCd=\fIdirectory\fR Write C++ 'header' file to \fIdirectory\fR .IP -HCf=\fIfilename\fR Write C++ 'header' file to \fIfilename\fR instead of stdout .IP --help Print help and exit .IP -I=\fIdirectory\fR Look for imports also in \fIdirectory\fR .IP -i[=\fIpattern\fR] Include imported modules in the compilation .IP -ignore Deprecated flag, unsupported pragmas are always ignored now .IP -inline Do function inlining .IP -J=\fIdirectory\fR Look for string imports also in \fIdirectory\fR .IP -L=\fIlinkerflag\fR Pass \fIlinkerflag\fR to link .IP -lib Generate library rather than object files .IP -lowmem Enable garbage collection for the compiler .IP -m32 Generate 32 bit code .IP -m64 Generate 64 bit code .IP -main Add default main() if not present already (e.g. for unittesting) .IP -makedeps[=\fIfilename\fR] Print dependencies in Makefile compatible format to \fIfilename\fR or stdout. .IP -man Open web browser on manual page .IP -map Generate linker .map file .IP -mcpu=\fIid\fR Generate instructions for architecture identified by \fIid\fR .IP -mcpu=[h|help|?] List all architecture options .IP -mixin=\fIfilename\fR Expand and save mixins to file specified by \fIfilename\fR .IP -mv=\fIpackage.module\fR= Use as source file for \fIpackage.module\fR .IP -noboundscheck No array bounds checking (deprecated, use -boundscheck=off) .IP -nothrow Assume no Exceptions will be thrown .IP -O Optimize .IP -o- Do not write object file .IP -od=\fIdirectory\fR Write object & library files to \fIdirectory\fR .IP -of=\fIfilename\fR Name output file to \fIfilename\fR .IP -op Preserve source path for output files .IP -os=\fIos\fR Sets target operating system to \fIos\fR .IP -P=\fIpreprocessorflag\fR Pass \fIpreprocessorflag\fR to C preprocessor .IP -preview=\fIname\fR Enable an upcoming language change identified by \fIname\fR .IP -preview=[h|help|?] List all upcoming language changes .IP -profile Profile runtime performance of generated code .IP -profile=gc Profile runtime allocations .IP -release Contracts and asserts are not emitted, and bounds checking is performed only in @safe functions .IP -revert=\fIname\fR Revert language change identified by \fIname\fR .IP -revert=[h|help|?] List all revertable language changes .IP -run \fIsrcfile\fR Compile, link, and run the program \fIsrcfile\fR .IP -shared Generate shared library (DLL) .IP -target=\fItriple\fR Use \fItriple\fR as -[-][-[-= \fIlevel\fR .IP -version=\fIident\fR Compile in version code identified by \fIident\fR .IP -vgc List all gc allocations including hidden ones .IP -visibility=\fIvalue\fR Default visibility of symbols (default/hidden/public) .IP -vtls List all variables going into thread local storage .IP -vtemplates=[list-instances] List statistics on template instantiations .IP -w Warnings as errors (compilation will halt) .IP -wi Warnings as messages (compilation will continue) .IP -wo Warnings about use of obsolete features (compilation will continue) .IP -X Generate JSON file .IP -Xf=\fIfilename\fR Write JSON file to \fIfilename\fR .IP -Xcc=\fIdriverflag\fR Pass \fIdriverflag\fR to linker driver (cc) .SH TRANSITIONS Language changes listed by \fB-transition=id\fR: .IP \fIfield\fR List all non-mutable fields which occupy an object instance .IP \fIcomplex\fR Give deprecation messages about all usages of complex or imaginary types .IP \fItls\fR List all variables going into thread local storage .IP \fIin\fR List all usages of 'in' on parameter .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 .TP .I /etc/dmd.conf System wide \fBdmd\fR config file. See .BR dmd.conf(5) for details. .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 AUTHOR Copyright (c) 1999-2024 by The D Language Foundation written by Walter Bright .SH "ONLINE DOCUMENTATION" .UR https://dlang.org/dmd.html https://dlang.org/dmd.html .UE .SH "SEE ALSO" .BR dmd.conf (5) .BR rdmd (1) .BR dumpobj (1) .BR obj2asm (1) .BR gcc (1)