ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 19 Apr 2020 05:45:20 -0500PyCharm for SageMath on Linuxhttps://ask.sagemath.org/question/50859/pycharm-for-sagemath-on-linux/I am looking for an IDE with syntax highlighting, code completion and debugging support to run SageMath 9.0 with preprocessing on (Arch) Linux.
The two most obvious choices seem to be PyCharm and Eclipse, but PyCharm is not able to do `from sage.all import *` even though my `SAGE_ROOT="/usr"` and I am running pycharm from a `sage -sh` as described in https://ask.sagemath.org/question/39742/make-pycharm-recognise-the-sage-python-interpreter/ or https://ask.sagemath.org/question/38750/how-i-use-sage-with-pycharm-in-ubuntu/.TKSun, 19 Apr 2020 05:45:20 -0500https://ask.sagemath.org/question/50859/building from git unresolved symbols libgomphttps://ask.sagemath.org/question/48286/building-from-git-unresolved-symbols-libgomp/fresh git cloned repository. Compilation fails with the spurious error as in https://trac.sagemath.org/ticket/28513. Running `./sage` crashes with the error
<pre><code>ImportError: /home/user/sage/local/lib/liblinbox.so.0: undefined symbol: GOMP_loop_ull_maybe_nonmonotonic_runtime_next
</code></pre>
But the symbols are there:
<pre><code>$ nm /usr/lib/libgomp.so | grep GOMP_loop_ull_maybe_
0000000000010070 T GOMP_loop_ull_maybe_nonmonotonic_runtime_next
000000000000f210 T GOMP_loop_ull_maybe_nonmonotonic_runtime_start</code></pre>
This is on Arch
<code><pre>$uname -a
Linux host 5.3.5-arch1-1-ARCH #1 SMP PREEMPT Mon Oct 7 19:03:08 UTC 2019 x86_64 GNU/Linux
$ gcc --version
gcc (GCC) 9.2.0</code></pre>heluaniFri, 11 Oct 2019 12:14:14 -0500https://ask.sagemath.org/question/48286/compile error building sagemath 8.4 beta7 on Linux Manjarohttps://ask.sagemath.org/question/43941/compile-error-building-sagemath-84-beta7-on-linux-manjaro/I've run Arch Linux package manager to install sagemath many times before on Linux Manjaro and it never failed to compile before. This is the first time I've seen a compile error. This seems like a packaging issue?
Using
>uname -a
Linux me-pc 4.14.74-1-MANJARO
>cat /etc/*release
Manjaro Linux
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=18.0.0-rc
DISTRIB_CODENAME=Illyria
I select sagemath from AUR using the package manager, click install. I fail with this error
Building sagemath-git...
Cloning into 'sagemath-git'...
==> Making package: sagemath-git 8.4.beta7.r0.ga1bfef8cf3-1 (Sat 13 Oct 2018 08:04:38 PM CDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Cloning sage git repo...
....
gcc -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python2.7/site-packages/cysignals -I/usr/include -I/usr/include/python2.7 -I/usr/lib/python2.7/site-packages/numpy/core/include -I/home/me/TMP/sagemath-git/src/sage/src -I/home/me/TMP/sagemath-git/src/sage/src/sage/ext -Ibuild/cythonized -I/usr/include/python2.7 -c build/cythonized/sage/calculus/integration.c -o build/temp.linux-x86_64-2.7/build/cythonized/sage/calculus/integration.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -DGSL_DISABLE_DEPRECATED -std=c99
build/cythonized/sage/calculus/integration.c:609:10: fatal error: gsl/gsl_cblas.h: No such file or directory
#include "gsl/gsl_cblas.h"
^~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
[ 15/499] gcc -DNDEBUG -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -D_FORTIFY_SOURCE=2 -fPIC -I/usr/lib/python2.7/site-packages/cysignals -I/usr/include -I/usr/include/python2.7 -I/usr/lib/python2.7/site-packages/numpy/core/include -I/home/me/TMP/sagemath-git/src/sage/src -I/home/me/TMP/sagemath-git/src/sage/src/sage/ext -Ibuild/cythonized -I/usr/include/python2.7 -c build/cythonized/sage/calculus/interpolation.c -o build/temp.linux-x86_64-2.7/build/cythonized/sage/calculus/interpolation.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99
build/cythonized/sage/calculus/interpolation.c:603:10: fatal error: gsl/gsl_interp.h: No such file or directory
#include "gsl/gsl_interp.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
I've put the complete build log file here [https://www.12000.org/tmp/10132018/sage_build_log.txt](https://www.12000.org/tmp/10132018/sage_build_log.txt) (this form will not let me attach a plain text file).
I install the Linux system new, and was trying to install sagemath on it.
Posting this here in case someone wants to have a look to see why it failed to compile. It seems to be missing some prerequisites.NasserSat, 13 Oct 2018 21:57:29 -0500https://ask.sagemath.org/question/43941/Characteristic polynomial of symbolic matrix of size 7https://ask.sagemath.org/question/43839/characteristic-polynomial-of-symbolic-matrix-of-size-7/There is a problem when computing the characteristic polynomial of a matrix of size greater than 7 containing a large number of symbolic variables.
<pre><code>a = SR.var('a', 100)
M = identity_matrix(SR, 7)
for i in range(7):
for j in range(7):
M[i,j] = a[i*7+j]
print(M.charpoly().degree()) # prints 5
</code></pre>
The value it should print is 7. Over $\mathbb{Z}[a_0,a_1,\dots]$, the result is correct.
I use Sage 8.3 (Release Date: 2018-08-03), installed from the official repository of Archlinux. The bug is present both in command line and with `sage file.sage` (if I copy and paste the code above).ScreenNameSat, 06 Oct 2018 01:04:49 -0500https://ask.sagemath.org/question/43839/Sagemath does not open anymorehttps://ask.sagemath.org/question/43674/sagemath-does-not-open-anymore/ I was trying to install `sagemath-jupyter` on my Arch Linux (which turned out to be a near impossible task) and deleted a bunch of packages from pip2. Now I can't even open sagemath, even after re-installing sagemath from Pacman:
Traceback (most recent call last):
File "/usr/bin/sage-ipython", line 12, in <module>
from sage.repl.interpreter import SageTerminalApp
File "/usr/lib/python2.7/site-packages/sage/repl/interpreter.py", line 109, in <module>
from sage.repl.prompts import SagePrompts, InterfacePrompts
File "/usr/lib/python2.7/site-packages/sage/repl/prompts.py", line 16, in <module>
from IPython.terminal.prompts import Prompts
File "/usr/lib/python2.7/site-packages/IPython/__init__.py", line 48, in <module>
from .core.application import Application
File "/usr/lib/python2.7/site-packages/IPython/core/application.py", line 23, in <module>
from traitlets.config.application import Application, catch_config_error
File "/usr/lib/python2.7/site-packages/traitlets/__init__.py", line 1, in <module>
from .traitlets import *
File "/usr/lib/python2.7/site-packages/traitlets/traitlets.py", line 60, in <module>
from .utils.importstring import import_item
File "/usr/lib/python2.7/site-packages/traitlets/utils/importstring.py", line 8, in <module>
from ipython_genutils.py3compat import cast_bytes_py2
ImportError: No module named ipython_genutils.py3compat
Any ideas on how to overcome this? (And preferably also installing `sagemath-jupyter`?
I have installed `ipython_genutils` with pip2 already (version 0.1.0).tomchoFri, 14 Sep 2018 11:54:56 -0500https://ask.sagemath.org/question/43674/Latest development version not on AUR Arch Linux repositoryhttps://ask.sagemath.org/question/43356/latest-development-version-not-on-aur-arch-linux-repository/I use Linux Manjaro, because its package manager allows one to install latest development of sagemath very easily by just clicking a button.
The package manager builds latest development sagematch from sources from AUR (ArchLinux User repository):
https://aur.archlinux.org/packages/sagemath-git/
And it used to be that AUR is updated at same time as a new version of sagemath shows up on this page
http://mirrors-usa.go-parts.com/sage/sagemath/devel/index.html
But it has been more than one week and AUR is still showing older 8.3.rc3, while sagemath is now at sage-8.4.beta0
Any one knows how this process works, and why this time the latest development version does not show on AUR?NasserMon, 13 Aug 2018 03:04:26 -0500https://ask.sagemath.org/question/43356/parametric_plot gives "IndexError: list index out of range" in SageMath 8.1-11 on Arch Linuxhttps://ask.sagemath.org/question/41957/parametric_plot-gives-indexerror-list-index-out-of-range-in-sagemath-81-11-on-arch-linux/I've been attempting to plot a parabola, but I keep running into an error from the "expression_comparisons.py" file as an "index out of range" error. Help? My OS is Arch Linux, using the Cinnamon DE, and version 8.1-11 of Sagemath. Attempted code:
sage: var('t')
sage: parametric_plot((t,t^2),(t,-4,4))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_11.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGFyYW1ldHJpY19wbG90KCh0LHReMiksKHQsLTQsNCkp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpwjIIYE/___code___.py", line 3, in <module>
exec compile(u'parametric_plot((t,t**_sage_const_2 ),(t,-_sage_const_4 ,_sage_const_4 ))
File "", line 1, in <module>
File "/usr/lib/python2.7/site-packages/sage/misc/decorators.py", line 564, in wrapper
return func(*args, **options)
File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 2621, in parametric_plot
return plot(funcs, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/sage/misc/decorators.py", line 564, in wrapper
return func(*args, **options)
File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 1950, in plot
G = _plot(funcs, *args, **kwds)
File "/usr/lib/python2.7/site-packages/sage/plot/plot.py", line 2067, in _plot
funcs, ranges = setup_for_eval_on_grid(funcs, [xrange], options['plot_points'])
File "/usr/lib/python2.7/site-packages/sage/plot/misc.py", line 150, in setup_for_eval_on_grid
return fast_float(funcs, *vars,**options), [tuple(range+[range_step]) for range,range_step in zip(ranges, range_steps)]
File "sage/ext/fast_eval.pyx", line 1384, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11037)
File "sage/ext/fast_eval.pyx", line 1399, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11258)
File "sage/ext/fast_callable.pyx", line 465, in sage.ext.fast_callable.fast_callable (build/cythonized/sage/ext/fast_callable.c:4634)
File "sage/symbolic/expression.pyx", line 11679, in sage.symbolic.expression.Expression._fast_callable_ (build/cythonized/sage/symbolic/expression.cpp:66334)
File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1757, in fast_callable
return FastCallableConverter(ex, etb)()
File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 218, in __call__
return self.arithmetic(ex, operator)
File "/usr/lib/python2.7/site-packages/sage/symbolic/expression_conversions.py", line 1670, in arithmetic
exponent = operands[1]
IndexError: list index out of rangecookcharMon, 09 Apr 2018 18:28:05 -0500https://ask.sagemath.org/question/41957/How do install SageMath in Archlinuxhttps://ask.sagemath.org/question/41037/how-do-install-sagemath-in-archlinux/ Help me install sage-8.1-Ubuntu_16.04-x86_64.tar.bz2 on Archlinux
tar xvf sage-8.1-Ubuntu_16.04-x86_64.tar.bz2
cd SageMath
./sage
Then
RecursionError: maximum recursion depth exceeded during compilation
************************************************************************
It seems that you are attempting to run Sage from an unpacked source
tarball, but you have not compiled it yet (or maybe the build has not
finished). You should run `make` in the Sage root directory first.
If you did not intend to build Sage from source, you should download
a binary tarball instead. Read README.txt for more information.
minhhieuThu, 08 Feb 2018 19:35:46 -0600https://ask.sagemath.org/question/41037/Sagenotebook hangs on arch linux?https://ask.sagemath.org/question/37986/sagenotebook-hangs-on-arch-linux/This is the error.
[error](https://ptpb.pw/hnvK)
I just did install from the pacman repo -sagemath and the notebook?
![hangs](https://ptpb.pw/m4NN.png )screened00Sat, 17 Jun 2017 12:29:44 -0500https://ask.sagemath.org/question/37986/Problem with Cremona database (Update: wrong Boolean output in general)https://ask.sagemath.org/question/37838/problem-with-cremona-database-update-wrong-boolean-output-in-general/Hello, I'm struggling with the following problem, but don't have any idea how to fix it. At least the mini Cremona database is installed, I think. Could you please help me?
sage: EllipticCurve("37b2")
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-13-74529bf514dc> in <module>()
----> 1 EllipticCurve("37b2")
/usr/share/sage/source/sage/structure/factory.pyx in sage.structure.factory.UniqueFactory.__call__ (/build/sagemath/src/sage-7.6/src/src/build/cythonized/sage/structure/factory.c:1856)()
360 False
361 """
--> 362 key, kwds = self.create_key_and_extra_args(*args, **kwds)
363 version = self.get_version(sage_version)
364 return self.get_object(version, key, kwds)
/usr/lib/python2.7/site-packages/sage/schemes/elliptic_curves/constructor.pyc in create_key_and_extra_args(self, x, y, j, minimal_twist, **kwds)
407 # Interpret x as a Cremona or LMFDB label.
408 from sage.databases.cremona import CremonaDatabase
--> 409 x, data = CremonaDatabase().coefficients_and_data(x)
410 # User-provided keywords may override database entries.
411 data.update(kwds)
/usr/lib/python2.7/site-packages/sage/databases/cremona.pyc in CremonaDatabase(name, mini, set_global)
1688 _db = MiniCremonaDatabase(name)
1689 else:
-> 1690 _db = LargeCremonaDatabase(name)
1691 return _db
1692 if mini:
/usr/lib/python2.7/site-packages/sage/databases/cremona.pyc in __init__(self, name, read_only, build)
1432 if not os.path.isfile(db_path):
1433 raise ValueError("Desired database (='%s') does not "%self.name \
-> 1434 + "exist")
1435 SQLDatabase.__init__(self, db_path, read_only=read_only)
1436 if self.get_skeleton() != _cremonaSkeleton:
ValueError: Desired database (='cremona') does not exist
ThrashWed, 07 Jun 2017 21:59:32 -0500https://ask.sagemath.org/question/37838/Evaluate button is running forever for a simple code!?https://ask.sagemath.org/question/37724/evaluate-button-is-running-forever-for-a-simple-code/ Hi,
I installed Sage in Arch linux, almost every package and tried it in browser and command line. When I operate a simple code in command line, I get the answer quickly. But when I try same code in browser it just runs and runs without any result. I tried several browser, didn't work in any of them. I need some help.sinaSun, 28 May 2017 19:08:20 -0500https://ask.sagemath.org/question/37724/Why does source compile fail on archlinux at gcc?https://ask.sagemath.org/question/34172/why-does-source-compile-fail-on-archlinux-at-gcc/I am attempting to compile the most recent sage source code on my Archlinux system. I have all the required packages and tools, and so I would have expected that `make` would simply do its bit.
But it fails on the compile of gcc. I've included below the last few lines of my gcc log file. What is going wrong here, and how do I fix it?
Makefile:1058: recipe for target 'cp/except.o' failed
make[6]: *** [cp/except.o] Error 1
make[6]: Leaving directory '/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1/gcc-build/gcc'
Makefile:4222: recipe for target 'all-stage1-gcc' failed
make[5]: *** [all-stage1-gcc] Error 2
make[5]: Leaving directory '/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1/gcc-build'
Makefile:18866: recipe for target 'stage1-bubble' failed
make[4]: *** [stage1-bubble] Error 2
make[4]: Leaving directory '/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1/gcc-build'
Makefile:889: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1/gcc-build'
real 5m46.259s
user 4m57.797s
sys 0m23.407s
************************************************************************
Error installing package gcc-4.9.3.p1
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the relevant part of the log file
/opt/sage-7.2/logs/pkgs/gcc-4.9.3.p1.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1 and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
(cd '/opt/sage-7.2/local/var/tmp/sage/build/gcc-4.9.3.p1' && '/opt/sage-7.2/sage' --sh)
When you are done debugging, you can type "exit" to leave the subshell.
************************************************************************
AlasdairThu, 21 Jul 2016 06:01:46 -0500https://ask.sagemath.org/question/34172/Matrix dot multiplication slowness and BLAS versionshttps://ask.sagemath.org/question/26507/matrix-dot-multiplication-slowness-and-blas-versions/Hello everyone!
Is there a way to increase a performance of matrix multiplication in Sage? Right now I am relying on numpy's dot function like this:
import numpy as np
N = 768
P = 1024
A = np.random.random((P, N))
A.T.dot(A)
Timing dot product in Sage now gives me a time about second and a half:
>>> setup = """
...
... import numpy as np
...
... N = 768
... P = 1024
...
... A = np.random.random((P, N))
... """
>>> timeit.repeat('A.T.dot(A)', setup=setup, number=10, repeat=3)
[18.736198902130127, 18.66787099838257, 17.36500310897827]
Yet the same multiplication in Matlab takes less than 100 ms. I heard that numpy internally relying on BLAS and it can be replaced with OpenBLAS /ATLAS/IntelMKL or something like that for the better performance.
So I am looking for some kind of manual or info about that is going on with the performance in regard with underlying numpy's components and when one should consider replacing one with another and is there a simple way to do that?
EugeneSun, 12 Apr 2015 08:52:31 -0500https://ask.sagemath.org/question/26507/Can't connect to notebook browser interfacehttps://ask.sagemath.org/question/24743/cant-connect-to-notebook-browser-interface/ I've downloaded Sage 6.3 from AUR, and it works OK in terminal, but I can't connect via browser:
~> sage
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.3, Release Date: 2014-08-10 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: notebook()
The notebook files are stored in: sage_notebook.sagenb
┌────────────────────────────────────────────────┐
│ │
│ Open your web browser to http://localhost:8080 │
│ │
└────────────────────────────────────────────────┘
Executing twistd --pidfile="sage_notebook.sagenb/sagenb.pid" -ny "sage_notebook.sagenb/twistedconf.tac"
/opt/sage/local/lib/python2.7/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
2014-11-02 19:29:59+0100 [-] Log opened.
2014-11-02 19:29:59+0100 [-] twistd 13.2.0 (/opt/sage/local/bin/python 2.7.8) starting up.
2014-11-02 19:29:59+0100 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2014-11-02 19:29:59+0100 [-] QuietSite starting on 8080
2014-11-02 19:29:59+0100 [-] Starting factory <__builtin__.QuietSite instance at 0x7f4b7f7ab830>
It opens browser, but there I get "Connection Refused" message and white screen.
I'm running 64bit Arch Linux. Any ideas?MightyPorkSun, 02 Nov 2014 12:37:26 -0600https://ask.sagemath.org/question/24743/float numbers error?https://ask.sagemath.org/question/7907/float-numbers-error/Whenever I input a float number directly, e.g.
sage: 0.6
sage exits with an error message about sage-ipython instruction not allowed. Anyone has an idea about this?
OS: Linux, ArchLinux
Sage Version: 4.6.1 (arch sage-mathematics binary)iosonofabioFri, 28 Jan 2011 00:28:26 -0600https://ask.sagemath.org/question/7907/