Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

752 lines (566 sloc) 26.477 kb
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<!--
Copyright (c) 1999-2011 by Digital Mars
All Rights Reserved Written by Walter Bright
http://www.digitalmars.com
-->
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="keywords" content="D programming language" />
<meta name="description" content="D Programming Language" />
<title>DMD Compiler for Linux - D Programming Language 2.0 - Digital Mars</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/print.css" media="print" />
<link rel="shortcut icon" href="favicon.ico" />
<!-- enable this for automated hyphenation, see http://code.google.com/p/hyphenator/ -->
<!--
<script src="http://erdani.com/js/Hyphenator.js" type="text/javascript"></script>
<script type="text/javascript">Hyphenator.run();</script>
-->
<script type="text/javascript">
function bodyLoad()
{
var links = document.getElementById("navigation").getElementsByTagName("a");
for (var i = 0; i < links.length; i++)
{
var url = "/" + links[i].getAttribute("href");
if (window.location.href.match(url + "\x24") == url)
{
var cls = links[i].getAttribute("class");
links[i].setAttribute("class", cls ? cls + " active" : "active");
break;
}
}
}
</script>
</head>
<body onload="bodyLoad()">
<div id="top">
<form method="get" action="http://www.google.com/search">
<div id="search-box">
<img src="images/search-left.gif" width="11" height="22" /><input id="q" name="q" /><input type="image" id="search-submit" name="submit" src="images/search-button.gif" />
<input type="hidden" id="domains" name="domains" value="www.digitalmars.com" />
<input type="hidden" id="sourceid" name="sourceid" value="google-search" />
<div id="search-dropdown">
<select id="sitesearch" name="sitesearch" size="1">
<option value="www.digitalmars.com/d/2.0">Entire D 2.0 Site</option>
<option value="www.digitalmars.com/d/2.0/phobos">Library Reference</option>
<option value="www.digitalmars.com/d/archives">Newsgroup Archives</option>
</select>
</div>
</div>
</form>
<div id="header">
<a href="http://www.digitalmars.com"><img id="logo" width="253" height="37" border="0" alt="Digital Mars" src="images/dmlogo.gif"></a>
<div id="d-language"><a href="">D Programming Language 2.0</a></div>
</div>
</div>
<!-- Generated by Ddoc from dcompiler.dd -->
<div id="navigation">
<div class="navblock">
<h2><a href="index.html" title="D Programming Language">D 2.0 Home</a></h2>
<ul> <li><a href="overview.html" title="D language overview">Overview</a></li>
<li><a href="comparison.html" title="D feature list">Features</a></li>
<li><a href="download.html" title="Download a D compiler">Downloads &amp; Tools</a>
<div class="navblock">
<ul> <li><a href="dmd-linux.html" title="dmd - the Digital Mars D compiler">DMD D Compiler (Linux)</a></li>
<li><a href="dmd-freebsd.html" title="dmd - the Digital Mars D compiler">DMD D Compiler (FreeBSD)</a></li>
<li><a href="dmd-osx.html" title="dmd - the Digital Mars D compiler">DMD D Compiler (Mac OSX)</a></li>
<li><a href="dmd-windows.html" title="dmd - the Digital Mars D compiler">DMD D Compiler (Windows)</a></li>
<li><a href="changelog.html" title="History of changes to D">D Change Log</a></li>
<li><a href="http://bitbucket.org/goshawk/gdc/wiki/Home" title="gdc - the Gnu D compiler">GDC D Compiler</a></li>
<li><a href="http://dnet.codeplex.com/" title="D Compiler for .NET">D.NET Compiler</a></li>
<li><a href="http://www.digitalmars.com/ctg/optlink.html" title="Optlink - the Digital Mars Linker">Linker</a></li>
<li><a href="http://www.digitalmars.com/ctg/trace.html" title="DMD's builtin code profiling tool">Profiler</a></li>
<li><a href="code_coverage.html" title="DMD's builtin code coverage analysis tool">Code Coverage</a></li>
<li><a href="rdmd.html" title="rdmd - run D programs as if they were scripts">DMD Script Shell</a></li>
<li><a href="windbg.html" title="windbg - debugging Windows programs">Windows Debugger</a></li>
<li><a href="htod.html" title="htod - mechanically convert C .h header files to D">C .h to D .d</a></li>
<li><a href="http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport" title="Editors with support for D">Editors</a></li>
<li><a href="http://www.prowiki.org/wiki4d/wiki.cgi?ReferenceForTools" title="Even more tools for D">More Tools</a></li>
<li><a href="http://d.puremagic.com/issues/" title="D issue and bug tracking system">Issues &amp; Bugs</a></li>
</ul>
</div>
</li>
<li><a href="faq.html" title="Frequently Asked Questions">FAQ</a></li>
<li><a href="appendices.html">Appendices</a></li>
<li><a href="acknowledgements.html" title="Thank-you to these people who have helped with D">Acknowledgements</a></li>
<li><a href="http://www.digitalmars.com/d/1.0/index.html" title="D Programming Language 1.0">D1 Home</a></li>
</ul>
</div>
<div class="navblock">
<h2>Documentation</h2>
<ul> <li><a href="language-reference.html">Language Reference</a></li>
<li><a href="phobos/index.html">Library Reference</a></li>
<li><a href="howtos.html" title="Helps for using D">Howtos</a></li>
<li><a href="articles.html">Articles</a></li>
</ul>
</div>
<div class="navblock">
<h2>Community</h2>
<ul> <li><a href="http://www.digitalmars.com/NewsGroup.html" title="User forums">Forums</a></li>
<li><a href="http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage" title="Wiki for the D Programming Language">Wiki</a></li>
<li><a href="http://www.dsource.org/" title="D projects and libraries at dsource.org">Projects &amp; Libraries</a></li>
<li><a href="http://twitter.com/#search?q=%23d_lang" title="#d_lang on twitter.com">Twitter</a></li>
<li><a href="http://www.digitalmars.com/d/dlinks.html" title="External D related links">Links</a></li>
</ul>
</div>
<div id="translate" class="tool"><script type="text/javascript">document.write("Translate this page:")</script>
<div id="google_translate_element"></div><script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script><script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</div>
</div>
<div id="content">
<div id="tools">
<span id="lastupdate">Last update Sat Jan 29 18:52:17 2011
</span>
<span id="wiki"><a href="http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/DCompiler">Comment on this page</a></span>
</div>
<h1> dmd - Linux D Compiler</h1>
<ul>
<li>dmd for <a href="dmd-windows.html">Windows</a></li>
<li>dmd for <a href="dmd-osx.html"> OSX</a></li>
<li>dmd for <a href="dmd-freebsd.html">FreeBSD</a></li>
<li><a href="#requirements">Requirements and Downloads</a></li>
<li><a href="#files">Files</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#switches">Compiler Arguments and Switches</a></li>
<li><a href="#linking">Linking</a></li>
<li><a href="#environment">Environment Variables</a></li>
<li><a href="#dmd_conf">dmd.conf</a> Initialization File</li>
<li><a href="#differences">Differences between Windows and Linux versions</a></li>
<li><a href="#interface_files">D Interface Files</a></li>
<li><a href="#library">Building Libraries</a></li>
<li><a href="#compiling_dmd">Compiling dmd</a></li>
<li><a href="#compiling_phobos">Compiling Phobos</a></li>
</ul>
<h2><a name="requirements">Requirements and Downloads</a></h2>
<ol><li><a href="http://www.digitalmars.com/d/download.html">Download D Compiler</a></li>
<li>32 bit x86 Linux operating system (will work on 64 bit Linux)</li>
<li>Gnu C compiler (gcc)</li>
</ol>
<h2><a name="files">Files</a></h2>
<dl> <dt><tt>dmd2/src/phobos/</tt>
<dd>D runtime library source</dd>
</dt>
<dt><tt>dmd2/src/dmd/</tt>
<dd>D compiler front end source under dual (GPL and Artistic) license</dd>
</dt>
<dt><tt>dmd2/html/d/</tt>
<dd>Documentation</dd>
</dt>
<dt><tt>dmd2/samples/d/</tt>
<dd>Sample D programs</dd>
</dt>
<dt><tt>dmd2/linux/bin/dmd</tt>
<dd>D compiler executable</dd>
</dt>
<dt><tt>dmd2/linux/bin/<a href="http://www.digitalmars.com/ctg/dumpobj.html">dumpobj</a></tt>
<dd>Elf file dumper</dd>
</dt>
<dt><tt>dmd2/linux/bin/<a href="http://www.digitalmars.com/ctg/obj2asm.html">obj2asm</a></tt>
<dd>Elf file disassembler</dd>
</dt>
<dt><tt>dmd2/linux/bin/<a href="http://www.digitalmars.com/ctg/shell.html">shell</a></tt>
<dd>Simple command line shell</dd>
</dt>
<dt><tt>dmd2/linux/bin/<a href="#dmd_conf">dmd.conf</a></tt>
<dd>Global compiler settings (copy to <tt>/etc/dmd.conf</tt>)</dd>
</dt>
<dt><tt>dmd2/linux/lib/libphobos2.a</tt>
<dd>D runtime library (copy to <tt>/usr/lib/libphobos2.a</tt>)</dd>
</dt>
</dl>
<h2><a name="installation">Installation</a></h2>
<li>Unzip the archive into your home directory.
It will create
a <tt>~/dmd</tt> directory with all the files in it.
All the tools are command line tools, which means
they are run from a console window.</li>
<li>Copy <tt><a href="#dmd_conf">dmd.conf</a></tt> to <tt>/etc</tt>:
<pre class="console"><span class="notranslate">cp dmd2/linux/bin/<a href="#dmd_conf">dmd.conf</a> /etc
</span></pre>
</li>
<li>Put <tt>dmd2/linux/bin</tt> on your <b>PATH</b>,
or copy the linux executables
to <tt>/usr/local/bin</tt></li>
<li>Copy the library to <tt>/usr/lib</tt>:
<pre class="console"><span class="notranslate">cp dmd2/linux/lib/libphobos2.a /usr/lib
</span></pre>
</li>
<h3>Installing dmd on 64 bit Linux</h3>
<p>Since dmd is a 32 bit compiler, the 32 bit gnu libraries must be installed:</p>
<pre class="console"><span class="notranslate">sudo apt-get install gcc-multilib g++-multilib libc6-i386 libc6-dev-i386
</span></pre>
<p>The <tt>ia32-libs</tt> package has more 32 bit libraries, and may
optionally also be installed:</p>
<pre class="console"><span class="notranslate">sudo apt-get install ia32-libs
</span></pre>
<p>If you are using the .deb package for one-click install, it may
give you an error about it being only for i386. To force it to install:
</p>
<pre class="console"><span class="notranslate">sudo dpkg -i --force-architecture dmd_X.XXX-0_i386.deb
</span></pre>
<p>where X.XXX is the version number of the package.
</p>
<h2><a name="switches">Compiler Arguments and Switches</a></h2>
<dl> <dt><b>dmd</b> <i>files</i>... -<i>switches</i>...
<dd></dd>
</dt>
<dt><i>files</i>...
<dd> <table border=1 cellpadding=4 cellspacing=0><caption>File Extensions</caption> <tr> <th scope="col">Extension</th>
<th scope="col">File Type</th>
</tr>
<tr> <td><i>none</i></td>
<td>D source files</td>
</tr>
<tr> <td><b>.d</b></td>
<td>D source files</td>
</tr>
<tr> <td><b>.dd</b></td>
<td><a href="ddoc.html">Ddoc</a> source files</td>
</tr>
<tr> <td><b>.di</b></td>
<td><a href="#interface_files">D interface files</a></td>
</tr>
<tr> <td><b>.o</b></td>
<td>Object files to link in</td>
</tr>
<tr> <td><b>.a</b></td>
<td>Object code libraries to search</td>
</tr>
</table>
</dd>
</dt>
<dt><b>@</b><i>cmdfile</i></dt><dd> If <i>cmdfile</i> is an environment variable,
read the compiler arguments and switches from
the value of that variable.
Otherwise, read compiler arguments and switches from
the text file <i>cmdfile</i>
</dd>
<dt><b>-c</b></dt><dd> compile only, do not link
</dd>
<dt><b>-cov</b></dt><dd> instrument for <a href="code_coverage.html">code coverage analysis</a>
</dd>
<dt><b>-D</b></dt><dd> generate <a href="ddoc.html">documentation</a> from source
</dd>
<dt><b>-Dd</b><i>docdir</i></dt><dd> write documentation file to <i>docdir</i> directory
</dd>
<dt><b>-Df</b><i>filename</i></dt><dd> write documentation file to <i>filename</i>
</dd>
<dt><b>-d</b></dt><dd> allow deprecated features
</dd>
<dt><b>-debug</b></dt><dd> compile in <a href="version.html#debug">debug</a> code
</dd>
<dt><b>-debug=</b><i>level</i></dt><dd> compile in <a href="version.html#debug">debug level</a> &lt;= <i>level</i>
</dd>
<dt><b>-debug=</b><i>ident</i></dt><dd> compile in <a href="version.html#debug">debug identifier</a> <i>ident</i>
</dd>
<dt><b>-debuglib=</b><i>libname</i></dt><dd> link in <i>libname</i> as the default library when
compiling for symbolic debugging instead of <b>libphobos2.a</b>
</dd>
<dt><b>-defaultlib=</b><i>libname</i></dt><dd> link in <i>libname</i> as the default library when
not compiling for symbolic debugging instead of <b>libphobos2.a</b>
</dd>
<dt><b>-deps=</b><i>filename</i></dt><dd> write module dependencies as text to <i>filename</i>
</dd>
<dt><b>-fPIC</b></dt><dd> generate Position Independent Code (which is used
for building shared libraries).
</dd>
<dt><b>-g</b></dt><dd>
add Dwarf symbolic debug info with
<a href="abi.html#dwarf">D extensions</a>
for debuggers such as
<a href="http://www.zerobugs.org/">ZeroBUGS</a>
</dd>
<dt><b>-gc</b></dt><dd>
add Dwarf symbolic debug info in C format
for debuggers such as
<tt>gdb</tt>
</dd>
<dt><b>-H</b></dt><dd> generate <a href="#interface_files">D interface file</a>
</dd>
<dt><b>-Hd</b><i>dir</i></dt><dd> write D interface file to <i>dir</i> directory
</dd>
<dt><b>-Hf</b><i>filename</i></dt><dd> write D interface file to <i>filename</i>
</dd>
<dt><b>--help</b></dt><dd> print brief help to console
</dd>
<dt><b>-inline</b></dt><dd> inline expand functions at the discretion of the compiler.
This can improve performance, at the expense of making
it more difficult to use a debugger on it.
</dd>
<dt><b>-I</b><i>path</i></dt><dd> where to look for
<a href="module.html#ImportDeclaration">imports</a>.
<i>path</i> is a ; separated
list of paths. Multiple <b>-I</b>'s can be used, and the paths
are searched in the same order.
</dd>
<dt><b>-ignore</b></dt><dd> ignore unsupported pragmas
</dd>
<dt><b>-J</b><i>path</i></dt><dd> where to look for files for
<a href="expression.html#ImportExpression"><i>ImportExpression</i></a>s.
This switch is required in order to use <i>ImportExpression</i>s.
<i>path</i> is a ; separated
list of paths. Multiple <b>-J</b>'s can be used, and the paths
are searched in the same order.
</dd>
<dt><b>-L</b><i>linkerflag</i></dt><dd> pass <i>linkerflag</i> to the
linker, for example,
<tt>-L-M</tt>
</dd>
<dt><b>-lib</b></dt><dd> generate library file as output instead of object file(s).
All compiled source files, as well as object files and library
files specified on the command line, are inserted into
the output library.
Compiled source modules may be partitioned into several object
modules to improve granularity.
The name of the library is taken from the name of the first
source module to be compiled. This can be overridden with
the <b>-of</b> switch.
</dd>
<dt><b>-man</b></dt><dd>
open browser specified by the <b>BROWSER</b>
environment variable on this page. If <b>BROWSER</b> is
undefined, <b>x-www-browser</b> is assumed.
</dd>
<dt><b>-noboundscheck</b></dt><dd> turns off all array bounds checking, even for safe functions
</dd>
<dt><b>-O</b></dt><dd> Optimize generated code. For fastest executables, compile
with the <b>-O -release -inline</b> switches together.
</dd>
<dt><b>-o-</b></dt><dd> Suppress generation of object file. Useful in
conjuction with <b>-D</b> or <b>-H</b> flags.
</dd>
<dt><b>-od</b><i>objdir</i></dt><dd> <dd>write object files relative to directory <i>objdir</i>
instead of to the current directory</dd>
</dd>
<dt><b>-of</b><i>filename</i></dt><dd> Set output file name to <i>filename</i> in the output
directory. The output file can be an object file,
executable file, or library file depending on the other
switches.
</dd>
<dt><b>-op</b></dt><dd> normally the path for <b>.d</b> source files is stripped
off when generating an object file name. <b>-op</b> will leave
it on.
</dd>
<dt><b>-profile</b></dt><dd> <a href="http://www.digitalmars.com/ctg/trace.html">profile</a>
the runtime performance
of the generated code
</dd>
<dt><b>-quiet</b></dt><dd> suppress non-essential compiler messages
</dd>
<dt><b>-release</b></dt><dd>
compile release version, which means not generating
code for contracts and asserts. Array bounds checking
is not done for system and trusted functions.
</dd>
<dt><b>-run</b> <i>srcfile args...</i>
compile</dt><dd>link, and run the program <i>srcfile</i> with the
rest of the
command line, <i>args...</i>, as the arguments to the program.
No .o or executable file is left behind.
</dd>
<dt><b>-unittest</b></dt><dd> compile in <a href="unittest.html">unittest</a> code, turns on asserts, and sets the
<tt>unittest</tt> <a href="version.html#PredefinedVersions">version identifier</a>
</dd>
<dt><b>-v</b></dt><dd> verbose
</dd>
<dt><b>-vtls</b></dt><dd> print informational messages identifying variables defaulting
to thread local storage. Handy for migrating to shared model.
</dd>
<dt><b>-version=</b><i>level</i></dt><dd> compile in <a href="version.html#version">version level</a> &gt;= <i>level</i>
</dd>
<dt><b>-version=</b><i>ident</i></dt><dd> compile in <a href="version.html#version">version identifier</a> <i>ident</i>
</dd>
<dt><b>-w</b></dt><dd> enable <a href="warnings.html">warnings</a>
</dd>
<dt><b>-wi</b></dt><dd> enable <a href="warnings.html">informational warnings (i.e. compilation
still proceeds normally)</a>
</dd>
</dl>
<h2><a name="linking">Linking</a></h2>
<p>Linking is done directly by the <b>dmd</b> compiler after a successful
compile. To prevent <b>dmd</b> from running the linker, use the
<b>-c</b> switch.
</p>
<p>The actual linking is done by running <b>gcc</b>.
This ensures compatibility with modules compiled with <b>gcc</b>.
</p>
<h2><a name="environment">Environment Variables</a></h2>
<p>The D compiler dmd uses the following environment variables:
</p>
<dl>
<dt><b>CC</b>
<dd> <b>dmd</b> normally runs the linker by looking for <b>gcc</b>
along the <b>PATH</b>. To use a specific linker instead, set the
<b>CC</b> environment variable to it. For example:
<pre class="console"><span class="notranslate">set CC=gcc
</span></pre>
<dt><b>BROWSER</b>
<dd>This sets the browser used to open the manual page with
the <b>-man</b> switch. It defaults to <tt>x-www-browser</tt>.
</dd>
</dt>
<dt><b>DFLAGS</b>
<dd>The value of <b>DFLAGS</b> is treated as if it were appended to the
command line to <b>dmd</b>.
</dl>
<h2><a name="dmd_conf">dmd.conf Initialization File</a></h2>
<p>The dmd file <tt>dmd.conf</tt> is the same as <tt>sc.ini</tt>
for Windows, it's just that the file has a different name,
enabling a setup common to both Windows and this system to be created
without having to re-edit the file.</p>
<p><b>dmd</b> will look for the initialization file <tt>dmd.conf</tt> in the
following sequence of directories:</p>
<ol><li>current working directory</li>
<li>directory specified by the <b>HOME</b> environment variable</li>
<li>directory <b>dmd</b> resides in</li>
<li><tt>/etc/</tt></li>
</ol>
<p>If found, environment variable
settings in the file will override any existing settings.
This is handy to make <b>dmd</b> independent of programs with
conflicting use of environment variables.
</p>
<p>Environment variables follow the <tt>[Environment]</tt> section
heading, in <i>NAME</i>=<i>value</i> pairs.
The <i>NAME</i>s are treated as upper case.
Comments are lines that start with ;.
For example:
</p>
<pre class="scini"><span class="notranslate">; dmd.conf file for dmd
; Names enclosed by %% are searched for in the existing environment
; and inserted. The special name %@P% is replaced with the path
; to this file.
[Environment]
DFLAGS=-I%@P%/../src/phobos -I%@P%/../src/druntime/import
</span></pre>
<hr>
<h2><a name="differences">Differences between Windows and Linux versions</a></h2>
<ul> <li>String literals are read-only under Linux.
Attempting to write to them
will cause a segment violation.</li>
</ul>
<hr>
<h2><a name="interface_files">D Interface Files</a></h2>
<p>When an import declaration is processed in a D source file,
the compiler searches for the D source file corresponding to
the import, and processes that source file to extract the
information needed from it. Alternatively, the compiler can
instead look for a corresponding <i>D interface file</i>.
A D interface file contains only what an import of the module
needs, rather than the whole implementation of that module.
</p>
<p>The advantages of using a D interface file for imports rather
than a D source file are:
</p>
<ul><li>D interface files are often significantly smaller and much
faster to process than the corresponding D source file.</li>
<li>They can be used to hide the source code, for example,
one can ship an object code library along with D interface files
rather than the complete source code.</li>
</ul>
<p>D interface files can be created by the compiler from a
D source file by using the <b>-H</b> switch to the compiler.
D interface files have the <b>.di</b> file extension.
When the compiler resolves an import declaration, it first looks
for a <b>.di</b> D interface file, then it looks for a D source
file.
</p>
<p>D interface files bear some analogous similarities to C++
header files. But they are not required in the way that C++
header files are, and they are not part of the D language.
They are a feature of the compiler, and serve only as an optimization
of the build process.
</p>
<h2><a name="executable">Building Executables</a></h2>
<p><b>dmd</b> can build an executable much faster if as many of the
source files as possible are put on the command line.</p>
<p>Another advantage to putting multiple source files on the same
invocation of <b>dmd</b> is that <b>dmd</b> will be able to do some level
of cross-module optimizations, such as function inlining across modules.
</p>
<h2><a name="library">Building Libraries</a></h2>
<p>There are three ways to build a library. For example,
given <tt>foo.d</tt> and <tt>bar.d</tt> which are to be compiled, and existing
object file <tt>bar.o</tt> and existing library
<tt>def.a</tt> which are
all to be combined into a library <tt>foo.a</tt>:</p>
<ol><li>Compile modules separately and then run the librarian on them:
<pre class="console"><span class="notranslate">dmd -c foo.d
dmd -c bar.d
rm -f foo.a
ar -r foo.a foo.o bar.o abc.o def.a
rm foo.o bar.o
</span></pre>
This option is typical when using a makefile to avoid compiling
modules that have already been compiled.
</li>
<li>Compile modules together and then run the librarian on them:
<pre class="console"><span class="notranslate">dmd -c foo.d bar.d
rm -f foo.a
ar -r foo.a foo.o bar.o abc.o def.a
rm foo.o bar.o
</span></pre>
</li>
<li>Use <b>dmd</b> to compile and build library in one operation:
<pre class="console"><span class="notranslate">dmd -lib foo.d bar.d abc.o def.a
</span></pre>
No object files are written to disk, it's all done in memory.
Using <b>-lib</b> also has the advantage that modules may be compiled
into multiple object files rather than exactly one per module.
This improves granularity of the library without having to break
up the modules.
</li>
</ol>
<h2><a name="compiling_dmd">Compiling dmd</a></h2>
<p>Complete source code is provided to build the compiler.
Follow these steps:</p>
<pre class="console"><span class="notranslate">cd ~/dmd2/src/dmd
make -f linux.mak
</span></pre>
<h2><a name="compiling_phobos">Compiling Phobos</a></h2>
<p>Complete source code is provided to build Phobos, the D runtime library.
Follow these steps:</p>
<pre class="console"><span class="notranslate">cd ~/dmd2/src/druntime
make -f posix.mak DMD=~/dmd2/linux/bin/dmd
cd ../phobos
make -f linux.mak DMD=~/dmd2/linux/bin/dmd
</span></pre>
<div id="google_ad">
<!-- Google ad -->
<script type="text/javascript"><!--
/**/google_ad_client = "pub-5628673096434613";
/**/google_ad_width = 728;
/**/google_ad_height = 90;
/**/google_ad_format = "728x90_as";
/**/google_ad_channel ="3651639259";
/**/google_page_url = document.location;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>
<div id="footernav">
<a href="http://www.digitalmars.com/NewsGroup.html" title="User Forums">Forums</a> |
<a href="http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/DCompiler" title="Read/write comments and feedback">Comments</a> |
<a href="index.html" title="D Programming Language" class="dlink">&nbsp;D&nbsp;</a> |
<a href="http://www.digitalmars.com/advancedsearch.html" title="Search Digital Mars web site">Search</a> |
<a href="download.html" title="Download D">Downloads</a> |
<a href="http://www.digitalmars.com/" title="www.digitalmars.com">Home</a>
</div>
<div id="copyright">
Copyright &copy; 1999-2011 by Digital Mars &reg;, All Rights Reserved |
Page generated by <a href="ddoc.html">Ddoc</a>.
</div>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.