How DerelictCL works

WebFreak001 d.forum at webfreak.org
Wed Jul 22 16:41:21 UTC 2020


On Tuesday, 21 July 2020 at 12:00:03 UTC, bioinfornatics wrote:
> Dear,
>
> I would like to use OpenCL in D. Thus I try to use DerelictCL.
> But I fail to use it I encounter this error message:
> --------------
> /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di(835): Error: genCLVectorTypes cannot be interpreted at compile time, because it has no available source code
> /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di-mixin-835(835): Error: declaration expected, not <
> --------------
>
>
> The tiny D file is:
> ------test_opencl.d--------
>
> import derelict.opencl.cl;
>
> void main() {
>     // Load the OpenCL library.
>     DerelictCL.load();
> }
> ---------------------------
>
>
> The compile line is:
>
> --------------
> ldc2  -I 
> /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/ \
>       -L-L/usr/lib64 \
>       -L-L/opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64 \
>       -L-lOpenCL \
>       -L-lDerelictUtil \
>       -L-lDerelictCL \
>       -of test \
>       test_opencl.d
> --------------
>
> library are located at:
> OpenL           /usr/lib64/libOpenCL.so
> DerelictUtil    
> /opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64/libDerelictUtil.so
> DerelictCL      
> /opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64/libDerelictCL.so
>
> Derelict include files:= are located at:
>  - /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/
>
>
> Thanks for your help
>
> Best regards

where did you get these .di files from you have in your include 
directory?

I don't think these are officially produced by the derelict-cl 
library and are the reason why your compilation is breaking. (it 
wants to evaluate some function at compile time, probably some 
CTFE or manifest constant, which fails because it only has 
definitions inside the .di file and not the function 
implementation)


More information about the Digitalmars-d-learn mailing list