cschwan / sage-on-gentoo

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

sage-9.2-r1: compilation fails during python_compile #626

Closed g-regex closed 3 years ago

g-regex commented 3 years ago

Hi!

I have compiled sage-9.2-r1 with python 3.7 support a couple of months ago:

[ebuild   R   ~] sci-mathematics/sage-9.2-r1::sage-on-gentoo  USE="X doc-html-bin -bliss -debug -doc-html -doc-pdf -doc-pdf-bin -jmol -latex -testsuite" L10N="en -ca -de -es -fr -hu -it -ja -pt -ru -tr" PYTHON_TARGETS="python3_7 -python3_8" 0 KiB

For the last 6 weeks or so I haven't been using it at all and many libraries got updated to python 3.8. I suppose that the libraries required by sage were not affected, but for completeness' sake, I mention it. The version set in /etc/python-exec/python-exec.conf is 3.7 though.

When starting sage now, startup fails with this error (see full output here):

...
/usr/lib/python3.7/site-packages/sage/combinat/sf/schur.py in <module>
      7 #
      8 #  Distributed under the terms of the GNU General Public License (GPL)
      9 #
     10 #    This code is distributed in the hope that it will be useful,
     11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13 #    General Public License for more details.
     14 #
     15 #  The full text of the GPL is available at:
     16 #
     17 #                  https://www.gnu.org/licenses/
     18 # ****************************************************************************
     19 from __future__ import absolute_import
     20
     21 from . import classical
---> 22 import sage.libs.lrcalc.lrcalc as lrcalc
        global sage.libs.lrcalc.lrcalc = undefined
        global lrcalc = undefined
     23 from sage.misc.all import prod
     24 from sage.rings.infinity import infinity
     25 from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
     26 from sage.functions.other import factorial
     27 from sage.combinat.tableau import StandardTableaux
     28
     29 class SymmetricFunctionAlgebra_schur(classical.SymmetricFunctionAlgebra_classical):
     30     def __init__(self, Sym):
     31         """
     32         A class for methods related to the Schur symmetric function basis
     33
     34         INPUT:
     35
     36         - ``self`` -- a Schur symmetric function basis
     37         - ``Sym`` -- an instance of the ring of the symmetric functions

ImportError: /usr/lib/python3.7/site-packages/sage/libs/lrcalc/lrcalc.cpython-37m-x86_64-linux-gnu.so: undefined symbol: st_new

**********************************************************************

Oops, Sage crashed. We do our best to make it stable, but...
...

Using equery b /usr/lib/python3.7/site-packages/sage/libs/lrcalc/lrcalc.cpython-37m-x86_64-linux-gnu.so, I figured out that this file belongs to the sage ebuild, so I tried recompiling sage, but compilation (with MAKEOPTS='-j1') fails with the following error (see full build.log here):

...
[520/522] x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -I/usr/lib/python3.7/site-packages/cysignals -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7 -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/sage/ext -I/usr/include/python3.7m -I/usr/lib/python3.7/site-packages/numpy/core/include -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized -I/usr/include/python3.7m -c /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_py.c -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_py.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_py.o -L/usr/lib64 -lpython3.7m -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/lib/sage/ext/interpreters/wrapper_py.cpython-37m-x86_64-linux-gnu.so -lpari
[521/522] x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -I/usr/lib/python3.7/site-packages/cypari2 -I./sage/cpython -I/usr/lib/python3.7/site-packages/cysignals -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7 -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/sage/ext -I/usr/include/python3.7m -I/usr/lib/python3.7/site-packages/numpy/core/include -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized -I/usr/include/python3.7m -c /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_rr.c -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_rr.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_rr.o -L/usr/lib64 -lmpfr -lgmp -lpython3.7m -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/lib/sage/ext/interpreters/wrapper_rr.cpython-37m-x86_64-linux-gnu.so -lpari
[522/522] x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe -fPIC -I/usr/lib/python3.7/site-packages/cypari2 -I./sage/cpython -I/usr/lib/python3.7/site-packages/cysignals -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7 -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/sage/ext -I/usr/include/python3.7m -I/usr/lib/python3.7/site-packages/numpy/core/include -I/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized -I/usr/include/python3.7m -c /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_cc.c -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_cc.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -march=native -O2 -pipe /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/temp.linux-x86_64-3.7/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/cythonized/sage/ext/interpreters/wrapper_cc.o -L/usr/lib64 -lmpfr -lmpc -lgmp -lpython3.7m -o /var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7/build/lib/sage/ext/interpreters/wrapper_cc.cpython-37m-x86_64-linux-gnu.so -lpari
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1
 * ERROR: sci-mathematics/sage-9.2-r1::sage-on-gentoo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called src_compile
 *   environment, line 4264:  Called distutils-r1_src_compile
 *   environment, line 1566:  Called _distutils-r1_run_foreach_impl 'python_compile'
 *   environment, line  618:  Called python_foreach_impl 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3680:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3024:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 3022:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'python_compile'
 *   environment, line 1099:  Called distutils-r1_run_phase 'python_compile'
 *   environment, line 1559:  Called python_compile
 *   environment, line 3385:  Called distutils-r1_python_compile
 *   environment, line 1429:  Called esetup.py 'build' '-j' '1'
 *   environment, line 2081:  Called die
 * The specific snippet of code:
 *       "${@}" || die "${die_args[@]}";
 * 
 * If you need support, post the output of `emerge --info '=sci-mathematics/sage-9.2-r1::sage-on-gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sci-mathematics/sage-9.2-r1::sage-on-gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sci-mathematics/sage-9.2-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sci-mathematics/sage-9.2-r1/temp/environment'.
 * Working directory: '/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src-python3_7'
 * S: '/var/tmp/portage/sci-mathematics/sage-9.2-r1/work/sage-9.2/src'

This error reminded me of another issue I had, when compiling sage-9.1-r3 (see this issue), which was fixed by downgrading brial to version 1.2.8. I tried compiling with both versions 1.2.8 and 1.2.10, but both lead to the same error.

Any ideas, what could be causing this?

kiwifb commented 3 years ago

The gist is not complete and miss the part that fail. However, a similar problem was reported for arch linux. lrcalc has recently been updated from 1.2 to 2.0. sage is not compatible with 2.0 yet and this is the source of the issue. It should go away if you downgrade lrcalc back to 1.2.

I am somewhat surprised that wasn't caught by revdep-rebuild.

kiwifb commented 3 years ago

OK, to help with this I removed sci-mathematics/lrcalc from package.keywords files b725a04cdf8d114ade1e0b65cd6a5909c639cbae and fixed the dependency to version 1.2 0e5f65ae50a076fdc6097d1b21610073a4c23c7f bef48c9232d006f28913268c41826c5974de8957.

This should fix everything.

g-regex commented 3 years ago

The gist is not complete and miss the part that fail. However, a similar problem was reported for arch linux. lrcalc has recently been updated from 1.2 to 2.0. sage is not compatible with 2.0 yet and this is the source of the issue. It should go away if you downgrade lrcalc back to 1.2.

I am somewhat surprised that wasn't caught by revdep-rebuild.

Thanks for the quick response! GitHub automatically truncates large gists, but there is a link at the top, to view the full version.

I will try recompiling with lrcalc 1.2 now.

g-regex commented 3 years ago

Perfect! Downgrading lrcalc fixed it.

Thanks again!