Math-Prime-Util icon indicating copy to clipboard operation
Math-Prime-Util copied to clipboard

[github version] Some test failures on Android (32-bit)

Open trizen opened this issue 2 years ago • 2 comments

Hi. I tested the latest GitHub commit of Math::Prime::Util on a 32-bit Android phone, using the Termux environment and the clang compiler.

Unfortunately, some tests failed:

1-almost-primes

2-semiprime

3-chinese

4-lucky

Here are the versions of the dependencies:

0-versions

Perl version is 5.34.1:

perl_version

The library can be installed, by ignoring the tests, but some functions will produce incorrect results:

perfect-power-count

Steps to reproduce the issue:

  1. get a 32-bit Android phone
  2. install Termux from F-Droid
  3. run the following commands:
pkg up
pkg install perl make clang libgmp curl
cpan App::cpanminus
cpanm -v https://github.com/danaj/Math-Prime-Util-GMP/archive/refs/heads/master.zip
cpanm -v https://github.com/danaj/Math-Prime-Util/archive/refs/heads/master.zip

Alternative commands, using git instead of cpanm (and also without installing Math::Prime::Util::GMP):

pkg up
pkg install perl make clang git
git clone --depth=1 https://github.com/danaj/Math-Prime-Util
cd Math-Prime-Util
perl Makefile.PL
make test

trizen avatar Mar 23 '22 10:03 trizen

FWIW I see the same failures on 32-bit perl-5.34.0 (ivsize == 4) built using mingw-w64 port of gcc-10.2.0. However, all tests pass for the same version of 32-bit perl, built using the same toolchain on the same machine, but having ivsize == 8.

Apparently, there's something in the github version that's not allowing for the possibility that ivsize is 4. (Maybe it's in the test scripts themselves ? ... I haven't investigated.)

Cheers, Rob

sisyphus avatar Apr 03 '22 09:04 sisyphus

Thank you very much for the report, and also big thanks for the confirmation on 32-bit perl with ivsize == 4. Definitely something to fix!

danaj avatar Apr 03 '22 12:04 danaj