Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support (again) #32

Closed
oscarbenjamin opened this issue Dec 13, 2022 · 2 comments · Fixed by #37
Closed

Windows support (again) #32

oscarbenjamin opened this issue Dec 13, 2022 · 2 comments · Fixed by #37

Comments

@oscarbenjamin
Copy link
Collaborator

This is a continuation of #10 after #28 fixed the basic problem reported there.

After #31 the doctests are running again in CI and many of them in acb and arb are failing on Windows.

There is one compiler warning when building python-flint that is also seen on Linux:

src/flint/pyflint.c: In function ‘__pyx_pf_5flint_6_flint_14dirichlet_char_4__init__’:
src/flint/pyflint.c:195151:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (((__pyx_t_5 > __pyx_t_6) != 0)) {
                       ^

That is coming from this line here:
https://github.com/fredrik-johansson/python-flint/blob/71d16124fb241e3c4a62267a11d6842478e420b3/src/flint/dirichlet.pyx#L98
Specifically the comparison comes from max(q, 2) and is because q is ulong where as cython decides to make 2 be a signed long. Perhaps that is a bug in cython itself. It seems unlikely that it would cause any significant problems though since both q and 2 will always be positive.

The other errors are all from acb and arb:

**********************************************************************
File "C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\site-packages\flint\_flint.cp311-win_amd64.pyd", line ?, in flint._flint.dirichlet_char.l
Failed example:
    showgood(lambda: chi.l(2), dps=25)
Exception raised:
    Traceback (most recent call last):
      File "C:\hostedtoolcache\windows\Python\3.11.0\x64\Lib\doctest.py", line 1350, in __run
        exec(compile(example.source, filename, "single",
      File "<doctest flint._flint.dirichlet_char.l[1]>", line 1, in <module>
        showgood(lambda: chi.l(2), dps=25)
      File "src\flint\functions.pyx", line 114, in flint._flint.showgood
        good(func, **kwargs)
      File "src\flint\functions.pyx", line 100, in flint._flint.good
        raise ValueError("no convergence (maxprec=%i, try higher maxprec)" % maxprec)
    ValueError: no convergence (maxprec=960, try higher maxprec)
**********************************************************************
158 items had failures:
   1 of   1 in flint._flint.__test__.acb.acos (line 516)
   1 of   3 in flint._flint.__test__.acb.agm (line 571)
   1 of   3 in flint._flint.__test__.acb.arg (line 350)
   2 of   2 in flint._flint.__test__.acb.bessel_i (line 2314)
   1 of   2 in flint._flint.__test__.acb.bessel_j (line 2265)
   2 of   3 in flint._flint.__test__.acb.bessel_k (line 2293)
   1 of   1 in flint._flint.__test__.acb.bessel_y (line 2280)
   1 of   1 in flint._flint.__test__.acb.chebyshev_t (line 1396)
   1 of   1 in flint._flint.__test__.acb.chebyshev_u (line 1408)
   1 of   1 in flint._flint.__test__.acb.chi (line 1332)
   1 of   1 in flint._flint.__test__.acb.ci (line 1310)
   1 of   1 in flint._flint.__test__.acb.cos_pi (line 825)
   1 of   1 in flint._flint.__test__.acb.cot_pi (line 859)
   1 of   1 in flint._flint.__test__.acb.coulomb (line 2513)
   2 of   2 in flint._flint.__test__.acb.csgn (line 321)
   2 of   3 in flint._flint.__test__.acb.dirichlet_eta (line 2091)
   1 of   1 in flint._flint.__test__.acb.ei (line 1288)
   2 of   3 in flint._flint.__test__.acb.elliptic_e (line 1161)
   2 of   2 in flint._flint.__test__.acb.elliptic_e_inc (line 1967)
   2 of   2 in flint._flint.__test__.acb.elliptic_f (line 1951)
   1 of   1 in flint._flint.__test__.acb.elliptic_invariants (line 2078)
   2 of   3 in flint._flint.__test__.acb.elliptic_k (line 1146)
   1 of   1 in flint._flint.__test__.acb.elliptic_pi (line 1983)
   2 of   2 in flint._flint.__test__.acb.elliptic_pi_inc (line 1997)
   1 of   1 in flint._flint.__test__.acb.elliptic_roots (line 2064)
   1 of   2 in flint._flint.__test__.acb.erf (line 1037)
   1 of   1 in flint._flint.__test__.acb.erfc (line 1263)
   1 of   1 in flint._flint.__test__.acb.erfi (line 1274)
   2 of   3 in flint._flint.__test__.acb.exp_pi_i (line 732)
   1 of   1 in flint._flint.__test__.acb.expm1 (line 747)
   2 of   2 in flint._flint.__test__.acb.fresnel_c (line 1848)
   2 of   2 in flint._flint.__test__.acb.fresnel_s (line 1835)
   1 of   1 in flint._flint.__test__.acb.gegenbauer_c (line 1434)
   1 of   1 in flint._flint.__test__.acb.hermite_h (line 1460)
   2 of   2 in flint._flint.__test__.acb.hypgeom_0f1 (line 2145)
   5 of   7 in flint._flint.__test__.acb.hypgeom_1f1 (line 2237)
   4 of   5 in flint._flint.__test__.acb.integral (line 2404)
   1 of   1 in flint._flint.__test__.acb.jacobi_p (line 1420)
   1 of   1 in flint._flint.__test__.acb.laguerre_l (line 1447)
   1 of   7 in flint._flint.__test__.acb.lambertw (line 1592)
   3 of   4 in flint._flint.__test__.acb.legendre_p (line 1472)
   3 of   4 in flint._flint.__test__.acb.legendre_q (line 1497)
   2 of   2 in flint._flint.__test__.acb.li (line 1343)
   1 of   2 in flint._flint.__test__.acb.modular_j (line 1111)
   1 of   1 in flint._flint.__test__.acb.pi (line 677)
   1 of   2 in flint._flint.__test__.acb.real_abs (line 1647)
   1 of   1 in flint._flint.__test__.acb.real_ceil (line 1706)
   1 of   1 in flint._flint.__test__.acb.real_floor (line 1694)
   1 of   2 in flint._flint.__test__.acb.real_max (line 1718)
   1 of   2 in flint._flint.__test__.acb.real_min (line 1731)
   1 of   2 in flint._flint.__test__.acb.rising (line 992)
   1 of   1 in flint._flint.__test__.acb.rising2 (line 1006)
   2 of   3 in flint._flint.__test__.acb.sgn (line 335)
   1 of   1 in flint._flint.__test__.acb.shi (line 1321)
   1 of   1 in flint._flint.__test__.acb.si (line 1299)
   1 of   1 in flint._flint.__test__.acb.sin_cos_pi (line 836)
   1 of   1 in flint._flint.__test__.acb.sin_pi (line 814)
   2 of   3 in flint._flint.__test__.acb.stieltjes (line 1760)
   1 of   1 in flint._flint.__test__.acb.tan_pi (line 848)
   4 of   4 in flint._flint.__test__.acb.zeta_zero (line 2347)
   3 of   6 in flint._flint.__test__.acb_mat.det (line 191)
   2 of   5 in flint._flint.__test__.arb.agm (line 1255)
   2 of   3 in flint._flint.__test__.arb.bell_number (line 1302)
   1 of   4 in flint._flint.__test__.arb.bernoulli (line 1282)
   1 of   2 in flint._flint.__test__.arb.cos_pi (line 797)
   1 of   2 in flint._flint.__test__.arb.cot_pi (line 857)
   1 of   2 in flint._flint.__test__.arb.fac (line 1346)
   1 of   4 in flint._flint.__test__.arb.gamma (line 1111)
   2 of   2 in flint._flint.__test__.arb.legendre_p_root (line 1666)
   1 of   2 in flint._flint.__test__.arb.log1p (line 734)
   2 of   3 in flint._flint.__test__.arb.partitions_p (line 1319)
   1 of   3 in flint._flint.__test__.arb.rising (line 1187)
   1 of   2 in flint._flint.__test__.arb.sin_pi (line 784)
   1 of   2 in flint._flint.__test__.arb.sinc_pi (line 940)
   1 of   3 in flint._flint.__test__.arb.sqrt (line 650)
   1 of   2 in flint._flint.__test__.arb.tan_pi (line 844)
   3 of   6 in flint._flint.__test__.arb_mat.det (line 181)
   1 of   2 in flint._flint.__test__.dirichlet_char.hardy_z (line 182)
   1 of   4 in flint._flint.__test__.dirichlet_char.l (line 163)
   1 of   1 in flint._flint.acb.acos
   1 of   3 in flint._flint.acb.agm
   1 of   3 in flint._flint.acb.arg
   2 of   2 in flint._flint.acb.bessel_i
   1 of   2 in flint._flint.acb.bessel_j
   2 of   3 in flint._flint.acb.bessel_k
   1 of   1 in flint._flint.acb.bessel_y
   1 of   1 in flint._flint.acb.chebyshev_t
   1 of   1 in flint._flint.acb.chebyshev_u
   1 of   1 in flint._flint.acb.chi
   1 of   1 in flint._flint.acb.ci
   1 of   1 in flint._flint.acb.cos_pi
   1 of   1 in flint._flint.acb.cot_pi
   1 of   1 in flint._flint.acb.coulomb
   2 of   2 in flint._flint.acb.csgn
   2 of   3 in flint._flint.acb.dirichlet_eta
   1 of   1 in flint._flint.acb.ei
   2 of   3 in flint._flint.acb.elliptic_e
   2 of   2 in flint._flint.acb.elliptic_e_inc
   2 of   2 in flint._flint.acb.elliptic_f
   1 of   1 in flint._flint.acb.elliptic_invariants
   2 of   3 in flint._flint.acb.elliptic_k
   1 of   1 in flint._flint.acb.elliptic_pi
   2 of   2 in flint._flint.acb.elliptic_pi_inc
   1 of   1 in flint._flint.acb.elliptic_roots
   1 of   2 in flint._flint.acb.erf
   1 of   1 in flint._flint.acb.erfc
   1 of   1 in flint._flint.acb.erfi
   2 of   3 in flint._flint.acb.exp_pi_i
   1 of   1 in flint._flint.acb.expm1
   2 of   2 in flint._flint.acb.fresnel_c
   2 of   2 in flint._flint.acb.fresnel_s
   1 of   1 in flint._flint.acb.gegenbauer_c
   1 of   1 in flint._flint.acb.hermite_h
   2 of   2 in flint._flint.acb.hypgeom_0f1
   5 of   7 in flint._flint.acb.hypgeom_1f1
   4 of   5 in flint._flint.acb.integral
   1 of   1 in flint._flint.acb.jacobi_p
   1 of   1 in flint._flint.acb.laguerre_l
   1 of   7 in flint._flint.acb.lambertw
   3 of   4 in flint._flint.acb.legendre_p
   3 of   4 in flint._flint.acb.legendre_q
   2 of   2 in flint._flint.acb.li
   1 of   2 in flint._flint.acb.modular_j
   1 of   1 in flint._flint.acb.pi
   1 of   2 in flint._flint.acb.real_abs
   1 of   1 in flint._flint.acb.real_ceil
   1 of   1 in flint._flint.acb.real_floor
   1 of   2 in flint._flint.acb.real_max
   1 of   2 in flint._flint.acb.real_min
   1 of   2 in flint._flint.acb.rising
   1 of   1 in flint._flint.acb.rising2
   2 of   3 in flint._flint.acb.sgn
   1 of   1 in flint._flint.acb.shi
   1 of   1 in flint._flint.acb.si
   1 of   1 in flint._flint.acb.sin_cos_pi
   1 of   1 in flint._flint.acb.sin_pi
   2 of   3 in flint._flint.acb.stieltjes
   1 of   1 in flint._flint.acb.tan_pi
   4 of   4 in flint._flint.acb.zeta_zero
   3 of   6 in flint._flint.acb_mat.det
   2 of   5 in flint._flint.arb.agm
   2 of   3 in flint._flint.arb.bell_number
   1 of   4 in flint._flint.arb.bernoulli
   1 of   2 in flint._flint.arb.cos_pi
   1 of   2 in flint._flint.arb.cot_pi
   1 of   2 in flint._flint.arb.fac
   1 of   4 in flint._flint.arb.gamma
   2 of   2 in flint._flint.arb.legendre_p_root
   1 of   2 in flint._flint.arb.log1p
   2 of   3 in flint._flint.arb.partitions_p
   1 of   3 in flint._flint.arb.rising
   1 of   2 in flint._flint.arb.sin_pi
   1 of   2 in flint._flint.arb.sinc_pi
   1 of   3 in flint._flint.arb.sqrt
   1 of   2 in flint._flint.arb.tan_pi
   3 of   6 in flint._flint.arb_mat.det
   1 of   2 in flint._flint.dirichlet_char.hardy_z
   1 of   4 in flint._flint.dirichlet_char.l
***Test Failed*** 234 failures.
@oscarbenjamin
Copy link
Collaborator Author

Another possibility is a problem with arb/flint (or with the way that they are being built). There are lots of compiler warnings from building them on Windows with the build scripts here as discussed in #31.

Under Windows I don't seem to be able to get make check for Arb to work:

MINGW64 /c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0
$ make check
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Nothing to be done for 'shared'.
make[1]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[2]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[2]: Nothing to be done for 'shared'.
make[2]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0/fmpr'
    CC   ../build/fmpr/test/t-add.exe
    CC   ../build/fmpr/test/t-add_naive.exe
    CC   ../build/fmpr/test/t-cmp.exe
    CC   ../build/fmpr/test/t-cmp_2exp_si.exe
    CC   ../build/fmpr/test/t-cmpabs.exe
    CC   ../build/fmpr/test/t-cmpabs_2exp_si.exe
    CC   ../build/fmpr/test/t-div.exe
    CC   ../build/fmpr/test/t-exp.exe
    CC   ../build/fmpr/test/t-expm1.exe
    CC   ../build/fmpr/test/t-get_d.exe
    CC   ../build/fmpr/test/t-get_fmpz.exe
    CC   ../build/fmpr/test/t-get_mpfr.exe
    CC   ../build/fmpr/test/t-log.exe
    CC   ../build/fmpr/test/t-log1p.exe
    CC   ../build/fmpr/test/t-mul.exe
    CC   ../build/fmpr/test/t-mul_fmpz.exe
    CC   ../build/fmpr/test/t-mul_naive.exe
    CC   ../build/fmpr/test/t-mul_si.exe
    CC   ../build/fmpr/test/t-mul_ui.exe
    CC   ../build/fmpr/test/t-normalise.exe
    CC   ../build/fmpr/test/t-root.exe
    CC   ../build/fmpr/test/t-rsqrt.exe
    CC   ../build/fmpr/test/t-set_fmpq.exe
    CC   ../build/fmpr/test/t-set_fmpz_2exp.exe
    CC   ../build/fmpr/test/t-set_round_mpn.exe
    CC   ../build/fmpr/test/t-set_round_ui_2exp_fmpz.exe
    CC   ../build/fmpr/test/t-set_round_uiui_2exp_fmpz.exe
    CC   ../build/fmpr/test/t-sqrt.exe
    CC   ../build/fmpr/test/t-sub.exe
    CC   ../build/fmpr/test/t-ulp.exe
make[1]: *** [../Makefile.subdirs:84: ../build/fmpr/test/t-add.exe_RUN] Error 127
make[1]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0/fmpr'
make: *** [Makefile:168: check] Error 2

The exe files are generated:

$ ls build/fmpr/test/
t-add.exe               t-div.exe         t-log.exe          t-mul_ui.exe           t-set_round_mpn.exe
t-add.exe.d             t-div.exe.d       t-log.exe.d        t-mul_ui.exe.d         t-set_round_mpn.exe.d
t-add_naive.exe         t-exp.exe         t-log1p.exe        t-normalise.exe        t-set_round_ui_2exp_fmpz.exe
t-add_naive.exe.d       t-exp.exe.d       t-log1p.exe.d      t-normalise.exe.d      t-set_round_ui_2exp_fmpz.exe.d
t-cmp.exe               t-expm1.exe       t-mul.exe          t-root.exe             t-set_round_uiui_2exp_fmpz.exe
t-cmp.exe.d             t-expm1.exe.d     t-mul.exe.d        t-root.exe.d           t-set_round_uiui_2exp_fmpz.exe.d
t-cmp_2exp_si.exe       t-get_d.exe       t-mul_fmpz.exe     t-rsqrt.exe            t-sqrt.exe
t-cmp_2exp_si.exe.d     t-get_d.exe.d     t-mul_fmpz.exe.d   t-rsqrt.exe.d          t-sqrt.exe.d
t-cmpabs.exe            t-get_fmpz.exe    t-mul_naive.exe    t-set_fmpq.exe         t-sub.exe
t-cmpabs.exe.d          t-get_fmpz.exe.d  t-mul_naive.exe.d  t-set_fmpq.exe.d       t-sub.exe.d
t-cmpabs_2exp_si.exe    t-get_mpfr.exe    t-mul_si.exe       t-set_fmpz_2exp.exe    t-ulp.exe
t-cmpabs_2exp_si.exe.d  t-get_mpfr.exe.d  t-mul_si.exe.d     t-set_fmpz_2exp.exe.d  t-ulp.exe.d

The generated files all give exit code 127:

$ for exe in *.exe; do echo $exe; ./$exe; echo $?; done
t-add.exe
127
t-add_naive.exe
127
...

Running under strace reveals that it fails to find the DLLs for flint etc and this seems to fix it:

 export PATH=$PATH:$(pwd)/.local/lib:$(pwd)/.local/bin

I think the problem is that on Windows it is PATH rather than LD_LIBRARY_PATH that is used to locate DLLs.

I'm now running the Arb tests locally...

$ export ARB_TEST_MULTIPLIER=0.1

pc@NUCPC MINGW64 /c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0
$ make check
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Nothing to be done for 'shared'.
make[1]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[2]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[2]: Nothing to be done for 'shared'.
make[2]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Leaving directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0'
make[1]: Entering directory '/c/Users/pc/src/flint/python-flint/.local/src/arb-2.23.0/fmpr'
add....PASS
add_naive....PASS
cmp....PASS
cmp_2exp_si....PASS
...

@oscarbenjamin
Copy link
Collaborator Author

Locally I can reproduce the doctest failures on Windows but so far it seems like Arb's make check is passing (it takes a long time regardless of ARB_TEST_MULTIPLIER because the compiler is slow).

That suggests that the problem is in python-flint rather than Arb. I've opened #33 to add make check for Arb in any case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant