PsuAeroacoustics / OpenCOPTER

OpenCOPTER is a python library for fast and efficient simulation of multirotor aerodynamics
GNU General Public License v3.0
9 stars 1 forks source link

Type Casting and Template Instantiation Errors with Latest LDC Build on WSL Ubuntu #7

Open dingzhw opened 1 week ago

dingzhw commented 1 week ago

Hello! I encountered build errors when compiling OpenCOPTER with ldc2 on my WSL Ubuntu2004 setup. The errors involve failed type casting between double[] and double, and issues with template instantiations, notably with sqrt!(immutable(double[8])) and atan!(double[8]). Below is a snippet of the error output:

$ dub build -c library-novtk -b release --compiler=ldc2
    Fetching kxml 1.1.1 (getting selected version)
    Starting Performing "release" build using ldc2 for x86_64.
    Building kxml 1.1.1: building configuration [library]
    Building numd ~master: building configuration [library]
    Building opencopter ~development: building configuration [library-novtk]
is not basic: double[8]
source/opencopter/math/package.d(213,75): Error: cannot cast expression `vector[0..2]` of type `immutable(double)[]` to `double`
source/opencopter/math/package.d(214,75): Error: cannot cast expression `vector[2..4]` of type `immutable(double)[]` to `double`
source/opencopter/math/package.d(215,75): Error: cannot cast expression `vector[4..6]` of type `immutable(double)[]` to `double`
source/opencopter/math/package.d(216,75): Error: cannot cast expression `vector[6..8]` of type `immutable(double)[]` to `double`
source/opencopter/inflow/huangpeters/math.d(84,34): Error: template instance `opencopter.math.sqrt!(immutable(double[8]))` error instantiating
source/opencopter/math/trigonometry.d(448,77): Error: cannot cast expression `vector[0..2]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(449,77): Error: cannot cast expression `vector[2..4]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(450,77): Error: cannot cast expression `vector[4..6]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(451,77): Error: cannot cast expression `vector[6..8]` of type `double[]` to `double`
source/opencopter/inflow/huangpeters/math.d(87,45): Error: template instance `opencopter.math.trigonometry.atan!(double[8])` error instantiating
source/opencopter/math/trigonometry.d(514,79): Error: cannot cast expression `vector1[0..2]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(514,107): Error: cannot cast expression `vector2[0..2]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(515,79): Error: cannot cast expression `vector1[2..4]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(515,107): Error: cannot cast expression `vector2[2..4]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(516,79): Error: cannot cast expression `vector1[4..6]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(516,107): Error: cannot cast expression `vector2[4..6]` of type `double[]` to `double`
source/opencopter/math/trigonometry.d(517,79): Error: cannot cast expression `vector1[6..8]` of type `double[]` to `double`
Error ldc2 failed with exit code 1.

I’ve updated LDC to the latest version and ensured dependencies are up to date. Any guidance would be greatly appreciated. Thank you!

Rob-Rau commented 5 days ago

Thanks for reaching out. I’ve been using LDC v 1.28 for development and that version will still work. I still need to update the codebase to support newer compilers.