Installing dmd

Georg Wrede georg.wrede at iki.fi
Sun Mar 1 07:25:30 PST 2009


Georg Wrede wrote:
> Anders F Björklund wrote:
>> Georg Wrede wrote:
>>
>>> What this all comes down to, is, one should be able to install dmd 
>>> for himself, without root privileges, and another user maybe a 
>>> different version of dmd for herself. And a company should be able to 
>>> install dmd for everybody on a computer.
>>
>> The instructions was added to Wiki4D, hoping they would be included:
>> http://prowiki.org/wiki4d/wiki.cgi?D__Tutorial/InstallingDCompiler#InstallingDMDonLinuxX86 

So right now it looks like even those instructions are outdated.

The very minimum is to unzip, chmod and then it's all go, IF one bothers 
to write the full path to dmd each time.

The rest is convenience, i.e. either putting dmd on your path (not 
recommended if one has several versions of dmd), or making an alias for 
(each) dmd, or creating shell scripts in your ~/bin to start each.

What one can't do instead of the above, (and I'm okay with that) is to 
link from ~/bin to the actual dmd, since then dmd won't find its own 
full name, and therefore not the libraries and stuff.

>>> As a side benefit, fixing this most probably yields an easy (and 
>>> documented) way to conveniently have several dmd versions installed 
>>> and usable. For example, D1 and D2, or the last dmd for research and 
>>> an older one for a multi-month pay project.
>>
>> I have D1 installed as "dmd" and D2 installed as "dmd2", it takes
>> some tricks to have it read /etc/dmd.conf and /etc/dmd2.conf though.
>>
>> --anders
> 
> To my surprise, this seems to work:
> 
> $ cd Download
> $ unzip dmd.1.040.zip
> $ mv dmd dmd1040
> $ unzip dmd.2.025.zip
> $ mv dmd dmd2025
> $ alias d1=/home/georg/Download/dmd1040/linux/bin/dmd
> $ alias d2=/home/georg/Download/dmd2025/linux/bin/dmd
> $ chmod u+x /home/georg/Download/dmd1040/linux/bin/dmd
> $ chmod u+x /home/georg/Download/dmd2025/linux/bin/dmd
> $ cd /tmp
> $ vi ver.d
> $ cat ver.d
> import std.stdio;
> import std.compiler;
> 
> void main()
> {
>   writefln("Version %d.%d", version_major, version_minor);
> }
> $ d1 ver.d
> $ ./ver
> Version 1.40
> $ mv ver ver1
> $ d2 ver.d
> $ ./ver
> Version 2.25
> 
> 
> This leads one to expect that most of the job is done!
> 
> Now you actually can have several D versions as non-root installs!!
> 
> I wonder if there are some unexpected gotchas or caveats?
> 
> (And no, I don't have binaries in Download like this, it's just a test...)

So, thanks Walter, the compiler works real cool now!!!!

It's just the documentation that needs a touch-up.



More information about the Digitalmars-d mailing list