Breakage on OS X

38 views
Skip to first unread message

John H Palmieri

unread,
Mar 28, 2023, 2:35:03 PM3/28/23
to sage-devel
I ran "brew upgrade" recently on two different Macs, one Intel and one Apple Silicon, and now the Sage documentation fails to build:

[hyperboli]  from /Users/jpalmier/Desktop/Sage/sage_builds/TESTING/clean/sage-10.0.beta5/src/doc/en/reference/hyperbolic_geometry/sage/geometry/hyperbolic_space/hyperbolic_geodesic.rst:
[hyperboli] Traceback (most recent call last):
[hyperboli]   File "sage/matrix/matrix_double_dense.pyx", line 345, in sage.matrix.matrix_double_dense.Matrix_double_dense.__invert__
[hyperboli]     M._matrix_numpy = scipy.linalg.inv(self._matrix_numpy)
[hyperboli]   File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/clean/sage-10.0.beta5/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/scipy/linalg/_basic.py", line 975, in inv
[hyperboli]     raise LinAlgError("singular matrix")
[hyperboli] numpy.linalg.LinAlgError: singular matrix
[hyperboli] During handling of the above exception, another exception occurred:
[hyperboli] Traceback (most recent call last):
[hyperboli]   File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/clean/sage-10.0.beta5/local/var/lib/sage/venv-python3.11/lib/python3.11/site-packages/matplotlib/sphinxext/plot_directive.py", line 517, in _run_code
[hyperboli]     exec(code, ns)
[hyperboli]   File "<string>", line 3, in <module>
[hyperboli]   File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/clean/sage-10.0.beta5/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py", line 1625, in perpendicular_bisector
[hyperboli]     isom_mtrx = S.inverse() * (T1 * T2) * S
[hyperboli]                 ^^^^^^^^^^^
[hyperboli]   File "sage/matrix/matrix2.pyx", line 9964, in sage.matrix.matrix2.Matrix.inverse
[hyperboli]     return ~self
[hyperboli]   File "sage/matrix/matrix_double_dense.pyx", line 347, in sage.matrix.matrix_double_dense.Matrix_double_dense.__invert__
[hyperboli]     raise ZeroDivisionError("input matrix must be nonsingular")
[hyperboli] ZeroDivisionError: input matrix must be nonsingular

(I saw this first with 10.0.beta6 but then went and tried with 10.0.beta5, which had succeeded earlier. Now it fails.)

Perhaps this is due to an upgraded openblas? That's the most obvious among the recently upgraded packages, at least to me: homebrew just upgraded these:

drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 gnupg
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 pinentry
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 npth
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 libusb
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 libksba
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 libgcrypt
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 libassuan
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:21 libgpg-error
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:00 gh
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 10:00 imagemagick
drwxr-xr-x  3 jpalmier  staff  96 Mar 27 09:59 tox
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 primecount
drwxr-xr-x  3 jpalmier  staff  96 Mar 27 09:59 tcl-tk
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 qt
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 gobject-introspection
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 netpbm
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 glib
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 mpg123
drwxr-xr-x  3 jpalmier  admin  96 Mar 27 09:59 cmake
drwxr-xr-x  3 jpalmier  staff  96 Mar 27 09:59 ghostscript
drwxr-xr-x  3 jpalmier  staff  96 Mar 27 09:59 sqlite
drwxr-xr-x  3 jpalmier  staff  96 Mar 27 09:59 openblas

"brew info openblas" says that it's version 0.3.22, whereas Sage comes with 0.3.21. Everything works after building with `./configure --with-system-openblas=no`, but that flag triggers some other packages to be built by Sage rather than come from the system, so I'm not 100% sure it's the issue.

Has anyone else seen this?

--
John

Dima Pasechnik

unread,
Mar 28, 2023, 2:51:32 PM3/28/23
to sage-devel
I tried building and testing the latest develop with Homebrew on Intel, and I was getting segfaults in docbuilder. However, they went through with

make -j1

The usual macOS parallel docbuilder blues, it seems.



--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/3ea9fe96-6f53-4ace-9cfe-454e863a1e6an%40googlegroups.com.

G. M.-S.

unread,
Mar 28, 2023, 2:58:10 PM3/28/23
to sage-...@googlegroups.com

I have had this problem since 9.8.beta6.

See

Guillermo

On Tue, 28 Mar 2023 at 20:51, Dima Pasechnik <dim...@gmail.com> wrote:
I tried building and testing the latest develop with Homebrew on Intel, and I was getting segfaults in docbuilder. However, they went through with

make -j1

The usual macOS parallel docbuilder blues, it seems.

On Tue, 28 Mar 2023, 19:35 John H Palmieri, <jhpalm...@gmail.com> wrote:
I ran "brew upgrade" recently on two different Macs, one Intel and one Apple Silicon, and now the Sage documentation fails to build:

[…]

Dima Pasechnik

unread,
Mar 28, 2023, 3:52:07 PM3/28/23
to sage-devel
On Tue, Mar 28, 2023 at 7:51 PM Dima Pasechnik <dim...@gmail.com> wrote:
>
> I tried building and testing the latest develop with Homebrew on Intel,

oops, that was still with openblas minor version 21, not 22. Let me
see if 22 works for me.

John H Palmieri

unread,
Mar 28, 2023, 4:23:05 PM3/28/23
to sage-devel
First, this is not the same error (a segfault) I frequently see when docbuilding.

Second, I see this after doing `unset MAKE` and then `make -j1`. I can hit the problem very quickly by running

./sage --docbuild reference/hyperbolic_geometry html

Third, and this is a separate issue, I don't understand why I'm getting the error. It's arising from plot_directive.py, but I've disabled plotting when I docbuild, by setting SAGE_DOCBUILD_OPTS=' --no-plot '. Why is it processing commands inside a `.. plot::` directive at all?

Matthias Koeppe

unread,
Mar 28, 2023, 5:47:17 PM3/28/23
to sage-devel
I agree that the openblas upgrade is to blame here. This error also reproduces with openblas 0.3.22 built from source - see https://github.com/sagemath/sage/pull/35371

Matthias Koeppe

unread,
Mar 28, 2023, 5:57:19 PM3/28/23
to sage-devel
The error can also be reproduced by running the testsuite of src/sage/matrix/matrix2.pyx

No mention of openblas 0.3.22 in the numpy/scipy issue trackers yet, as far as I could see.

Matthias Koeppe

unread,
Mar 28, 2023, 6:03:40 PM3/28/23
to sage-devel
Reproducer from a doctest in src/sage/matrix/matrix_double_dense.pyx

sage:             sage: A = matrix(CDF, [[1,2,4],[5,3,9],[7,8,6]])
sage: A.det()      # wrong
0.0
sage:             sage: A = matrix(QQ, [[1,2,4],[5,3,9],[7,8,6]])
sage: A.det()
88
sage:             sage: A = matrix(RDF, [[1,2,4],[5,3,9],[7,8,6]])
sage: A.det()
88.0

Matthias Koeppe

unread,
Mar 28, 2023, 6:17:47 PM3/28/23
to sage-devel
I've reported it to scipy: https://github.com/scipy/scipy/issues/18208
Reply all
Reply to author
Forward
0 new messages