www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Installing ldc breaks gdc

reply Eduard Staniloiu <edi33416 gmail.com> writes:
Hello, everyone.

So I have found that installing ldc will break gdc.

The setup:

I have a VM running a 64bit Ubuntu 16.04, as you can see from the 
output of uname -a:


18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I have installed:
   dmd --version: DMD64 D Compiler v2.072.0
   gdc --version: gdc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 
20160609

With this setup, in /usr/include we can find dmd/
/usr/include/dmd
|-- druntime
|   `-- import
|       |-- core
|       |-- etc

As far as I can tell(guess), both dmd and gdc are using this one.

I installed ldc2 (using apt-get install ldc):
   ldc2 --version: LDC - the LLVM D compiler (0.17.1):
                   based on DMD v2.068.2 and LLVM 3.8.0
                   Default target: x86_64-pc-linux-gnu

After installing ldc2, in /usr/include a new folder, d/, was 
created
/usr/include/d
|-- core
|-- etc
|-- ldc
`-- std

And now, the issue:
After the steps above, when I try to compile something using gdc, 
it fails with the following error:

/usr/include/d/core/stdc/stdarg.d:48:5: error: undefined 
identifier _va_list_tag
      alias __va_list = __va_list_tag;
      ^

Based on my previous assumtion (both dmd and gdc use 
/usr/include/dmd/) and the error above, I am inclined to believe 
that after installing ldc, gdc is using /usr/include/d/ and it 
breaks.

Maybe we should consider having a separate folder in 
/usr/include/ for each compiler?

Cheers,
Eduard
Dec 09 2016
next sibling parent Johannes Pfau <nospam example.com> writes:
Am Fri, 09 Dec 2016 15:59:07 +0000
schrieb Eduard Staniloiu <edi33416 gmail.com>:

 Hello, everyone.
 
 So I have found that installing ldc will break gdc.
 
 The setup:
 
 I have a VM running a 64bit Ubuntu 16.04, as you can see from the 
 output of uname -a:
 

 18:29:54 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
 
 I have installed:
    dmd --version: DMD64 D Compiler v2.072.0
    gdc --version: gdc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 
 20160609
 
 With this setup, in /usr/include we can find dmd/
 /usr/include/dmd
 |-- druntime
 |   `-- import
 |       |-- core
 |       |-- etc
 
 As far as I can tell(guess), both dmd and gdc are using this one.
 
 I installed ldc2 (using apt-get install ldc):
    ldc2 --version: LDC - the LLVM D compiler (0.17.1):
                    based on DMD v2.068.2 and LLVM 3.8.0
                    Default target: x86_64-pc-linux-gnu
 
 After installing ldc2, in /usr/include a new folder, d/, was 
 created
 /usr/include/d
 |-- core
 |-- etc
 |-- ldc
 `-- std
 
 And now, the issue:
 After the steps above, when I try to compile something using gdc, 
 it fails with the following error:
 
 /usr/include/d/core/stdc/stdarg.d:48:5: error: undefined 
 identifier _va_list_tag
       alias __va_list = __va_list_tag;
       ^
 
 Based on my previous assumtion (both dmd and gdc use 
 /usr/include/dmd/) and the error above, I am inclined to believe 
 that after installing ldc, gdc is using /usr/include/d/ and it 
 breaks.
 
 Maybe we should consider having a separate folder in 
 /usr/include/ for each compiler?
 
 Cheers,
 Eduard
 
Archlinux uses /usr/include/dlang/[dmd|gdc|ldc]. Maybe debian/ubuntu should do that as well or maybe we could even change the path in upstream GDC.
Dec 09 2016
prev sibling next sibling parent reply Daniel Kozak via Digitalmars-d <digitalmars-d puremagic.com> writes:
Dne 9.12.2016 v 16:59 Eduard Staniloiu via Digitalmars-d napsal(a):
 Hello, everyone.

 ...

 Based on my previous assumtion (both dmd and gdc use 
 /usr/include/dmd/) and the error above, I am inclined to believe that 
 after installing ldc, gdc is using /usr/include/d/ and it breaks.

 Maybe we should consider having a separate folder in /usr/include/ for 
 each compiler?

 Cheers,
 Eduard
No thats all wrong, dmd a gdc could not use same include directory that is not possible. GDC use /usr/lib/gcc/x86_64-linux-gnu/5/include/d/ LDC use /usr/include/d/ and dmd use: /usr/include/dmd You probably have some misconfiguration issue
Dec 09 2016
next sibling parent reply Matthias Klumpp <mak debian.org> writes:
Hi!

This issue should be fixed since LDC 1:1.1.0-2, which Xenial 
doesn't have.
Ideally, fetch a newer version from Debian or a PPA to solve this 
issue.

Cheers,
     Matthias
Dec 09 2016
next sibling parent Iain Buclaw via Digitalmars-d <digitalmars-d puremagic.com> writes:
On 9 December 2016 at 18:53, Matthias Klumpp via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 Hi!

 This issue should be fixed since LDC 1:1.1.0-2, which Xenial doesn't have.
 Ideally, fetch a newer version from Debian or a PPA to solve this issue.

 Cheers,
     Matthias
Thanks
Dec 09 2016
prev sibling next sibling parent Eduard Staniloiu <edi33416 gmail.com> writes:
On Friday, 9 December 2016 at 17:53:30 UTC, Matthias Klumpp wrote:
 Hi!

 This issue should be fixed since LDC 1:1.1.0-2, which Xenial 
 doesn't have.
 Ideally, fetch a newer version from Debian or a PPA to solve 
 this issue.

 Cheers,
     Matthias
