mir-algorithm icon indicating copy to clipboard operation
mir-algorithm copied to clipboard

Error: template mir.math.common.copysign cannot deduce function from argument types !()(int, real), candidates are:

Open InnotSagg opened this issue 5 years ago • 0 comments

I try cross build from linux for -mtriple=x86_64-w64-mingw32, get this error:

mir-algorithm/source/mir/format_impl.d(19): Error: template mir.math.common.copysign cannot deduce function from argument types !()(int, real), candidates are:
mir-core/source/mir/math/common.d(201):        copysign(T)(in T mag, in T sgn)
mir-algorithm/source/mir/format_impl.d(108): Error: template instance mir.format_impl.printFloatingPointGen!real error instantiating
 ldc2 -v -mtriple=x86_64-w64-mingw32
binary    /usr/local/bin/ldc2
version   1.25.1 (DMD v2.095.1, LLVM 11.0.1)
config    /usr/local/etc/ldc2.conf (x86_64-w64-windows-gnu)
Error: No source files

add cast(double) to the code like this:

    bool neg = copysign(1, cast(double)c) < 0;

get this error:

Intrinsic has incorrect argument type!
x86_fp80 (x86_fp80*)* @llvm.fabs.f80
in function _D3mir11format_impl__T21printFloatingPointGenTeZQBaFNaNbNiNeeKxSQCk6format10FormatSpecKG512aZm
LLVM ERROR: Broken function found, compilation aborted!

InnotSagg avatar Mar 28 '21 13:03 InnotSagg