Re: [sage-devel] Re: internet tests failing
On Sat, Mar 16, 2019 at 12:26 AM Dima Pasechnik wrote: > > On Fri, Mar 15, 2019 at 10:17 PM Dima Pasechnik wrote: > > > > > > > > On Friday, March 15, 2019 at 5:58:15 PM UTC, John H Palmieri wrote: > >> > >> > >> > >> On Friday, March 15, 2019 at 3:31:33 AM UTC-7, Dima Pasechnik wrote: > >>> > >>> On Thu, Mar 14, 2019 at 7:51 PM John H Palmieri > >>> wrote: > >>> > > >>> > I'm seeing the same failure on a Mac running the most recent OS X. I > >>> > have openssl 1.1.1a installed on this machine, and I see the error in > >>> > Sage. Then I did './sage -i openssl' and './sage -f python2', and I > >>> > still see the error. The Python 2 log file does not list ssl among the > >>> > modules which were not built, so it looks like it was built with ssl > >>> > support. > >>> > >>> Can you use Sage's pip on packages from external repos, or is this also > >>> broken? > >> > >> > >> $ ./sage --pip install pylatex > >> > >> works just fine: finds the file, downloads it using https, etc. Is that > >> the sort of thing you mean? > > > > > > OK, so apparently pip is less picky here. Unrolling this thing about oeis() > > function, it boils down to > > Python's > > > > >>> from urllib import urlopen > > >>> f=urlopen("https://oeis.org/";) > > > > that fails with CERTIFICATE_VERIFY_FAILED > > I can reproduce this on Sage 8.6 with included openssl installed. > > This is how to fix it, assuming you install your openssl from Sage > spkg, basically using a slightly adjusted script from Python.org > python 2.7.16 installer. > > Change to your SAGE_ROOT > start ./sage -sh > > mkdir local/openssl > > run the attached Python script (which will install certificates module > via pip and pull the needed certs for the local openssl) > > We perhaps should add this to pyopenssl Sage spkg. As a matter of fact, cacert.pm file from local/lib/python2.7/site-packages/pip/_vendor/certifi/cacert.pem appears to work just as well (the path seem to tell us that pip vendors that certifi module) Can someone (Karl?) with this issue (broken access to oeis()) try mkdir local/openssl cd local/openssl ln -s ../lib/python2.7/site-packages/pip/_vendor/certifi/cacert.pem cert.pem to see if this is a simpler fix? At least this works for me. I don't understand why Python.org installer comes with such a complicated solution then. Indeed, $ find /Library/Frameworks/Python.framework/Versions/2.7 -name cacert.pem /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip/_vendor/certifi/cacert.pem /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/certifi/cacert.pem shows that cacert.pem installed by the script (the 2nd entry in this list) and cacert.pem from a vendored by pip copy of certifi module. I did "openssl x509 -in -text" on both of them, and found them containing the same certificate, although the files have unequal size, so there is some extra stuff they differ in. Dima > > Dima > > > > See more on this in the sub-thread here: > > https://groups.google.com/d/msg/sage-devel/f443LhVnyKc/JLLZrQOWBgAJ > > > > > >> > >> > >> > >>> > >>> > >>> Looking at how Homebrew installs openssl 1.1.1b, one sees that it does > >>> some post_install involving system's keychains and certs: > >>> https://github.com/Homebrew/homebrew-core/blob/master/Formula/open...@1.1.rb > >>> > >>> So it could be that Sage's openssl spkg must dance this dance too. > >>> > >>> It looks like a need for a blocker trac ticket on this, then... > >>> > >>> > >>> > >>> > >>> > > >>> > > >>> > > >>> > On Thursday, March 14, 2019 at 11:19:37 AM UTC-7, Volker Braun wrote: > >>> >> > >>> >> I'm guessing you run this on an oldish mac, those have an outdated > >>> >> openssl that doesn't support TLS12. More and more sites are switching > >>> >> that on. Building Sage's openssl should fix that. > >>> >> > >>> >> > >>> >> > >>> >> On Thursday, March 14, 2019 at 7:09:50 PM UTC+1, kcrisman wrote: > >>> >>> > >>> >>> This could be just me. But I am getting a lot of this when I try > >>> >>> running optional internet tests for e.g. src/sage/databases/oeis.py > >>> >>> or src/sage/symbolic/integration/external.py Internet clearly works > >>> >>> if you can read this message, but apparently it doesn't work from > >>> >>> within Sage, because I get this message when I try it in the Sage > >>> >>> command line as well with e.g. this command. Any ideas - do I need > >>> >>> to rebuild Sage with additional SSL support or something? That > >>> >>> should be mentioned somewhere. Thanks! > >>> >>> > >>> >>> - kcrisman > >>> >>> > >>> >>> w = oeis(7540) ; w > >>> >>> > >>> >>> > >>> >>> URLError: >>> >>> certificate verify failed (_ssl.c:726)> > >>> > > >>> > -- > >>> > 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 pos
Re: [sage-devel] Re: internet tests failing
On Sat, Mar 16, 2019 at 06:05:35AM -0700, kcrisman wrote: > This is all very helpful. Hopefully I'll not miss if there is a beta or rc > version of Sage implementing this - if I fix this with the script now, I > won't be able to test "vanilla"-ish Sage. well, to break it back it suffices to remove local/openssl/ and its contents :-) -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: internet tests failing
This is all very helpful. Hopefully I'll not miss if there is a beta or rc version of Sage implementing this - if I fix this with the script now, I won't be able to test "vanilla"-ish Sage. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Igraph's pagerank not working in my sage module
Sure On Sat 16 Mar, 2019, 4:59 PM Dima Pasechnik Yes, this segfaults on all the graphs I tried on Linux, but works on MacOS. > > No idea why, please open a trac ticket on this. > > On Sat, Mar 16, 2019 at 8:52 AM rajat.mittal.mat15 via sage-devel > wrote: > > > > I have recently installed igraph using ./sage -i igraph and ./sage - i > python_igraph > > I also did sage build and ./sage -b > > > > But using it > > > > sage: G = graphs.RandomGNP(1000, .01) > > sage: I = G.igraph_graph() > > sage: %timeit I.pagerank() > > > > gives following error > > > > filename = 0x7ffc0bef5337 > "/home/rajat/new_version/sage-8.7.beta6/src/bin/sage-ipython" > > module = 0x0 > > fp = 0x1b033f0 > > p = > > unbuffered = 0 > > skipfirstline = 0 > > stdin_is_interactive = 1 > > help = > > version = > > saw_unbuffered_flag = > > cf = {cf_flags = 0} > > #78 0x7ff538f15830 in __libc_start_main (main=0x4006f0 , > argc=3, > > argv=0x7ffc0bef4708, init=, fini=, > > rtld_fini=, stack_end=0x7ffc0bef46f8) > > at ../csu/libc-start.c:291 > > result = > > unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, > 164082578521821197, > > 4196096, 140720508716800, 0, 0, -162438125174419443, > > -167616841612554227}, mask_was_saved = 0}}, priv = {pad > = { > > 0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, > > canceltype = 0}}} > > not_first_call = > > #79 0x00400729 in _start () > > No symbol table info available. > > > > > > Cython backtrace > > > > > > 29 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory. > > Traceback (most recent call last): > > File "", line 56, in > > File "/usr/lib/python3/dist-packages/Cython/Debugger/libcython.py", > line 689, in invoke > > for arg in string_to_argv(args): > > TypeError: argument 1 must be str, not bytes > > Saved trace to /home/rajat/.sage/crash_logs/crash_L9MmKW.log > > > > Unhandled SIGSEGV: A segmentation fault occurred. > > This probably occurred because a *compiled* module has a bug > > in it and is not properly wrapped with sig_on(), sig_off(). > > Python will now terminate. > > > > Segmentation fault (core dumped) > > > > > > Detailed output s attached with > > > > other algorithms of igraph are working fine. > > My OS is ubuntu 16.04. > > But David using OSx reported this to be working fine and giving correct > output. > > > > Note I am using sage-8.7.beta6 develop version. > > Anyone have a clue why this is happening? > > > > > > Thanks Rajat > > > > -- > > 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+unsubscr...@googlegroups.com. > > To post to this group, send email to sage-devel@googlegroups.com. > > Visit this group at https://groups.google.com/group/sage-devel. > > For more options, visit https://groups.google.com/d/optout. > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Igraph's pagerank not working in my sage module
Yes, this segfaults on all the graphs I tried on Linux, but works on MacOS. No idea why, please open a trac ticket on this. On Sat, Mar 16, 2019 at 8:52 AM rajat.mittal.mat15 via sage-devel wrote: > > I have recently installed igraph using ./sage -i igraph and ./sage - i > python_igraph > I also did sage build and ./sage -b > > But using it > > sage: G = graphs.RandomGNP(1000, .01) > sage: I = G.igraph_graph() > sage: %timeit I.pagerank() > > gives following error > > filename = 0x7ffc0bef5337 > "/home/rajat/new_version/sage-8.7.beta6/src/bin/sage-ipython" > module = 0x0 > fp = 0x1b033f0 > p = > unbuffered = 0 > skipfirstline = 0 > stdin_is_interactive = 1 > help = > version = > saw_unbuffered_flag = > cf = {cf_flags = 0} > #78 0x7ff538f15830 in __libc_start_main (main=0x4006f0 , argc=3, > argv=0x7ffc0bef4708, init=, fini=, > rtld_fini=, stack_end=0x7ffc0bef46f8) > at ../csu/libc-start.c:291 > result = > unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, 164082578521821197, > 4196096, 140720508716800, 0, 0, -162438125174419443, > -167616841612554227}, mask_was_saved = 0}}, priv = {pad = { > 0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, cleanup = 0x0, > canceltype = 0}}} > not_first_call = > #79 0x00400729 in _start () > No symbol table info available. > > > Cython backtrace > > > 29 ../sysdeps/unix/sysv/linux/waitpid.c: No such file or directory. > Traceback (most recent call last): > File "", line 56, in > File "/usr/lib/python3/dist-packages/Cython/Debugger/libcython.py", line > 689, in invoke > for arg in string_to_argv(args): > TypeError: argument 1 must be str, not bytes > Saved trace to /home/rajat/.sage/crash_logs/crash_L9MmKW.log > > Unhandled SIGSEGV: A segmentation fault occurred. > This probably occurred because a *compiled* module has a bug > in it and is not properly wrapped with sig_on(), sig_off(). > Python will now terminate. > > Segmentation fault (core dumped) > > > Detailed output s attached with > > other algorithms of igraph are working fine. > My OS is ubuntu 16.04. > But David using OSx reported this to be working fine and giving correct > output. > > Note I am using sage-8.7.beta6 develop version. > Anyone have a clue why this is happening? > > > Thanks Rajat > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Computing determinants of obviously singular matrices
Indeed the determinant code in matrix2.pyx is a huge mess. Some dispatch is unavoidable but many specialized matrix implement their own determinant function: matrix_complex_ball_dense.pyx matrix_double_dense.pyx matrix_gap.pyx matrix_integer_dense.pyx matrix_mod2_dense.pyx matrix_modn_sparse.pyx matrix_mpolynomial_dense.pyx matrix_rational_dense.pyx Because of this, I wonder if some of the dispatch could simply be avoided in the generic matrix2.pyx. Also, since for the symbolic ring, since there is a class matrix_symbolic_dense.pyx the code dedicated to this case would better go there. Vincent Le 16/03/2019 à 10:38, 'Martin R' via sage-devel a écrit : I think the problem is that it computes the characteristic polynomial and then takes the constant term. That seems a bit wasteful, no? c = self.charpoly(var, algorithm="df")[0] Martin Am Freitag, 15. März 2019 23:07:04 UTC+1 schrieb Dima Pasechnik: On Fri, Mar 15, 2019 at 02:59:05PM -0700, Kwankyu Lee wrote: If the determinant is obviously zero, then you don't need to run the computation. If a preprocessing to check zero rows or columns is added, then the determinant computation would become slower for usual nontrivial cases. I would not be so categorical here. It makes a perfect sense to add a parameter to the determinant function that would switch such a check on. Similarly, one can think of adding a check for rows with just one non-0, as they can be used for a very effcient reduction... Dima Cheers. On Saturday, March 16, 2019 at 2:15:06 AM UTC+9, Maximilian Jaroschek wrote: Hello, I'm using the current developer version of sage and noticed that when computing determinants of matrices over polynomial rings and rational functions, cases where the determinant is easily seen to be zero due to zero rows or columns can take an unreasonable long time to compute. I compared the timings with the same computation over other domains. sage: L.=PolynomialRing(QQ) sage: MS=MatrixSpace(L,100) sage: time _=MS.zero().determinant() CPU times: user 13.4 s, sys: 19.6 ms, total: 13.5 s Wall time: 13.5 s sage: MS=MatrixSpace(L.fraction_field(),100) sage: time _=MS.zero().determinant() CPU times: user 200 ms, sys: 0 ns, total: 200 ms Wall time: 200 ms sage: MS=MatrixSpace(ZZ,100) sage: time _=MS.zero().determinant() CPU times: user 563 盜, sys: 5 盜, total: 568 盜 Wall time: 573 盜 sage: MS=MatrixSpace(L,40) sage: M=MS.random_element(3) sage: M=M.with_rescaled_row(0,0) sage: M.rows()[0]==0 True sage: time _=M.determinant() CPU times: user 35.2 s, sys: 8.06 ms, total: 35.2 s Wall time: 35.2 s sage: MS=MatrixSpace(L.fraction_field(),10) sage: M=MS.random_element(3) sage: M=M.with_rescaled_row(0,0) sage: M.rows()[0]==0 True sage: time _=M.determinant() CPU times: user 1min 56s, sys: 300 ms, total: 1min 56s Wall time: 1min 56s sage: MS=MatrixSpace(ZZ,500) sage: M=MS.random_element(2^40) sage: M=M.with_rescaled_row(0,0) sage: M.rows()[0]==0 True sage: time _=M.determinant() CPU times: user 67.6 ms, sys: 0 ns, total: 67.6 ms Wall time: 67.9 ms sage: Probably a preprocessing step could help that looks for zero rows or columns before running the actual algorithm. Best, Maximilian -- 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 post to this group, send email to sage-...@googlegroups.com . Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Re: Computing determinants of obviously singular matrices
I think the problem is that it computes the characteristic polynomial and then takes the constant term. That seems a bit wasteful, no? c = self.charpoly(var, algorithm="df")[0] Martin Am Freitag, 15. März 2019 23:07:04 UTC+1 schrieb Dima Pasechnik: > > On Fri, Mar 15, 2019 at 02:59:05PM -0700, Kwankyu Lee wrote: > > > > If the determinant is obviously zero, then you don't need to run the > > computation. If a preprocessing to check zero rows or columns is added, > > then the determinant computation would become slower for usual > nontrivial > > cases. > > I would not be so categorical here. It makes a perfect sense to add a > parameter to the determinant function that would switch such a check on. > Similarly, one can think of adding a check for rows with just one non-0, > as they can be used for a very effcient reduction... > > Dima > > > > > > > Cheers. > > > > On Saturday, March 16, 2019 at 2:15:06 AM UTC+9, Maximilian Jaroschek > wrote: > > > > > > Hello, > > > > > > I'm using the current developer version of sage and noticed that when > > > computing determinants of matrices over polynomial rings and rational > > > functions, cases where the determinant is easily seen to be zero due > to > > > zero rows or columns can take an unreasonable long time to compute. I > > > compared the timings with the same computation over other domains. > > > > > > sage: L.=PolynomialRing(QQ) > > > sage: MS=MatrixSpace(L,100) > > > sage: time _=MS.zero().determinant() > > > CPU times: user 13.4 s, sys: 19.6 ms, total: 13.5 s > > > Wall time: 13.5 s > > > sage: MS=MatrixSpace(L.fraction_field(),100) > > > sage: time _=MS.zero().determinant() > > > CPU times: user 200 ms, sys: 0 ns, total: 200 ms > > > Wall time: 200 ms > > > sage: MS=MatrixSpace(ZZ,100) > > > sage: time _=MS.zero().determinant() > > > CPU times: user 563 盜, sys: 5 盜, total: 568 盜 > > > Wall time: 573 盜 > > > sage: MS=MatrixSpace(L,40) > > > sage: M=MS.random_element(3) > > > sage: M=M.with_rescaled_row(0,0) > > > sage: M.rows()[0]==0 > > > True > > > sage: time _=M.determinant() > > > CPU times: user 35.2 s, sys: 8.06 ms, total: 35.2 s > > > Wall time: 35.2 s > > > sage: MS=MatrixSpace(L.fraction_field(),10) > > > sage: M=MS.random_element(3) > > > sage: M=M.with_rescaled_row(0,0) > > > sage: M.rows()[0]==0 > > > True > > > sage: time _=M.determinant() > > > CPU times: user 1min 56s, sys: 300 ms, total: 1min 56s > > > Wall time: 1min 56s > > > sage: MS=MatrixSpace(ZZ,500) > > > sage: M=MS.random_element(2^40) > > > sage: M=M.with_rescaled_row(0,0) > > > sage: M.rows()[0]==0 > > > True > > > sage: time _=M.determinant() > > > CPU times: user 67.6 ms, sys: 0 ns, total: 67.6 ms > > > Wall time: 67.9 ms > > > sage: > > > > > > Probably a preprocessing step could help that looks for zero rows or > > > columns before running the actual algorithm. > > > > > > > > > Best, > > > Maximilian > > > > > > > -- > > 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 post to this group, send email to sage-...@googlegroups.com > . > > Visit this group at https://groups.google.com/group/sage-devel. > > For more options, visit https://groups.google.com/d/optout. > > -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] how to log sage output for long running program
On Fri, Mar 15, 2019 at 10:21:48PM -0700, 'Justin C. Walker' via sage-devel wrote: > > > On Mar 15, 2019, at 21:46 , Ai Bo wrote: > > > > I am running a long running program. I would like to log the output. > > I have tried: > > ../sage-8.6/sage test.sage > test.log & > > > > There is nothing written in test.log before the program finishes. > > I tried to use tee, same problem. > > > > I tried to add: > > f = open('test.log', 'w') > > > > in my test.sage program, still nothing is written before the program > > finishes. > > > > How to log a long running program? > > The problem, I think, is that python uses buffered output. I assume that you > are using print statements, so (without knowing more), I would use > sys.stdout.flush() > after each print, or after points in your program where the state is useful > for debugging. > > If I’ve made the wrong assumptions, let us know. I think he logs to f, so one would have to call f.flush() to flush the buffer. Dima > > HTH > > Justin > > -- > Justin C. Walker > Curmudgeon at Large > Director > Institute for the Enhancement of the Director's Income > -- > Build a man a fire and he'll be warm > for a night. > Set a man on fire and he'll be warm > for the rest of his life. > > > > -- > 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+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- 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+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.