dlang-community / libdparse

Library for lexing and parsing D source code
https://libdparse.dlang.io
Boost Software License 1.0
115 stars 56 forks source link

Not compiling with gdc/ldc. #152

Closed pirocks closed 7 years ago

pirocks commented 7 years ago

Output of compiling with ldc2:

francis@DESKTOP-20H72HP:~/libdparse$ dub --compiler=gdc
Performing "debug" build using gdc for x86_64.
libdparse 0.7.1-beta.5: building configuration "library"...
src/dparse/parser.d:9:8: error: module mallocator is in file 'std/experimental/allocator/mallocator.d' which cannot be read
 import std.experimental.allocator.mallocator;
        ^
import path[0] = /usr/include/d
import path[1] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
import path[2] = /home/francis/libdparse/src
gdc failed with exit code 1.
francis@DESKTOP-20H72HP:~/libdparse$

Output of compiling with gdc:

francis@DESKTOP-20H72HP:~/libdparse$ dub --compiler=gdc
Performing "debug" build using gdc for x86_64.
libdparse 0.7.1-beta.5: building configuration "library"...
src/dparse/parser.d:9:8: error: module mallocator is in file 'std/experimental/allocator/mallocator.d' which cannot be read
 import std.experimental.allocator.mallocator;
        ^
import path[0] = /usr/include/d
import path[1] = /usr/lib/gcc/x86_64-linux-gnu/5/include/d
import path[2] = /home/francis/libdparse/src
gdc failed with exit code 1.
francis@DESKTOP-20H72HP:~/libdparse$

Output of 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
  Host CPU: broadwell
  http://dlang.org - http://wiki.dlang.org/LDC

  Registered Targets:
    aarch64    - AArch64 (little endian)
    aarch64_be - AArch64 (big endian)
    amdgcn     - AMD GCN GPUs
    arm        - ARM
    arm64      - ARM64 (little endian)
    armeb      - ARM (big endian)
    bpf        - BPF (host endian)
    bpfeb      - BPF (big endian)
    bpfel      - BPF (little endian)
    cpp        - C++ backend
    hexagon    - Hexagon
    mips       - Mips
    mips64     - Mips64 [experimental]
    mips64el   - Mips64el [experimental]
    mipsel     - Mipsel
    msp430     - MSP430 [experimental]
    nvptx      - NVIDIA PTX 32-bit
    nvptx64    - NVIDIA PTX 64-bit
    ppc32      - PowerPC 32
    ppc64      - PowerPC 64
    ppc64le    - PowerPC 64 LE
    r600       - AMD GPUs HD2XXX-HD6XXX
    sparc      - Sparc
    sparcel    - Sparc LE
    sparcv9    - Sparc V9
    systemz    - SystemZ
    thumb      - Thumb
    thumbeb    - Thumb (big endian)
    x86        - 32-bit X86: Pentium-Pro and above
    x86-64     - 64-bit X86: EM64T and AMD64
    xcore      - XCore

Output of gdc -v:

Using built-in specs.
COLLECT_GCC=gdc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
wilzbach commented 7 years ago

Recent DMD and LDC releases are tested:

https://travis-ci.org/dlang-community/libdparse

GDC isn't supported as it uses an old frontend. Btw the LDC compiler on your system.is horribly outdated. Ubuntu is unfortunately using Debian stable (though even on Debian, LDC is at 1.1.1) I recommend using the official download updater (http://dlang.org/download.html), e.g.

curl https://i.dlang.io | bash -s ldc

should be all you need ;-) Btw do you have any reason to avoid using the reference compiler DMD? It's licensed in Boost and blazingly fast for development.

I am closing this now as invalid, please feel free to ask questions at D.learn if you need more help to install recent compilers on your system.

pirocks commented 7 years ago

Thanks for the fast response. just to answer you question:

Btw do you have any reason to avoid using the reference compiler DMD?

I was planning on using gdb and, I've had bad experiences with dmd and gdb.

wilzbach commented 7 years ago

I was planning on using gdb and, I've had bad experiences with dmd and gdb.

FWIW It works quite well on my system (GDB 8.0, dmd 2.074). Even the standard library (built with DMD), has a .debug targets for debugging individual modules: https://github.com/dlang/phobos/blob/master/posix.mak#L403