Tutorial on how to build DMD/druntime/phobos and docs from source?

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Fri Feb 1 04:08:11 PST 2013


On 02/01/2013 09:33 AM, timewulf wrote:
> During my first approach, there was just one misunderstanding on my
> side: I didn't realize (I just didn't look for it.) , that the
> dmd-compiler itself is purely C-code. I thought, I need dmd for
> compiling the newer version.

Actually it's C++, it's just that the filenames all end in .c.

> On the otherhand, I'm a safety-fanatic, first building the new hut
> before razing down the old one, because I dislike tents ... ;-))

Me too, but it's readily possible to do this safely.  Actually I used to first 
build dmd and copy it to location _before_ building druntime/Phobos, so even 
missing off the DMD=../dmd/src/dmd flag I was still always using the correct dmd.

> I think this part, to make installation more easy and smoothy is one
> part, to help on this way. Everyone who heard about d and just wants to
> try-out if he can easily understand some samples, changing some
> parameters to see if they work as expected, doesn't want to put much
> time into installation before.

Have you tried installing LDC?  I consider it by far the friendliest install 
experience of all the D compilers, and if someone was going to have a go at 
reworking the install scripts for DMD, it'd be worth following this model.
http://wiki.dlang.org/Building_LDC_from_source

Personally I recommend using the -DCMAKE_INSTALL_PREFIX=/opt/ldc when invoking 
cmake, as cmake does not by default provide an uninstall option, and this is the 
simplest way to ensure easy removal of what you install.


More information about the Digitalmars-d-learn mailing list