Skip Menu |
 

This queue is for tickets about the Math-GMPz CPAN distribution.

Report information
The Basics
Id: 46499
Status: resolved
Priority: 0/
Queue: Math-GMPz

People
Owner: Nobody in particular
Requestors: bobjkuo [...] gmail.com
Cc:
AdminCc:

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



Subject: v. 0.26 test suite bugs on Mac OS X 10.5
Date: Fri, 29 May 2009 15:50:48 -0500
To: bug-Math-GMPz [...] rt.cpan.org
From: Bob Kuo <bobjkuo [...] gmail.com>
Download (untitled) / with headers
text/plain 4.1k
Short version: The test suite for Math::GMPz 0.26 fails on new.t test 3, not_zero.t test 3, and use64bigint.t tests 1 and 3 Long version: I used MacPorts to install gmp and am using gmp @4.2.4_1+universal (active) To build, I had to point the configure script to a different location because they are installed in a weird location on Mac. Here is the relevant system info `uname -a` Darwin bob.chapter 9.7.0 Darwin Kernel Version 9.7.0: Tue Mar 31 22:52:17 PDT 2009; root:xnu-1228.12.14~1/RELEASE_I386 i386 `perl -V` Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=darwin, osvers=9.0, archname=darwin-thread-multi-2level uname='darwin b02.apple.com 9.0 darwin kernel version 9.3.0: tue aug 12 17:18:07 pdt 2008; root:xnu-1228.5.90~13release_i386 i386 ' config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include', optimize='-O3', cppflags='-no-cpp-precomp -arch ppc -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include' ccversion='', gccversion='4.0.1 (Apple Inc. build 5465)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='cc -mmacosx-version-min=10.5.7', ldflags ='-arch ppc -arch i386 -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-arch ppc -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP USE_ITHREADS USE_LARGE_FILES USE_PERLIO USE_REENTRANT_API Locally applied patches: fix for regcomp CVE-2007-5116 security vulnerability fix for double-free CVE-2008-1927 security vulnerability /Library/Perl/Updates/<version> comes before system perl directories installprivlib and installarchlib points to the Updates directory Built under darwin Compiled at Mar 11 2009 16:09:08 @INC: /Library/Perl/Updates/5.8.8/darwin-thread-multi-2level /Library/Perl/Updates/5.8.8 /System/Library/Perl/5.8.8/darwin-thread-multi-2level /System/Library/Perl/5.8.8 /Library/Perl/5.8.8/darwin-thread-multi-2level /Library/Perl/5.8.8 /Library/Perl /Network/Library/Perl/5.8.8/darwin-thread-multi-2level /Network/Library/Perl/5.8.8 /Network/Library/Perl /System/Library/Perl/Extras/5.8.8/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.8 /Library/Perl/5.8.6 /Library/Perl/5.8.1 . `gcc --version` i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465) Copyright (C) 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. and attached is the output from running `prove` on the test suite. Originally the TRmpz_out_str.t failed all tests but that was just because the permissions of the out* files weren't set correctly. I fixed this with: `sudo chmod g+w out*` and they all passed. I have a hunch that the tests are failing because of the 64int support being set incorrectly. Bob

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 2.6k
On Fri May 29 16:51:18 2009, bobjkuo@gmail.com wrote: Show quoted text
> `perl -V`
[snip] Show quoted text
> config_args='-ds -e -Dprefix=/usr -Dccflags=-g -pipe -Dldflags= > -Dman3ext=3pm -Duseithreads -Duseshrplib'
[snip] Show quoted text
> use64bitint=define use64bitall=define uselongdouble=undef
That's odd .... how do those configure args result in 'use64bitint' and 'use64bitall' being defined ? Show quoted text
> ivtype='long', ivsize=4, nvtype='double', nvsize=8,
And to top things off, despite 'use64bitint' and 'use64bitall' having been defined, it's just a regular 32-bit build of perl. I doubt that we'll ever want to build a 64-bit int build of Math-GMPz when ivsize < 8, so this patch to the Makefilel.PL should fix things portably: ############################## --- Makefile.PL Fri May 22 18:18:19 2009 +++ Makefile.PL_new Sat May 30 10:31:48 2009 @@ -20,10 +20,12 @@ if($use_64_bit_int == -1) {} elsif($use_64_bit_int == 1) {$defines .= " -DUSE_64_BIT_INT"} else { - if($Config::Config{use64bitint} eq 'define' || - $Config::Config{use64bitall} eq 'define' || - $Config::Config{usemorebits} eq 'define' || - $Config::Config{ivsize} == 8 ) {$defines .= " -DUSE_64_BIT_INT"} + unless($Config::Config{ivsize} < 8) { + if($Config::Config{use64bitint} eq 'define' || + $Config::Config{use64bitall} eq 'define' || + $Config::Config{usemorebits} eq 'define') + {$defines .= " -DUSE_64_BIT_INT"} + } } if($use_long_double == -1) {} ############################## (That patch is for the 0.27 Makefile.PL - but it should apply to the 0.26 Makefile.PL as well.) Show quoted text
> Originally the TRmpz_out_str.t failed all tests but that was just > because the permissions of the out* files weren't set correctly. I > fixed this with: > `sudo chmod g+w out*` > and they all passed.
Is there something I can do to fix that ? Would creating the out* files in the 't' directory rather than the top-level directory fix the problem ? Show quoted text
> I have a hunch that the tests are failing because of the 64int support > being set incorrectly.
Yes - I think that's mainly it. In new.t and not_zero.t, we'll also need to replace occurrences of: if(defined($Config::Config{use64bitint})) { with if(Math::GMPz::_has_longlong()) { Do those changes (to Makefile.PL, new.t and not_zero.t) fix the failing tests with Math-GMPz-0.26 ? How does Math::Primality then fare ? If those changes fix the failing Math-GMPz tests, I'll apply them to 0.28, which will be released once we've got *all* issues sorted out. You might also give Math-GMPz-0.27 a run - though you'll need to make the same changes to it, too. (Probably would be good to check that version 0.27 hasn't introduced any *additional* problems.) Cheers, Rob
RT-Send-CC: sisyphus [...] cpan.org
Download (untitled) / with headers
text/plain 1.7k
On Fri May 29 20:33:44 2009, SISYPHUS wrote: Show quoted text
> I doubt that we'll ever want to build a 64-bit int build of Math-GMPz > when ivsize < 8, so this patch to the Makefilel.PL should fix things > portably:
Actually, instead of using that original patch I proposed, I'll apply the following patch and simplify things in the process: ############################## --- Makefile.PL Fri May 22 18:18:19 2009 +++ Makefile.PL_new Sun May 31 10:12:58 2009 @@ -20,18 +20,17 @@ if($use_64_bit_int == -1) {} elsif($use_64_bit_int == 1) {$defines .= " -DUSE_64_BIT_INT"} else { - if($Config::Config{use64bitint} eq 'define' || - $Config::Config{use64bitall} eq 'define' || - $Config::Config{usemorebits} eq 'define' || - $Config::Config{ivsize} == 8 ) {$defines .= " -DUSE_64_BIT_INT"} + unless($Config::Config{ivsize} < 8) { + $defines .= " -DUSE_64_BIT_INT"; + } } if($use_long_double == -1) {} elsif($use_long_double == 1) {$defines .= " -DUSE_LONG_DOUBLE"} else { - if($Config::Config{uselongdouble} eq 'define' || - $Config::Config{usemorebits} eq 'define' || - $Config::Config{nvsize} > 8 ) {$defines .= " -DUSE_LONG_DOUBLE"} + if($Config::Config{nvsize} > 8 ) { + $defines .= " -DUSE_LONG_DOUBLE"; + } } $defines =~ /-DUSE_64_BIT_INT/ ? print "Building with 64-bit'long long' support\n" : ############################## Show quoted text
> In new.t and not_zero.t, we'll also need to replace occurrences of: > > if(defined($Config::Config{use64bitint})) { > with > if(Math::GMPz::_has_longlong()) {
Duh ... not_zero.t doesn't have any occurrences of "if(defined ($Config::Config{use64bitint})) {", but it does have one occurrence of "defined($Config::Config{use64bitint})" which needs to be replaced with "Math::GMPz::_has_longlong()". Cheers, Rob
Subject: Re: [rt.cpan.org #46499] v. 0.26 test suite bugs on Mac OS X 10.5
Date: Tue, 2 Jun 2009 02:32:08 -0500
To: bug-Math-GMPz [...] rt.cpan.org
From: Bob Kuo <bobjkuo [...] gmail.com>
Download (untitled) / with headers
text/plain 430b
That did the trick for both v0.26 and v0.27. I've modified the code and both Jonathan Leto and I are hosting the changes on Github. You can see the commit here: http://github.com/bubaflub/Math--GMPz/commit/ee258b6326df6b0277031655bec2862528cdee97. I've updated the README with a brief blurb about Mac OS X, fixed some minor typos there, updated the two tests and the Makefile.PL. So I think this officially closes the bug. b
Fixed with release of Math-GMPz-0.28.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.