libmir / mir

Mir (backports): Sparse tensors, Hoffman
http://mir.libmir.org
Boost Software License 1.0
210 stars 20 forks source link

mir vs ndslice conflict in dmd vs ldc when compiling with dub on ubuntu #383

Closed dataPulverizer closed 7 years ago

dataPulverizer commented 7 years ago

The first time I attempted to compile a library containing mir on Ubuntu 16.04 it failed. It seems that installing dmd (containing dub) and ldc at the same time and attempting to use dub to compile a package containing the mir dependency causes a failure. Below is the output trying to compile a hello world myPackage, which has mir dependency in the dub.json file (doesn't actually use it).

dub run myPackage --compiler=ldc2
Building package myPackage in /home/theUser/code/myPackage/
Fetching mir 0.22.0 (getting selected version)...
Fetching mir-internal 0.0.2 (getting selected version)...
Fetching mir-random 0.0.1 (getting selected version)...
Fetching mir-math 0.0.1 (getting selected version)...
Performing "debug" build using ldc2 for x86_64.
mir-internal 0.0.2: building configuration "library"...
../../.dub/packages/mir-internal-0.0.2/mir-internal/source/mir/internal/utility.d(9,12): Error: module slice is in file 'std/experimental/ndslice/slice.d' which cannot be read
import path[0] = /usr/include/d/ldc
import path[1] = /usr/include/d
import path[2] = ../../.dub/packages/mir-internal-0.0.2/mir-internal/source/
ldc2 failed with exit code 1.

Removing mir from the dependency will cause the package to compile. If I uninstall dmd and install a standalone dub installation, the library (including the mir dependency) will compile. I guess there may be a mir - ndslice conflict on dmd vs ldc.

Versions ...

$ dmd --version
DMD64 D Compiler v2.072.1
Copyright (c) 1999-2016 by Digital Mars written by Walter Bright

$ 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: ivybridge
  http://dlang.org - http://wiki.dlang.org/LDC
9il commented 7 years ago

Does it work with LDC v1.1.0-beta6 ?

dataPulverizer commented 7 years ago

Yes it does, sorry my bad. I forgot about the dependency notice on mir!