cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

sage (9.3.rc4) fails to build in Prefix with gcc-11.1.0 #634

Closed strogdon closed 3 years ago

strogdon commented 3 years ago
[526/526] x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -O2 -pipe -fPIC -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/cypari2 -I./sage/cpython -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/cysignals -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8 -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/numpy/core/include -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -c /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cdf.c -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cdf.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_el.o -L/storage/strogdon/gentoo-rap/usr/lib64 -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/interpreters/wrapper_el.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/fast_eval.o -L/storage/strogdon/gentoo-rap/usr/lib64 -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/fast_eval.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_rdf.o -L/storage/strogdon/gentoo-rap/usr/lib64 -lgsl -lgslcblas -lm -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/interpreters/wrapper_rdf.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/rings/padics/padic_generic_element.o -L/storage/strogdon/gentoo-rap/usr/lib64 -lgmp -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/rings/padics/padic_generic_element.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/fast_callable.o -L/storage/strogdon/gentoo-rap/usr/lib64 -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/fast_callable.cpython-38-x86_64-linux-gnu.so
In function ‘__pyx_pf_4sage_3ext_12interpreters_10wrapper_cc_10Wrapper_cc_4__call__’,
    inlined from ‘__pyx_pw_4sage_3ext_12interpreters_10wrapper_cc_10Wrapper_cc_5__call__’ at /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.c:3999:13:
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.c:4119:15: warning: ‘interp_cc’ accessing 64 bytes in a region of size 32 [-Wstringop-overflow=]
 4119 |   __pyx_t_2 = interp_cc(__pyx_v_c_args, ((__mpc_struct *)__pyx_v_retval->__pyx___re), __pyx_v_self->_constants, __pyx_v_self->_py_constants, __pyx_v_self->_stack, __pyx_v_self->_code, ((PyObject *)__pyx_v_self->_domain)); if (unlikely(__pyx_t_2 == ((int)0) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.c: In function ‘__pyx_pw_4sage_3ext_12interpreters_10wrapper_cc_10Wrapper_cc_5__call__’:
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.c:4119:15: note: referencing argument 2 of type ‘__mpc_struct *’
In file included from /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.c:2979:
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/sage/ext/interpreters/interp_cc.c:8:5: note: in a call to function ‘interp_cc’
    8 | int interp_cc(mpc_t* args,
      |     ^~~~~~~~~
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cc.o -L/storage/strogdon/gentoo-rap/usr/lib64 -lmpfr -lmpc -lgmp -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/interpreters/wrapper_cc.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_cdf.o -L/storage/strogdon/gentoo-rap/usr/lib64 -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/interpreters/wrapper_cdf.cpython-38-x86_64-linux-gnu.so -lpari
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/ext/interpreters/wrapper_rr.o -L/storage/strogdon/gentoo-rap/usr/lib64 -lmpfr -lgmp -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/ext/interpreters/wrapper_rr.cpython-38-x86_64-linux-gnu.so -lpari
error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1

I usually build for python3.8 and python3.9. The build did not get past using python3.8. The actual failure may be prior to the above.

kiwifb commented 3 years ago

gcc-11 porting will be fun. There is already a potential issue for fplll in bugzilla.

strogdon commented 3 years ago

basicilly the same failure here in building fplll-5.4.0.

kiwifb commented 3 years ago

Not unlikely that it could be fplll causing the compilation failure in sage too.

strogdon commented 3 years ago

This may well be the source of the failure to build

[155/526] creating /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/libs/glpk
x86_64-pc-linux-gnu-gcc -O2 -pipe -march=native -O2 -pipe -fPIC -I./sage/cpython -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/cysignals -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8 -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/numpy/core/include -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -c /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/libs/glpk/error.c -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/libs/glpk/error.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
In file included from /storage/strogdon/gentoo-rap/usr/include/Lfunction/Lglobals.h:48,
                 from /storage/strogdon/gentoo-rap/usr/include/Lfunction/L.h:40,
                 from /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/libs/lcalc/lcalc_sage.h:1,
                 from /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/libs/lcalc/lcalc_Lfunction.cpp:673:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits: In static member function ‘static constexpr double std::numeric_limits<double>::min()’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits:1748:44: error: call to non-‘constexpr’ function ‘double lcalc_to_double(const long double&)’
 1748 |       min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
      |                                            ^~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/include/Lfunction/Lcommon.h:28:15: note: ‘double lcalc_to_double(const long double&)’ declared here
   28 | inline double lcalc_to_double(const long double& x) { return x; }
      |               ^~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits: In static member function ‘static constexpr double std::numeric_limits<double>::max()’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits:1751:44: error: call to non-‘constexpr’ function ‘double lcalc_to_double(const long double&)’
 1751 |       max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
      |                                            ^~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/include/Lfunction/Lcommon.h:28:15: note: ‘double lcalc_to_double(const long double&)’ declared here
   28 | inline double lcalc_to_double(const long double& x) { return x; }
      |               ^~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits: In static member function ‘static constexpr double std::numeric_limits<double>::lowest()’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits:1755:35: error: call to non-‘constexpr’ function ‘double lcalc_to_double(const long double&)’
 1755 |       lowest() noexcept { return -__DBL_MAX__; }
      |                                   ^~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/include/Lfunction/Lcommon.h:28:15: note: ‘double lcalc_to_double(const long double&)’ declared here
   28 | inline double lcalc_to_double(const long double& x) { return x; }
      |               ^~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits: In static member function ‘static constexpr double std::numeric_limits<double>::epsilon()’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits:1770:48: error: call to non-‘constexpr’ function ‘double lcalc_to_double(const long double&)’
 1770 |       epsilon() _GLIBCXX_USE_NOEXCEPT { return __DBL_EPSILON__; }
      |                                                ^~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/include/Lfunction/Lcommon.h:28:15: note: ‘double lcalc_to_double(const long double&)’ declared here
   28 | inline double lcalc_to_double(const long double& x) { return x; }
      |               ^~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits: In static member function ‘static constexpr double std::numeric_limits<double>::denorm_min()’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/limits:1798:51: error: call to non-‘constexpr’ function ‘double lcalc_to_double(const long double&)’
 1798 |       denorm_min() _GLIBCXX_USE_NOEXCEPT { return __DBL_DENORM_MIN__; }
      |                                                   ^~~~~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/usr/include/Lfunction/Lcommon.h:28:15: note: ‘double lcalc_to_double(const long double&)’ declared here
   28 | inline double lcalc_to_double(const long double& x) { return x; }
      |               ^~~~~~~~~~~~~~~
kiwifb commented 3 years ago

Good old lcalc, we didn't have to deal with it for some time.

strogdon commented 3 years ago

Although, I'm not sure that is causing the failure. From comment:1 there is

error: command 'x86_64-pc-linux-gnu-g++' failed with exit status 1

and I'm not sure which g++ command failed.

kiwifb commented 3 years ago

The only way to find out is build serially, but then you also have to expect that it may fail in several place and you will only get the first one :(

kiwifb commented 3 years ago

I am surprised that lcalc compile at all. Although the warnings make you wonder if you should trust anything coming out of it.

strogdon commented 3 years ago

Almost done building serially. We'll see.

strogdon commented 3 years ago

Nothing really new from the g++ failure when built serially. However, the first use of g++ with gcc-11 is

[ 19/526] x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -O2 -pipe -fPIC -I./sage/cpython -I./sage/rings/finite_rings -I./sage/ext -I./sage/libs/flint -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/cysignals -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8 -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/numpy/core/include -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -c /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -O2 -Wall -g -DNDEBUG -U_LB_DEBUG -DDISABLE_COMMENTATOR -fopenmp -DFFLAS_COMPILED -DFFPACK_COMPILED -std=gnu++11 -fabi-version=6
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp: In function ‘PyObject* __pyx_pf_4sage_6matrix_18matrix_modn_sparse_18Matrix_modn_sparse_38_solve_matrix_linbox(__pyx_obj_4sage_6matrix_18matrix_modn_sparse_Matrix_modn_sparse*, PyObject*, PyObject*)’:
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp:12067:35: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘long int’ [-Wsign-compare]
12067 |   for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_10; __pyx_t_11+=1) {
      |                        ~~~~~~~~~~~^~~~~~~~~~~~
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp: At global scope:
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp:12864:18: warning: ‘PyObject* __pyx_pw_4sage_9structure_7element_3have_same_parent(PyObject*, PyObject*, PyObject*)’ defined but not used [-Wunused-function]
12864 | static PyObject *__pyx_pw_4sage_9structure_7element_3have_same_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp:12863:13: warning: ‘__pyx_doc_4sage_9structure_7element_2have_same_parent’ defined but not used [-Wunused-variable]
12863 | static char __pyx_doc_4sage_9structure_7element_2have_same_parent[] = "have_same_parent(left, right) -> bool\nFile: sage/structure/element.pxd (starting at line 111)\n\n    Return ``True`` if and only if ``left`` and ``right`` have the\n    same parent.\n\n    .. WARNING::\n\n        This function assumes that at least one of the arguments is a\n        Sage :class:`Element`. When in doubt, use the slower\n        ``parent(left) is parent(right)`` instead.\n\n    EXAMPLES::\n\n        sage: from sage.structure.element import have_same_parent\n        sage: have_same_parent(1, 3)\n        True\n        sage: have_same_parent(1, 1/2)\n        False\n        sage: have_same_parent(gap(1), gap(1/2))\n        True\n\n    These have different types but the same parent::\n\n        sage: a = RLF(2)\n        sage: b = exp(a)\n        sage: type(a)\n        <... 'sage.rings.real_lazy.LazyWrapper'>\n        sage: type(b)\n        <... 'sage.rings.real_lazy.LazyNamedUnop'>\n        sage: have_same_parent(a, b)\n        True\n    ";
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp:12519:18: warning: ‘PyObject* __pyx_pw_4sage_9structure_7element_1parent(PyObject*, PyObject*)’ defined but not used [-Wunused-function]
12519 | static PyObject *__pyx_pw_4sage_9structure_7element_1parent(PyObject *__pyx_self, PyObject *__pyx_v_x) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp:12518:13: warning: ‘__pyx_doc_4sage_9structure_7element_parent’ defined but not used [-Wunused-variable]
12518 | static char __pyx_doc_4sage_9structure_7element_parent[] = "parent(x)\nFile: sage/structure/element.pxd (starting at line 6)\n\n    Return the parent of the element ``x``.\n\n    Usually, this means the mathematical object of which ``x`` is an\n    element.\n\n    INPUT:\n\n    - ``x`` -- an element\n\n    OUTPUT:\n\n    - If ``x`` is a Sage :class:`Element`, return ``x.parent()``.\n\n    - Otherwise, return ``type(x)``.\n\n    .. SEEALSO::\n\n        `Parents, Conversion and Coercion <http://doc.sagemath.org/html/en/tutorial/tour_coercion.html>`_\n        Section in the Sage Tutorial\n\n    EXAMPLES::\n\n        sage: a = 42\n        sage: parent(a)\n        Integer Ring\n        sage: b = 42/1\n        sage: parent(b)\n        Rational Field\n        sage: c = 42.0\n        sage: parent(c)\n        Real Field with 53 bits of precision\n\n    Some more complicated examples::\n\n        sage: x = Partition([3,2,1,1,1])\n        sage: parent(x)\n        Partitions\n        sage: v = vector(RDF, [1,2,3])\n        sage: parent(v)\n        Vector space of dimension 3 over Real Double Field\n\n    The following are not considered to be elements, so the type is\n    returned::\n\n        sage: d = int(42)  # Python int\n        sage: parent(d)\n        <... 'int'>\n        sage: L = list(range(10))\n        sage: parent(L)\n        <... 'list'>\n    ";
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
x86_64-pc-linux-gnu-g++ -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.o -L/storage/strogdon/gentoo-rap/usr/lib -L/storage/strogdon/gentoo-rap/usr/lib64 -llinbox -liml -lfflas -lffpack -lblas -lgivaro -lflint -lmpfr -lntl -lgmp -lgmpxx -lcblas -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/matrix/matrix_modn_sparse.cpython-38-x86_64-linux-gnu.so -fopenmp -lpari

while with gcc-10 there is

[ 19/526] x86_64-pc-linux-gnu-g++ -O2 -pipe -march=native -O2 -pipe -fPIC -I./sage/cpython -I./sage/rings/finite_rings -I./sage/ext -I./sage/libs/flint -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/cysignals -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8 -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -I/storage/strogdon/gentoo-rap/usr/lib/python3.8/site-packages/numpy/core/include -I/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized -I/storage/strogdon/gentoo-rap/usr/include/python3.8 -c /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.cpp -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_modn_sparse.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -O2 -Wall -g -DNDEBUG -U_LB_DEBUG -DDISABLE_COMMENTATOR -fopenmp -DFFLAS_COMPILED -DFFPACK_COMPILED -fabi-version=6 -std=gnu++11
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -O2 -pipe -march=native -O2 -pipe /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/temp.linux-x86_64-3.8/storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/cythonized/sage/matrix/matrix_real_double_dense.o -L/storage/strogdon/gentoo-rap/usr/lib64 -o /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-9999/work/sage-9999/src-python3_8/build/lib/sage/matrix/matrix_real_double_dense.cpython-38-x86_64-linux-gnu.so

So perhaps cython is not generating the correct code.

kiwifb commented 3 years ago

While there is a possibility that cython produces code that needs extra headers with gcc-11, I don't think that is what is happening here. gcc (and clang) is just become much more verbose and comprehensive about it warns you about.

strogdon commented 3 years ago

I've slowly been building libs with gcc-11. pynac-0.7.27-r3 also fails

cc1plus: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
make[2]: *** [Makefile:904: libpynac_python3_9_la-numeric.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
make[2]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-libs/pynac-0.7.27-r3/work/pynac-0.7.27-python3_9/ginac'
make[1]: *** [Makefile:432: all-recursive] Error 1
make[1]: Leaving directory '/storage/strogdon/gentoo-rap/var/tmp/portage/sci-libs/pynac-0.7.27-r3/work/pynac-0.7.27-python3_9'
make: *** [Makefile:364: all] Error 2

-Wno-parentheses-equality appears in the Makefile. Perhaps this should be another issue.

kiwifb commented 3 years ago

Definitely needs to be upstreamed at least.

kiwifb commented 3 years ago

OK, I had a closer look the -Wno-parentheses-equality is not fatal. That, and subsequent errors are:

numeric.cpp: In member function ‘const GiNaC::numeric GiNaC::numeric::add(const GiNaC::numeric&) const’:
numeric.cpp:1321:40: error: ‘numeric_limits’ is not a member of ‘std’
 1321 |                     and v._long < std::numeric_limits<long>::max() / 2

I think it is a gcc-11 header porting issue, so not to hard to fix. It is already compiling in std=c++11 so it is definitely not a c++17 issue.

strogdon commented 3 years ago

Yes, I noticed that chatter.

kiwifb commented 3 years ago

I have a one liner patch that does the job. I will update the overlay shortly.

kiwifb commented 3 years ago

Ready for a sync and retry.

strogdon commented 3 years ago

pynac now builds.

strogdon commented 3 years ago

But giac-1.7.0.1 fails. I'm guessing at

/storage/strogdon/gentoo-rap/bin/bash ../libtool  --tag=CXX   --mode=compile x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I..  -DIN_GIAC -I. -I.. -I. -I..       -O2 -pipe -march=native -O2 -pipe -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -DQUICKJS -c -o mathml.lo math
ml.cc
libtool: compile:  x86_64-pc-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I.. -DIN_GIAC -I. -I.. -I. -I.. -O2 -pipe -march=native -O2 -pipe -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -DQUICKJS -c mathml.cc  -fPIC -DPIC -o .libs/mathml.o
In file included from /storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/bits/hashtable_policy.h:34,
                 from /storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/bits/hashtable.h:35,
                 from /storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/unordered_map:46,
                 from index.h:43,
                 from giacPCH.h:8,
                 from maple.cc:2:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/tuple: In instantiation of ‘constexpr const size_t std::tuple_size_v<giac::gen(const giac::gen&)>’:
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/tuple:1816:24:   required from ‘constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with _Fn = giac::dbgprint_vector<giac::gen>&; _Tuple = giac::gen (&)(const giac::gen&)]’
maple.cc:1024:24:   required from here
/storage/strogdon/gentoo-rap/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/include/g++-v11/tuple:1334:61: error: incomplete type ‘std::tuple_size<giac::gen(const giac::gen&)>’ used in nested name specifier
 1334 |     inline constexpr size_t tuple_size_v = tuple_size<_Tp>::value;
      |

I haven't tried giac-1.6.0.47. It would be nice if things stopped promptly at a failure.

kiwifb commented 3 years ago

Oh, yes. I have a fix in the 1.7.0.3 ebuild which is masked. I can put something in the version in the overlay but a bug should be filled in bugzilla for the main tree. This is purely a c++17 incompatibility. Passing CXXFLAGS="-std=c++14" is enough to fix it.

kiwifb commented 3 years ago

Band aid for giac-1.7.0.1 and 1.6.0.47 in overlay.

strogdon commented 3 years ago

Back to the present topic. It seems that error: only appears in reference to lcalc. See comment.

strogdon commented 3 years ago

Sage builds here if I change line 28 in /usr/include/Lfunction/Lcommon.h from

inline double lcalc_to_double(const long double& x) { return x; }

to

inline constexpr double lcalc_to_double(const long double& x) { return x; }

Not sure if this is the correct thing to do. If so, then there are other inline functions in Lcommon.h that may need to be changed. See https://en.cppreference.com/w/cpp/language/constexpr for use of constexpr.

kiwifb commented 3 years ago

That is certainly what is strongly suggested by the error message I saw. I think we should go that way, and yes that whole section will need to be changed.

kiwifb commented 3 years ago

I now have a patch in the vbraun branch. Documentation is building right now :) if it is successful, I'll cherry-pick it to master.

kiwifb commented 3 years ago

OK, all cherry-picked, lcalc has a version bump and needs to be upgraded before sage. Haven't doctested yet.

strogdon commented 3 years ago

Doctesting - no lcalc failures:

sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx  # 2 doctests failed
sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/features/__init__.py  # 1 doctest failed
sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/cpython/dict_del_by_value.pyx  # 2 doctests failed
sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/interfaces/tests.py  # 1 doctest failed
sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/misc/lazy_import.pyx  # 1 doctest failed
sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/repl/ipython_kernel/kernel.py  # 1 doctest failed

Some failures related to pip which in not installed. The odd ones (not related to this issue) are

sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx

sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/cpython/dict_del_by_value.pyx

sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/repl/ipython_kernel/kernel.py

The expression.pyx gives incorrect results

sage -t --long --warn-long 152.9 --random-seed=0 usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx
**********************************************************************
File "usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx", line 4563, in sage.symbolic.expression.Expression.series
Failed example:
    (x^(-1) + 1).series(x,1)
Expected:
    1*x^(-1) + 1 + Order(x)
Got:
    2*x^(-1) + Order(x)
**********************************************************************
File "usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx", line 5510, in sage.symbolic.expression.Expression.substitute
Failed example:
    with hold:
        print((2*x^0*a + b*y^1).subs({x:c, y:c*d}))
Expected:
    b*c*d + 2*a
Got:
    b*c*d
kiwifb commented 3 years ago

My current results are

sage -t --long --random-seed=0 /usr/lib/python3.9/site-packages/sage/misc/sagedoc.py  # 1 doctest failed
sage -t --long --random-seed=0 /usr/lib/python3.9/site-packages/sage/symbolic/expression.pyx  # 2 doctests failed
sage -t --long --random-seed=0 /usr/lib/python3.9/site-packages/sage/cpython/dict_del_by_value.pyx  # 2 doctests failed
sage -t --long --random-seed=0 /usr/lib/python3.9/site-packages/sage/interfaces/tests.py  # 1 doctest failed

I am a bit puzzled by the symbolic expression issue.

kiwifb commented 3 years ago

I am actually missing a pynac patch. There will be a bump.

kiwifb commented 3 years ago

pynac is actually missing another patch.

kiwifb commented 3 years ago

Fixed.

strogdon commented 3 years ago

After a sync + rebuild and with pip installed I have these failures:

sage -t --long --warn-long 163.2 --random-seed=0 usr/lib/python3.9/site-packages/sage/cpython/dict_del_by_value.pyx  # 2 doctests failed
sage -t --long --warn-long 163.2 --random-seed=0 usr/lib/python3.9/site-packages/sage/interfaces/tests.py  # 1 doctest failed
sage -t --long --warn-long 163.2 --random-seed=0 usr/lib/python3.9/site-packages/sage/repl/ipython_kernel/kernel.py  # 1 doctest failed

I don't have the sagedoc.py failure that you had and I still have a repl/ipython_kernel/kernel.py failure.

sage -t --long --warn-long 163.2 --random-seed=0 /storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/sage/repl/ipython_kernel/kernel.py
**********************************************************************
File "/storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/sage/repl/ipython_kernel/kernel.py", line 47, in sage.repl.ipython_kernel.kernel.SageKernel.__init__
Failed example:
    from sage.repl.ipython_kernel.kernel import SageKernel
Expected nothing
Got:
    doctest:warning
...
      File "/storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/ipyparallel/client/client.py", line 57, in <module>
        from .view import DirectView, LoadBalancedView
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 790, in exec_module
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "/storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/ipyparallel/client/view.py", line 8, in <module>
        import imp
      File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
      File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 790, in exec_module
      File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
      File "/storage/strogdon/gentoo-rap/usr/lib/python3.9/imp.py", line 31, in <module>
        warnings.warn("the imp module is deprecated in favour of importlib; "
      File "/storage/strogdon/gentoo-rap/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses

From the sage prompt:

sage: from sage.repl.ipython_kernel.kernel import SageKernel
/storage/strogdon/gentoo-rap/usr/lib/python3.9/site-packages/ipyparallel/client/view.py:8: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
sage: 
strogdon commented 3 years ago

Curiously it is only in the __init__ method that I get the DeprecationWarning. There are other locations in sage/repl/ipython_kernel/kernel.py where there is

sage: from sage.repl.ipython_kernel.kernel import SageKernel

that do not give the warning. Maybe the warning is only given once? Also, I don't see an ipyparallel in vanilla.

kiwifb commented 3 years ago

I don't have ipyparallel installed. It is an optional dependency of ipython managed by a useflag. It is probably an indication that ipyparallel needs some attention upstream.

strogdon commented 3 years ago

dev-python/ipython-7.21.0-r1 pull it in with +smp which is there by default.

strogdon commented 3 years ago

Reinstalling ipython with USE=-smp fixed things. Should -smp be added to s-o-g useflags?

kiwifb commented 3 years ago

Yes, I explicitly disabled it on my system. I don't think we should do anything. It makes noises in doctests when present but it doesn't hurt anything. Last release of ipyparallel is from 2018, I wouldn't be surprised if it was abandoned and to be replaced in ipython.

The only thing we could do for the doctest is mark it # random.