libmir/mir-glas

dub not building mir-glas with dependencies

jmh530 opened this issue · 3 comments

I'm on Windows 7 64bit with dmd 2.74.0, ldc 1.3.0 beta2, dub 1.3.0, and Visual Studio 2017.

The dub header to the mir-glas readme.md suggests that one can include a mir-glas project in a dub project essentially automatically. However, I have not had much success with this.

I created a new dub project with the following dub.json

{
	"name": "testing_mir_glas",
	"authors": [
		"jmh530"
	],
	"dependencies": {
		"mir-algorithm": ">=0.6.6",
		"mir-glas": ">=0.2.3",
		"mir-cpuid": ">=0.5.2"
	},
	"dflags-ldc2": ["-mcpu=native"],
	"lflags": ["-L$MIR_GLAS_PACKAGE_DIR", "-L$MIR_CPUID_PACKAGE_DIR"],
	"description": "A minimal D application.",
	"license": "proprietary"
}

and source\app.d (was going to add mir-glas stuff later)

import std.stdio;
import mir.ndslice.algorithm : sliced;

void main()
{
	auto x = [1, 2, 3, 4, 5].sliced;
	writeln("done.");
}

I tried compiling with dub build, dub build --compiler=ldmd2, and dub build --compiler=ldc2. The result is basically the same

C:\ProgrammingFiles\DFiles\testing\testing_mir_glas>dub build --compiler=ldmd2
The determined compiler type "ldc" doesn't match the expected type "dmd". This w
ill probably result in build errors.
Performing "debug" build using ldmd2 for x86_64.
mir-algorithm 0.6.6: target for configuration "library" is up to date.
mir-cpuid 0.5.2: building configuration "library"...
testing_mir_glas ~master: building configuration "application"...
Running pre-build commands...
The determined compiler type "ldc" doesn't match the expected type "dmd". This w
ill probably result in build errors.

Neither a package description file, nor source/app.d was found in
'C:\ProgrammingFiles\DFiles\dubFolder\mir-glas-0.2.3\'
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.

No valid root package found - aborting.
Command failed with exit code 2

@jmh530 did you manage to compile the program?

@MigMuc I have not tried again recently on this machine.

I'm having the same problem (Windows 7 64bit, dmd v2.76.0, ldc v1.5.0 beta1)

Running pre-build commands...
The determined compiler type "ldc" doesn't match the expected type "dmd". This will probably result in build errors.
Neither a package description file, nor source/app.d was found in
$ProjectDir\'$AppData\Roaming\dub\packages\mir-glas-0.2.3\mir-glas\'
Please run DUB from the root directory of an existing package, or run
"dub init --help" to get information on creating a new package.


No valid root package found - aborting.
Command failed with exit code 2

It looks like $MIR_GLAS_PACKAGE_DIR is appended to the project directory, which obviously results in a non existing path.