wangtongada / gmpy

Automatically exported from code.google.com/p/gmpy
GNU Lesser General Public License v3.0
0 stars 0 forks source link

gmpy-1.17 gmpy_test_cvr 1 fail, gmpy_test_mpf.__test__.binio 2 fail #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. build gmp-5.1.3 in MSYS
2. build gmpy-1.17 in cmd.exe
3. build per directions in gmpy-1.17/windows_build_txt

What is the expected output? What do you see instead?
no test failures. 3 test failures (admittedly among many, many tests)
Using gmpy-1.17 as only need GMP capability and building mpfr-3.1.2 is
killing me
What version of the product are you using? On what operating system?
gmpy-1.17. Windows XP SP3

Please provide any additional information below.
GCC version 4.6.2
GNU ld 2.2.2
MINGW32_NT-5.1

D:\src\gmpy-1.17>python setup.py build_ext -cmingw32 -Id:\src\include -Ld:\src\l
ib install
running build_ext
building 'gmpy' extension
creating build
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\src
d:\mingw\bin\gcc.exe -mdll -O -Wall -Id:\src\include -Id:\python27\include -Id:\
python27\PC -c src/gmpy.c -o build\temp.win32-2.7\Release\src\gmpy.o
src/gmpy.c: In function 'Pympf_normalize':
src/gmpy.c:984:16: warning: format '%ld' expects argument of type 'long int', bu
t argument 3 has type 'Py_ssize_t' [-Wformat]
src/gmpy.c:984:16: warning: format '%ld' expects argument of type 'long int', bu
t argument 4 has type 'Py_ssize_t' [-Wformat]
src/gmpy.c:984:16: warning: format '%ld' expects argument of type 'long int', bu
t argument 5 has type 'Py_ssize_t' [-Wformat]
In file included from src/gmpy.c:4177:0:
src/gmpy_utility.c: In function 'mpf_normalize':
src/gmpy_utility.c:52:16: warning: format '%ld' expects argument of type 'long i
nt', but argument 3 has type 'Py_ssize_t' [-Wformat]
src/gmpy_utility.c:52:16: warning: format '%ld' expects argument of type 'long i
nt', but argument 4 has type 'Py_ssize_t' [-Wformat]
src/gmpy_utility.c:52:16: warning: format '%ld' expects argument of type 'long i
nt', but argument 5 has type 'Py_ssize_t' [-Wformat]
src/gmpy_utility.c:54:13: warning: unknown conversion type character 'z' in form
at [-Wformat]
src/gmpy_utility.c:54:13: warning: format '%lx' expects argument of type 'long u
nsigned int', but argument 3 has type 'Py_ssize_t' [-Wformat]
src/gmpy_utility.c:54:13: warning: too many arguments for format [-Wformat-extra
-args]
src/gmpy_utility.c:75:13: warning: unknown conversion type character 'z' in form
at [-Wformat]
src/gmpy_utility.c:75:13: warning: format '%lx' expects argument of type 'long u
nsigned int', but argument 3 has type 'Py_ssize_t' [-Wformat]
src/gmpy_utility.c:75:13: warning: too many arguments for format [-Wformat-extra
-args]
In file included from src/gmpy.c:4178:0:
src/gmpy_basic.c: In function 'Pympany_rem':
src/gmpy_basic.c:1460:13: warning: format '%ld' expects argument of type 'long i
nt', but argument 3 has type 'size_t' [-Wformat]
src/gmpy_basic.c: In function 'Pympany_divmod':
src/gmpy_basic.c:1770:13: warning: format '%ld' expects argument of type 'long i
nt', but argument 3 has type 'size_t' [-Wformat]
writing build\temp.win32-2.7\Release\src\gmpy.def
creating build\lib.win32-2.7
d:\mingw\bin\gcc.exe -shared -s build\temp.win32-2.7\Release\src\gmpy.o build\te
mp.win32-2.7\Release\src\gmpy.def -Ld:\src\lib -Ld:\python27\libs -Ld:\python27\
PCbuild -lgmp -lpython27 -lmsvcr90 -o build\lib.win32-2.7\gmpy.pyd
running install
running build
running install_lib
copying build\lib.win32-2.7\gmpy.pyd -> d:\python27\Lib\site-packages
running install_egg_info
Writing d:\python27\Lib\site-packages\gmpy-1.17-py2.7.egg-info

D:\src\gmpy-1.17>python test\gmpy_test.py
Unit tests for gmpy 1.17
    on Python 2.7.5 (default, May 15 2013, 22:43:36) [MSC v.1500 32 bit (Intel)]

Testing gmpy 1.17 (GMP 5.1.3), default caching (100, 128)
**********************************************************************
File "D:\src\gmpy-1.17\test\gmpy_test_cvr.py", line 5, in gmpy_test_cvr
Failed example:
    print int(_g.gmp_version()[:3] in ('5.0', '4.3', ''))
Expected:
    1
Got:
    0
**********************************************************************
1 items had failures:
   1 of   4 in gmpy_test_cvr
***Test Failed*** 1 failures.
gmpy_test_cvr 151 tests, 1 failures
**********************************************************************
1 items had failures:
   1 of   4 in gmpy_test_cvr
***Test Failed*** 1 failures.
gmpy_test_rnd  26 tests, 0 failures
**********************************************************************
File "D:\src\gmpy-1.17\test\gmpy_test_mpf.py", line ?, in gmpy_test_mpf.__test__
.binio
Failed example:
    for i in range(len(ba)):
        print ord(ba[i]),
        if i==len(ba)-1: print
