Sage 9.7 Doctest/Install Error

149 views
Skip to first unread message

Yueqi Li

unread,
Jul 14, 2022, 4:15:59 AM7/14/22
to sage-devel
I installed the newest sage9.7 in my M1 chip MacBook with Big Sur 11.4. I did the doctest right after I installed it. It involved a lot of errors as follows. I'm wondering if anyone knows the reason why. Thank you so much for any suggestion and help anyone may have!

```
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/sagedoc.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/cachefunc.pyx  # 54 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/ipython_extension.py  # 3 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/graphs/connectivity.pyx  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/cython.py  # 18 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/sageinspect.py  # 36 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/env.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/rings/tate_algebra_ideal.pyx  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/parallel/decorate.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/graphs/graph_decompositions/fast_digraph.pyx  # 5 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/rings/polynomial/ore_polynomial_element.pyx  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/features/__init__.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/ext/memory_allocator.pxd  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/ext/memory_allocator.pyx  # 9 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/arith/long.pxd  # 14 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/superseded.py  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/cpython/getattr.pyx  # 4 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/lazy_attribute.pyx  # 3 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/cpython/cython_metaclass.pyx  # 4 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/inherit_comparison.pyx  # 5 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/session.pyx  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/rings/integer_fake.pxd  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/interpreter.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/cpython/string.pyx  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/structure/factory.pyx  # 8 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/nested_class.pyx  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/docs/instancedoc.pyx  # 4 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/cpython/wrapperdescr.pxd  # 6 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/load.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/misc/instancedoc.pyx  # 4 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/symbolic/pynac.pxi  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/structure/sage_object.pyx  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/typeset/ascii_art.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/attach.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/display/formatter.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/matrix/matrix_gf2e_dense.pyx  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/ipython_tests.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/interface_magic.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/matrix/constructor.pyx  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/interfaces/macaulay2.py  # 1 doctest failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/interfaces/gap_workspace.py  # 2 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/structure/element.pyx  # 37 doctests failed
sage -t --random-seed=296880106008719701461925710167242142762 sage/repl/rich_output/backend_ipython.py  # 1 doctest failed
```

Matthias Koeppe

unread,
Jul 14, 2022, 10:30:31 AM7/14/22
to sage-devel
Impossible to diagnose without seeing the detailed failures

Yueqi Li

unread,
Jul 16, 2022, 9:32:42 PM7/16/22
to sage-devel
Dear Prof. Koeppe,

Here is the doctest result. Thank you so much for your help!

Sincerely,
Yueqi
doctest.txt

Matthias Koeppe

unread,
Jul 16, 2022, 10:06:44 PM7/16/22
to sage-devel
These errors:
    ld: library not found for -lgsl clang: error: linker command failed with exit code 1 (use -v to see invocation)
should be fixed by using "brew install gsl".
They cause many of the following failures.

The warnings of the form "UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv."
are harmless and you can ignore them.

Yueqi Li

unread,
Jul 17, 2022, 3:59:14 AM7/17/22
to sage-devel
Dear Prof. Koeppe,

Thank you so much for your help! After I run "brew install gsl,"  I was not able to run any doctes. Then I try to run ./configure and make to fix it. But it dosen't work, and I had error while I make it. I attached the configure information, make error and doctest error with this massage. 

Thank you for any help you may have!

Sincerely,
Yueqi

doctest_error.txt
make_error.zip
make.txt
configure.txt

Dima Pasechnik

unread,
Jul 17, 2022, 5:57:55 AM7/17/22
to sage-devel
I recommend that you do as recommended in the 
output of ./configure, and install python3 from Homebrew 

--
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/c407887f-201a-43d5-908b-44af013781c6n%40googlegroups.com.

Yueqi Li

unread,
Jul 18, 2022, 1:39:50 AM7/18/22
to sage-devel
Thank you for your advice, I tried to reinstall python3 from Homebrew, but it still doesn't work. After I reinstall/upgrade python 3 and gsl from Homebrew, my working directory sage 9.6 crashed. My laptop is MacBook Pro with M1 chip with MacOS Big
Sur version11.4. Thanks for any suggestion and help!

Sincerely,
Yueqi
Sage_crash_report.txt

Matthias Koeppe

unread,
Jul 18, 2022, 1:56:38 AM7/18/22
to sage-devel
Try "make primecountpy-clean primecountpy"

Yueqi Li

