Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
July 21, 2020 How DerelictCL works | ||||
---|---|---|---|---|
| ||||
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 |
July 21, 2020 Re: How DerelictCL works | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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 <
> --------------
>
> [...]
Have you install the libopencl** dev dependencies?
|
July 22, 2020 Re: How DerelictCL works | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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 <
> --------------
Looks like an issue in a code gen function. It might be due to changes in LDC. I'll ping Guillaume.
|
July 22, 2020 Re: How DerelictCL works | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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:
Hello,
I don't have time at all at the moment for maintaining DerelictCL, can you provide a fully working PR that fix your problem? I will then make a git tag.
Guillaume
|
July 22, 2020 Re: How DerelictCL works | ||||
---|---|---|---|---|
| ||||
Posted in reply to bioinfornatics | 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)
|
Copyright © 1999-2021 by the D Language Foundation