Expected:
    8 53 0 0 0 1 0 0 0 123 116 188 106 126 249 219 34 209
Got:
    8 53 0 0 0 1 0 0 0 123 116 188 106 126 249 219 34 208
**********************************************************************
2 items had failures:
   1 of   4 in gmpy_test_cvr
   2 of  64 in gmpy_test_mpf.__test__.binio
***Test Failed*** 3 failures.
gmpy_test_mpf 352 tests, 2 failures
**********************************************************************
2 items had failures:
   1 of   4 in gmpy_test_cvr
   2 of  64 in gmpy_test_mpf.__test__.binio
***Test Failed*** 3 failures.
gmpy_test_mpq 262 tests, 0 failures
**********************************************************************
2 items had failures:
   1 of   4 in gmpy_test_cvr
   2 of  64 in gmpy_test_mpf.__test__.binio
***Test Failed*** 3 failures.
gmpy_test_mpz 674 tests, 0 failures
**********************************************************************
2 items had failures:
   1 of   4 in gmpy_test_cvr
   2 of  64 in gmpy_test_mpf.__test__.binio
***Test Failed*** 3 failures.
gmpy_test_dec  16 tests, 0 failures
7 items had no tests:
    gmpy_test_cvr._test
    gmpy_test_dec._test
    gmpy_test_mpf._test
    gmpy_test_mpq._test
    gmpy_test_mpz._memsize
    gmpy_test_mpz._test
    gmpy_test_rnd._test
33 items passed all tests:
  11 tests in gmpy_test_cvr.__test__.infinity
  10 tests in gmpy_test_cvr.__test__.misc_stuff
 126 tests in gmpy_test_cvr.__test__.user_errors
   1 tests in gmpy_test_dec
  15 tests in gmpy_test_dec.__test__.elemop
   2 tests in gmpy_test_mpf
  88 tests in gmpy_test_mpf.__test__.cmpr
 116 tests in gmpy_test_mpf.__test__.elemop
  70 tests in gmpy_test_mpf.__test__.format
  12 tests in gmpy_test_mpf.__test__.newdiv
   2 tests in gmpy_test_mpq
  26 tests in gmpy_test_mpq.__test__.binio
  52 tests in gmpy_test_mpq.__test__.cmpr
  74 tests in gmpy_test_mpq.__test__.elemop
  54 tests in gmpy_test_mpq.__test__.format
  12 tests in gmpy_test_mpq.__test__.newdiv
  18 tests in gmpy_test_mpq.__test__.power
  24 tests in gmpy_test_mpq.__test__.qdiv
   4 tests in gmpy_test_mpz
  36 tests in gmpy_test_mpz.__test__.binio
  66 tests in gmpy_test_mpz.__test__.bitops
  50 tests in gmpy_test_mpz.__test__.cmpr
  10 tests in gmpy_test_mpz.__test__.divexact
  30 tests in gmpy_test_mpz.__test__.divmod
  84 tests in gmpy_test_mpz.__test__.elemop
  36 tests in gmpy_test_mpz.__test__.format
  14 tests in gmpy_test_mpz.__test__.index
  12 tests in gmpy_test_mpz.__test__.newdiv
 146 tests in gmpy_test_mpz.__test__.number
 182 tests in gmpy_test_mpz.__test__.special
   4 tests in gmpy_test_mpz.factorize
   1 tests in gmpy_test_rnd
  25 tests in gmpy_test_rnd.__test__.rand
**********************************************************************
2 items had failures:
   1 of   4 in gmpy_test_cvr
   2 of  64 in gmpy_test_mpf.__test__.binio
1481 tests in 42 items.
1478 passed and 3 failed.
***Test Failed*** 3 failures.

D:\src\gmpy-1.17>

Original issue reported on code.google.com by englishc...@gmail.com on 26 Dec 2013 at 1:55

GoogleCodeExporter commented 8 years ago
I haven't built with mingw for some time. I'll see if I can look at the errors 
this evening.

Original comment by casevh on 26 Dec 2013 at 4:26

GoogleCodeExporter commented 8 years ago
I've reviewed all the compiler warnings and errors in the test suite. The 
compiler warnings are all related to debugging code. The warnings shouldn't 
impact the normal behavior of gmpy. The errors in the test suite can be 
ignored, too. The first error is just identifying the version of GMP and the 
test doesn't recognize version 5.1.x. The second error (mpf binio) are mostly 
likely related to changes in unspecified behavior of the precision/truncation 
of the mpf type.

Just curious, is there a reason you couldn't use the pre-compiled binary 
versions?

Original comment by casevh on 27 Dec 2013 at 1:31

GoogleCodeExporter commented 8 years ago
Thank you for your effort and assessment.  Good to know these test results
were benign.

As to the pre-compiled(s) - I tried, both gmpy and gmpy2.  I generally
expect a package in python27
site_packages to be a folder, for no particular reason than it seems like
they usually are (in windows xp).
So I tried both executables, scrolled down in site-packages only as far as
the end of the folders,
and not seeing a folder for either, concluded they had silently failed due
to some missing, underlying
requirement (i.e. GMP, MPC, MPFR, MPIR) and turned to building what I could
of them in MSYS.

Today I broke through the 'end of folders' barrier, scrolled down, and
indeed both gmpy and gmpy2
were present.  So, learn a little more everyday.  Sorry to have put you
through an unnecessary effort.

Original comment by englishc...@gmail.com on 27 Dec 2013 at 3:47

GoogleCodeExporter commented 8 years ago
Not a problem. I hope you find gmpy useful.

Original comment by casevh on 28 Dec 2013 at 2:15