unread,
Jul 18, 2022, 2:16:42 AM7/18/22
to sage-devel
It raise errors when i run it.
make_primecontpy.txt
primecountpy-0.1.0.log

Matthias Koeppe

unread,
Jul 18, 2022, 2:54:35 AM7/18/22
to sage-devel
This needs to be done in a shell prepared for building Sage -- don't forget "source ./.homebrew-build-env"

Yueqi Li

unread,
Jul 18, 2022, 4:21:33 AM7/18/22
to sage-devel

I tried rebuild it, it didn't rasied error but  still unable to run doctest.
 
While doing that, I installed another sage from github, that one can run doctest, and it has same error as the previous doctest. I I attached doctest error and config.log with the email. Thanks again for your help. 

Sincerely,
Yueqi
doctest.txt
config.log

Matthias Koeppe

unread,
Jul 18, 2022, 1:18:25 PM7/18/22
to sage-devel
These are not the same errors. The linker complains about mpfr not being found.
This happens on macOS when you run the doctester (sage -t) from a shell where you didn't run "source ./.homebrew-build-env"

Matthias Koeppe

unread,
Jul 18, 2022, 3:12:19 PM7/18/22
to sage-devel
You can also suppress these particular doctests (which test the runtime use of the compilers) using
./sage -t --optional='sage,optional,!sage.misc.cython' --all

Yueqi Li

unread,
Jul 18, 2022, 11:28:11 PM7/18/22
to sage-devel
Thank you so much for your help! After using ./sage -t --optional='sage,optional,!sage.misc.cython' --all, I only had two error:

**********************************************************************
File "src/sage/modules/vector_rational_dense.pyx", line 112, in sage.modules.vector_rational_dense.Vector_rational_dense._init
Failed example:
try:
# Note: some malloc() implementations (on OS X
# for example) print stuff when an allocation
# fails. # We catch this with the ... in the
# doctest result. The * is needed because a
# result cannot start with ...
print("*")
Vector_rational_dense(QQ^(2^56))
except (MemoryError, OverflowError):
print("allocation failed")
Expected:
*...
allocation failed
Got:
Python(43133,0x10509fd40) malloc: can't allocate region
:*** mach_vm_map(size=2305843009213693952, flags: 100) failed (error code=3)
Python(43133,0x10509fd40) malloc: *** set a breakpoint in malloc_error_break to debug
*
allocation failed
**********************************************************************


**********************************************************************
File "src/sage/modules/vector_rational_dense.pyx", line 112, in sage.modules.vector_rational_dense.Vector_rational_dense._init
Failed example:
try:
# Note: some malloc() implementations (on OS X
# for example) print stuff when an allocation
# fails. # We catch this with the ... in the
# doctest result. The * is needed because a
# result cannot start with ...
print("*")
Vector_rational_dense(QQ^(2^56))
except (MemoryError, OverflowError):
print("allocation failed")
Expected:
*...
allocation failed
Got:
Python(43133,0x10509fd40) malloc: can't allocate region
:*** mach_vm_map(size=2305843009213693952, flags: 100) failed (error code=3)
Python(43133,0x10509fd40) malloc: *** set a breakpoint in malloc_error_break to debug
*
allocation failed
**********************************************************************
sage -t --warn-long 11.8 --random-seed=192345898809345273832468885719321887261 src/sage/modules/vector_rational_dense.pyx # 1 doctest failed
sage -t --warn-long 11.8 --random-seed=192345898809345273832468885719321887261 src/sage/matrix/matrix_gf2e_dense.pyx # 1 doctest failed



Sincerely,
Yueqi

Dima Pasechnik

unread,
Jul 19, 2022, 3:12:24 AM7/19/22
to sage-devel
Thanks. This test error is known, it's a specific to M1 Apple CPUs bug
in gf2e external package used by Sage.
See https://trac.sagemath.org/ticket/33212
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/840ed21e-c268-4b78-94ac-ae05986520f7n%40googlegroups.com.

Marc Culler

unread,
Jul 19, 2022, 9:40:09 AM7/19/22
to sage-devel
I just verified that the bug reported in trac #33212 does not arise with the current prerelease of the binary SageMath 9.7 app, which is based on 9.7.beta5.  This is consistent with the trac report since the app is built with XCode 13.3.1.  Note that the binary app will work on older versions of M1 macOS, even if XCode 13.3 is not available or not installed.  One more reason why most users should install Sage as a self-contained binary package.

- Marc
Reply all
Reply to author
Forward
0 new messages