Skip Menu |

This queue is for tickets about the Perl-Dist-Strawberry CPAN distribution.

Report information
The Basics
Id: 66511
Status: resolved
Priority: 0/
Queue: Perl-Dist-Strawberry

People
Owner: Nobody in particular
Requestors: sisyphus [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: complex.h's cpow() broken.
Hi, I have: 'Win32 strawberryperl 5.12.0.1 #1 Thu May 6 16:09:27 2010 i386' 'Win32 strawberryperl 5.12.2.0 #1 Fri Nov 5 20:21:06 2010 i386' and 'Win32 strawberryperl 5.12.0.1 #1 Fri May 7 04:27:48 2010 x64' Math::Complex_C won't build on any of those perls because of a problem resolving the cpow() function. Here's the demo C code: ######################### #include <stdio.h> #include <complex.h> int main(void) { double _Complex rop, op, power; __real__ op = 3.0; __imag__ op = 0.0; __real__ power = 2.0; __imag__ power = 0.0; rop = cpow(op, power); printf("%f %f\n", creal(rop), cimag(rop)); return 0; } ######################### The error: c:/_32/strawberry512/c/bin/../lib/gcc/i686-w64- mingw32/4.4.3/../../../../i686-w64-mingw32/lib/libmingwex.a (lib32_libmingwex_a-cpow.o): In function `cpow': /opt/W64_156151-src.32/build-crt/../mingw-w64-crt/complex/cpow.c:39: undefined reference to `_imp__pow' collect2: ld returned 1 exit status This is the same error as kills the Math::Complex_C build on my 32-bit and 64-bit builds of Strawberry. I did find the same behaviour with 'gcc version 4.4.4 20100208 (prerelease) (GCC)', but the other builds from the mingw64 project that I have, all work fine. I've rated the severity of this bug as "Normal". I wouldn't argue with anyone who wanted to change that rating (in either direction ;-) Cheers, Rob
On Wed Mar 09 22:16:00 2011, SISYPHUS wrote: Show quoted text
> Hi, > I have: > 'Win32 strawberryperl 5.12.0.1 #1 Thu May 6 16:09:27 2010 i386' > 'Win32 strawberryperl 5.12.2.0 #1 Fri Nov 5 20:21:06 2010 i386' > and > 'Win32 strawberryperl 5.12.0.1 #1 Fri May 7 04:27:48 2010 x64' > > Math::Complex_C won't build on any of those perls because of a problem > resolving the cpow() function. Here's the demo C code: >
Thanks for letting us know! The intention is to do a compiler/libraries update when the version of Strawberry using 5.14.0 comes out - so it shouldn't be too horribly long now. Keep in touch with kmx@cpan.org - he's the one who helps build the compiler and libraries for Strawberry.
Show quoted text
> Keep in touch with kmx@cpan.org - he's the one who helps build the
> compiler and libraries for Strawberry.

Just a note that I am registering this issue (will check it with the new gcc toolchain for perl 5.14).

Slightly OT question on sisyphus - if you could decide would you recommend the new toolchain (consider May/2011) to be based on mingw-w64's gcc-4.4(.6) or gcc-4.5(.2)?

--
kmx

Subject: Re: [rt.cpan.org #66511] complex.h's cpow() broken.
Date: Wed, 20 Apr 2011 12:40:44 +1000
To: <bug-Perl-Dist-Strawberry [...] rt.cpan.org>, <sisyphus [...] cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Show quoted text
----- Original Message ----- From: "kmx via RT" <bug-Perl-Dist-Strawberry@rt.cpan.org> To: <sisyphus@cpan.org> Sent: Tuesday, April 19, 2011 6:25 PM Subject: [rt.cpan.org #66511] complex.h's cpow() broken.
> <URL: https://rt.cpan.org/Ticket/Display.html?id=66511 > >
>> Keep in touch with kmx@cpan.org - he's the one who helps build the >> compiler and libraries for Strawberry.
> > Just a note that I am registering this issue (will check it with the new > gcc > toolchain for perl 5.14).
Excellent. (I don't think Math::Complex_C would be in great demand - but it's always nice to see compilers doing things correctly, even if only for the sake of it.)
> Slightly OT question on sisyphus - if you could decide would you recommend > the > new toolchain (consider May/2011) to be based on mingw-w64's gcc-4.4(.6) > or > gcc-4.5(.2)?
To my knowledge, I've no reason to prefer one over the other. That doesn't mean that no such reason exists - it just means that "my knowledge" wrt the comparitive capabilities of those compilers is (woefully) poor. As regards complex arithmetic, I do know that my 32-bit gcc-4.4.0 compiler (from mingw.org) seems to do everything correctly, as too does my 64-bit gcc-4.6.0 compiler. To make things more OT: It would be nice to see Salvador Garcia's Math::Int128 build with the 64-bit Strawberry compiler - but, irrespective of the version of gcc, that probably requires some patching to the compiler's _mingw.h and/or the Math::Int128 source. I got it built with my 4.6.0 without too much trouble. Firstly, a one line addition to _mingw.h: #ifndef __SIZEOF_INT128__ typedef int __int128 __attribute__ ((__mode__ (TI))); typedef unsigned int __uint128 __attribute__ ((__mode__ (TI))); /* Added by SISYPHUS */ #endif Then, the small patch to Int128.xs at http://www.sisyphusion.tk/ppm/patches/Math-Int128-diff.txt The Math::Int128 Makefile.PL insists that the gcc version be at least 4.6.0 - so that would also have to be worked around if using an earlier version of the compiler. (Haven't really thought much about a *portable* fix.) Cheers, Rob
Show quoted text
> It would be nice to see Salvador Garcia's Math::Int128 build with the
> 64-bit Strawberry compiler

I suggest this way https://rt.cpan.org/Ticket/Display.html?id=67653

--
kmx

Rob,

could you please check whether this is still an issue with 5.14.2.1 ?

Thanks.

--
kmx

On Sun Feb 26 12:10:32 2012, KMX wrote: Show quoted text
> Rob, > > could you please check whether this is still an issue with 5.14.2.1 ?
No problems here - for either Math::Complex_C or Math::Int128. Cheers, Rob
Sending the previous mail has failed. Please contact your admin, they can find more details in the logs.