Hi! Thank you for your answer. For future readers, this indeed has solved the problem. Just add the ppa: sudo add-apt-repository ppa:d-language-packagers/ppa And install the new version: sudo apt-get update; sudo apt-get install ldc Cheers, Eduard
Dec 13 2016
prev sibling parent Joseph Rushton Wakeling <joseph.wakeling webdrake.net> writes:
On Friday, 9 December 2016 at 17:53:30 UTC, Matthias Klumpp wrote:
 This issue should be fixed since LDC 1:1.1.0-2, which Xenial 
 doesn't have.
 Ideally, fetch a newer version from Debian or a PPA to solve 
 this issue.
Is there any chance of getting a fix in Xenial itself (whether by an update to 1.1.0 or via an updated 1.0.0 package)? It's pretty worrying if two LTS packages clash in this way. BTW what source is the LDC 1:1.1.0-2 package built from? Is it using one of the LDC beta releases? AFAIK LDC 1.1.0 has not yet been released.
Dec 14 2016
prev sibling parent Eduard Staniloiu <edi33416 gmail.com> writes:
On Friday, 9 December 2016 at 17:34:35 UTC, Daniel Kozak wrote:

On Friday, 9 December 2016 at 17:34:35 UTC, Daniel Kozak wrote:
 No thats all wrong, dmd a gdc could not use same include 
 directory that is not possible. GDC use

 /usr/lib/gcc/x86_64-linux-gnu/5/include/d/
Yes and no.. as you can see from the verbose output binary /usr/lib/gcc/x86_64-linux-gnu/5/cc1d version v2.067.1 parse gcd_bench importall gcd_bench import object (/usr/lib/gcc/x86_64-linux-gnu/5/include/d/object.d) import std.algorithm (/usr/include/d/std/algorithm/package.d) import std.algorithm.comparison (/usr/include/d/std/algorithm/comparison.d) import std.functional (/usr/include/d/std/functional.d) . . import std.stdiobase (/usr/include/d/std/stdiobase.d) /usr/include/d/core/stdc/stdarg.d:48:5: error: undefined identifier __va_list_tag alias __va_list = __va_list_tag; ^ import core.stdc.errno (/usr/include/d/core/stdc/errno.d)
 LDC use

 /usr/include/d/
binary /usr/bin/ldc2 version 0.17.1 (DMD v2.068.2, LLVM 3.8.0) config /etc/ldc2.conf contents of /etc/ldc2.conf: default: { // 'switches' holds array of string that are appends to the command line // arguments before they are parsed. switches = [ "-I/usr/include/d/ldc", "-I/usr/include/d", "-L-L/usr/lib", "-defaultlib=phobos2-ldc,druntime-ldc", "-debuglib=phobos2-ldc-debug,druntime-ldc-debug" ]; };
 and dmd use:

 /usr/include/dmd
binary dmd version v2.072.0 config /etc/dmd.conf contents of /etc/dmd.conf: [Environment32] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/i386-linux-gnu -L--export-dynamic [Environment64] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import -L-L/usr/lib/x86_64-linux-gnu -L--export-dynamic
 You probably have some misconfiguration issue
Everything is default, since they all have been installed with apt-get install
Dec 10 2016
prev sibling next sibling parent Iain Buclaw via Digitalmars-d <digitalmars-d puremagic.com> writes:
On 9 December 2016 at 18:34, Daniel Kozak via Digitalmars-d
<digitalmars-d puremagic.com> wrote:
 Dne 9.12.2016 v 16:59 Eduard Staniloiu via Digitalmars-d napsal(a):
 Hello, everyone.

 ...

 Based on my previous assumtion (both dmd and gdc use /usr/include/dmd/)
 and the error above, I am inclined to believe that after installing ldc, gdc
 is using /usr/include/d/ and it breaks.

 Maybe we should consider having a separate folder in /usr/include/ for
 each compiler?

 Cheers,
 Eduard
No thats all wrong, dmd a gdc could not use same include directory that is not possible. GDC use /usr/lib/gcc/x86_64-linux-gnu/5/include/d/ LDC use /usr/include/d/ and dmd use: /usr/include/dmd You probably have some misconfiguration issue
No, the /usr/include/d is considered a system includes directory. Any distribution package headers should be installed there, not ldc-specific header. :-) Regards Iain
Dec 09 2016
prev sibling parent Daniel Kozak via Digitalmars-d <digitalmars-d puremagic.com> writes:
Ok, thats your opinion :P


Dne 9.12.2016 v 23:04 Iain Buclaw via Digitalmars-d napsal(a):
 On 9 December 2016 at 18:34, Daniel Kozak via Digitalmars-d
 <digitalmars-d puremagic.com> wrote:
 Dne 9.12.2016 v 16:59 Eduard Staniloiu via Digitalmars-d napsal(a):
 Hello, everyone.

 ...

 Based on my previous assumtion (both dmd and gdc use /usr/include/dmd/)
 and the error above, I am inclined to believe that after installing ldc, gdc
 is using /usr/include/d/ and it breaks.

 Maybe we should consider having a separate folder in /usr/include/ for
 each compiler?

 Cheers,
 Eduard
No thats all wrong, dmd a gdc could not use same include directory that is not possible. GDC use /usr/lib/gcc/x86_64-linux-gnu/5/include/d/ LDC use /usr/include/d/ and dmd use: /usr/include/dmd You probably have some misconfiguration issue
No, the /usr/include/d is considered a system includes directory. Any distribution package headers should be installed there, not ldc-specific header. :-) Regards Iain
Dec 09 2016