dcompute icon indicating copy to clipboard operation
dcompute copied to clipboard

Can not build with LDC 1.9.0 on Windows 10 x64

Open IvanZinkevich opened this issue 7 years ago • 5 comments

Building package dcompute in C:\Users\ivan\AppData\Local\dub\packages\dcompute-0.1.0\dcompute\
Performing "debug" build using C:\LDC\bin\ldc2.exe for x86_64.
dcompute 0.1.0: building configuration "library"...
C:\LDC\bin\..\import\std\array.d(2850,13): Error: TypeInfo cannot be used with -betterC
C:\LDC\bin\ldc2.exe failed with exit code 1.

IvanZinkevich avatar May 11 '18 14:05 IvanZinkevich

Why is it trying to build with -betterC? that broke a while ago.

thewilsonator avatar May 11 '18 14:05 thewilsonator

I've got the exactly same question. I'll check the dependencies later. Maybe they require the betterC option?

IvanZinkevich avatar May 11 '18 15:05 IvanZinkevich

It looks like dcompute package 0.1.0 on code.dlang.org has it in options. Using ~master for now. But this should be either fixed or mentioned in the documentation. How can I help with that?

IvanZinkevich avatar May 11 '18 22:05 IvanZinkevich

Looks like i need to either update that release or add a new release. Thanks for the offer though.

If you want to help (one of) the next things on my list is to add the OpenCL & CUDA API requirements as contracts (or just plain asserts) to the wrapper so that it is obvious where one using the library has stuffed up.

e.g. OpenCL's create buffer should become (from the documentation section on errors):

Buffer!T createBuffer(T)(T[] arr,Memory.Flags flags = (Memory.Flags.useHostPointer | Memory.Flags.readWrite))
{
    import std.stdio;
    assert(raw); // valid context
    assert(EnumMembers!(Memory.Flags).canFind(flags); // valid flags
    if(flags == Memory.Flags.useHostPtr || flags == Memory.Flags.copyHostPtr)
          assert(arr); // need non-null buffer if using host buffer
    else
         assert(arr is null); // 
    Buffer!T ret;
    auto len = memSize(arr);
    ret.raw = clCreateBuffer(raw,flags,len,arr.ptr,cast(int*)&status);
    ret.hostMemory = arr;
    checkErrors(); // allocation can still fail or we could be OOM
    return ret;
}

thewilsonator avatar May 12 '18 06:05 thewilsonator

Any news on this? Getting the same error. Maybe it's time to add a new release and fix all of it?

Aphexus avatar Feb 28 '19 12:02 Aphexus