sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.35k stars 460 forks source link

ubuntu-groovy-standard, debian-bullseye-standard: numerics-related sage testsuite errors #31621

Open mkoeppe opened 3 years ago

mkoeppe commented 3 years ago

From https://groups.google.com/g/sage-release/c/6WjKQt_e_B8/m/dpx1qILOCwAJ (for 9.3.rc2):

9.3.beta8> {debian-bullseye,ubuntu-groovy}-standard: cvxopt testsuite errors, numerics-related sage testsuite errors 9.3.beta8> (is system BLAS feeling OK??)

The numerics failures on debian-bullseye have disappeared (or perhaps it is processor dependent, and we were luckier in this run), but show up in debian-sid this time. The numerics failures on ubuntu-groovy are still present.

Another report for debian-bullseye: https://groups.google.com/g/sage-devel/c/kip6kYlL95Q/m/fjUbYwA-AwAJ

CC: @dimpase @jhpalmieri @videlec @kliem

Component: porting

Issue created by migration from https://trac.sagemath.org/ticket/31621

dimpase commented 2 years ago
comment:49

I can only say that exporting -L flag in CFLAGS makes little sense to me. I'd like to see GSLs config.log when it's set, and when it's not (as in comment:6 are you sure your CFLAGS didn't contain something wrong then?).

jhpalmieri commented 2 years ago
comment:50
% echo $CFLAGS
-L/usr/local/opt/openblas/lib

But this causes other changes in the Sage build: when I set CFLAGS manually, then Sage does not add -O2 -g -march=native. Maybe one of those flags makes a difference. I'll try to test it out.

jhpalmieri commented 2 years ago

Attachment: gsl-2.6.log.CFLAGS.gz

dimpase commented 2 years ago
comment:51

Attachment: gsl-2.6.log.do-not-set-CFLAGS.gz

I guess it's -march=native to blame for this. Overwriting CFLAGS to exclude it for gsl makes a difference (see #27122), and we saw this a number of times lately in regard of openblas. Not all Xeon CPUs are created equal. :/

videlec commented 2 years ago
comment:52

After a make openblas sage fails to start with

~/sage/local/lib/python3.9/site-packages/sage/matrix/matrix_space.py in <module>
     42 
---> 43 from . import matrix_modn_sparse
        global matrix_modn_sparse = undefined
     44

ImportError: /lib/x86_64-linux-gnu/libblas.so.3: undefined symbol: gotoblas

I thought that this would have solved my problem but instead created another one.

dimpase commented 2 years ago
comment:53

have you rebuilt sagelib?

make sagelib-clean && make build
jhpalmieri commented 2 years ago
comment:54

Separately from the other issues, should we change gsl's spkg-install.in to use

sdh_configure LIBS="`pkg-config --libs-only-l cblas` -lm" LDFLAGS="$LDFLAGS `pkg-config --libs-only-L cblas`"

as suggested in comment:42? And should pkgconf be a dependency for gsl, to make sure pkg-config is available for this command?

dimpase commented 2 years ago
comment:55

Replying to @jhpalmieri:

Separately from the other issues, should we change gsl's spkg-install.in to use

sdh_configure LIBS="`pkg-config --libs-only-l cblas` -lm" LDFLAGS="$LDFLAGS `pkg-config --libs-only-L cblas`"

as suggested in comment:42?

yes

And should pkgconf be a dependency for gsl, to make sure pkg-config is available for this command?

yes (an order-only dependency, just like for r).

jhpalmieri commented 2 years ago
comment:56

By the way, if I build all of Sage with export CFLAGS='-O2 -g', just with a plain ./configure so using all of homebrew's packages, tests pass. So allowing -march=native to remain (by not explicitly setting CFLAGS) on this machine causes problems in building parts of Sage.

mkoeppe commented 2 years ago
comment:57

Shouldn't CPPFLAGS also be set using pkgconfig?

mkoeppe commented 2 years ago
comment:58

(in the branch of #32587)

jhpalmieri commented 2 years ago
comment:59

Replying to @mkoeppe:

Shouldn't CPPFLAGS also be set using pkgconfig?

It builds without that, but please modify that branch if you think it's a good idea.

mkoeppe commented 2 years ago
comment:60

Still the same in 9.5.beta6

mkoeppe commented 2 years ago
comment:61

What's the status here?

mkoeppe commented 2 years ago
comment:62

We can no longer test ubuntu-groovy, and the failures do not show up in any other Debian and Ubuntu variants tested in https://github.com/sagemath/sage/actions/runs/1673712139 (for 9.5.rc0).

So perhaps we can close it?

mkoeppe commented 2 years ago
comment:65

Seen again in 9.7.rc0 on debian-bullseye-standard https://github.com/sagemath/sage/runs/8104739123?check_suite_focus=true