Math-Prime-Util
Math-Prime-Util copied to clipboard
[github version] Some test failures on Android (32-bit)
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:
Here are the versions of the dependencies:
Perl version is 5.34.1:
The library can be installed, by ignoring the tests, but some functions will produce incorrect results:
Steps to reproduce the issue:
- get a 32-bit Android phone
- install Termux from F-Droid
- 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
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
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!