Am 05.08.2011, 08:35 Uhr, schrieb Jacob Carlborg <d...@me.com>:
On 2011-08-04 22:37, Marco Leise wrote:
Am 04.08.2011, 19:34 Uhr, schrieb Jonathan M Davis
<jmdavisp...@gmx.com>:
By the way... the druntime and phobos patches for LDC - are they
applicable to GDC and DMD as well? I'm asking because I could imagine
installing druntime, phobos, DMD, GDC and LDC and all three compilers
would use the same installation of the standard library.
They _can't_ all use the same installations. At minimum, druntime must
be
different for each of them. That's expected and by design. Whether
Phobos
needs to be different for each or not as far as source goes, I don't
know
(hopefully not, but there might be a reason why it has to). But since
the
compiled library includes both druntime and Phobos, that can't be
shared.
- Jonathan M Davis
Thank you for the clarification. My impression was that druntime was
created to make it possible to use either phobos or tango. If the
compiled library includes both (with which compiler anyway? both GDC and
LDC?) I figure that I could not install any two of the three compilers
in their default locations on Linux, correct? If I take the time to
create packages for Gentoo for the alternative compilers that is good to
know. Symlinks and altered library names for druntime/phobos would be
required. But with a mix of DMD1, DMD2, GDC, LDC, Phobos and Tango
things could become messy :p
In the future, DVM could be used for this. DVM lets you easily install
different versions of a D compiler and switch among them. Although it
currently only supports DMD. DVM: https://bitbucket.org/doob/dvm
I have noticed DVM around.
The situation on Gentoo is typically that when there are different
versions of the same package, that can be installed in different 'slots'.
A dependency of these packages is a control file for eselect, a tool to
switch between the currently active implementation (OpenJDK, Sun Java,
...), package version (boost) and several other system configuration
options. 'python' for example ends up as a symlink to either python2.7 or
python3.1 and there are corresponding directory names for the libraries.
It would be ideal if dmd was a symlink to either dmd1 or dmd2 and they
would both use a separate dmd.conf. But since the source code is available
for a while now that should be easy to make possible.
I have never used DVM, but I imagine it works like Maven or the Eclipse
updater. So it would download precompiled compilers and libraries into the
user's home directory, right? With Gentoo being a source distribution it
is usually avoided to download binaries from the internet so I guess DVM
would be one of two options to install D compilers on Gentoo. The
difference in usage would be like this for an installation:
dvm: "dvm install 1.068"
portage: "emerge =dmd-1.068"
and this for setting the system-wide default compiler:
dvm use 1.068 -d
eselect dmd set dmd1
Granted, the portage version would only allow one dmd 1 compiler to be
installed at a time, but that is ok for most users. I guess in theory
there could even be slots for every single release of dmd. This is already
done for Boost and automake in practice (with major revisions). OTOH there
is no option to set the compiler for the current shell, but maybe "export
DMD=dmd1", "make posix.mak" should work.