Re: Sage fails to run python script correctly

308 views
Skip to first unread message

Jason Grout

unread,
Jul 2, 2012, 9:25:19 AM7/2/12
to sage-s...@googlegroups.com
On 7/2/12 8:17 AM, Caluca wrote:
> I have written a simple Python program consisting of several .py files. The program runs perfectly in the IPython interpreter, however I get a segmentation fault whenever I try to run it with Sage. The exact error I get is:
>
> /usr/lib/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f47350a7f46]
> /usr/lib/sage/local/lib/libcsage.so(sigdie+0x14)[0x7f47350a7f78]
> /usr/lib/sage/local/lib/libcsage.so(sage_signal_handler+0x20c)[0x7f47350a7bc6]
> /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f473a94fcb0]
> /usr/lib/sage/local/lib/libatlas.so(+0x66f0d)[0x7f472f43cf0d]
>
> ------------------------------------------------------------------------
> Unhandled SIGSEGV: A segmentation fault occurred in Sage.
> This probably occurred because a *compiled* component of Sage has a bug
> in it and is not properly wrapped with sig_on(), sig_off(). You might
> want to run Sage under gdb with 'sage -gdb' to debug this.
> Sage will now terminate.
> ------------------------------------------------------------------------
> /usr/lib/sage/spkg/bin/sage: line 312: 5332 Segmentation fault (core dumped) sage-ipython "$@" -i
>
>
> The expected result is that the program runs exactly the same as in the IPython interpreter.
>

Having the actual script that is causing the problem would be a great
help in trying to find out what is wrong. Can you attach it?

Jason

Message has been deleted

Caluca

unread,
Jul 2, 2012, 10:23:29 AM7/2/12
to sage-s...@googlegroups.com
Yes, I attached an archive containing all the scripts. The main script that you need to run is "flowSolver.py". It starts out by requesting some manual input. This goes well, but immediately after that, I get the above error. In a terminal I did the following:

user@system:~$ cd Workspace/Spyder/SimpleCFDSolver/
user@system:~/Workspace/Spyder/SimpleCFDSolver$ sage
----------------------------------------------------------------------
| Sage Version 5.0.1, Release Date: 2012-06-10                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: run flowSolver.py
Select flow case:
1: Uniform parallel flow
2: Poiseuille flow
3: Lid-driven cavity flow
4: Rotating flow
1
 
Input grid size:
40
 
Select linear system solving method:
1: Gaussian elimination
2: Conjugate gradient (CG)
3: Bi-conjugate gradient (BiCG)
1
 
Set linear system solver and solution residual tolerance:
-6
 
Set maximum allowable iterations:
1000

Thank you for your interest and feel free to ask for more details.
SimpleFlowSolver.tar.gz

Caluca

unread,
Jul 4, 2012, 5:45:32 AM7/4/12
to sage-s...@googlegroups.com
Any help anyone?

Dima Pasechnik

unread,
Jul 4, 2012, 5:53:00 AM7/4/12
to sage-s...@googlegroups.com


On Monday, 2 July 2012 21:17:25 UTC+8, Caluca wrote:
I have written a simple Python program consisting of several .py files. The program runs perfectly in the IPython interpreter, however I get a segmentation fault whenever I try to run it with Sage. The exact error I get is:

/usr/lib/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f47350a7f46]
/usr/lib/sage/local/lib/libcsage.so(sigdie+0x14)[0x7f47350a7f78]
/usr/lib/sage/local/lib/libcsage.so(sage_signal_handler+0x20c)[0x7f47350a7bc6]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f473a94fcb0]
/usr/lib/sage/local/lib/libatlas.so(+0x66f0d)[0x7f472f43cf0d]

------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------
/usr/lib/sage/spkg/bin/sage: line 312:  5332 Segmentation fault      (core dumped) sage-ipython "$@" -i


The expected result is that the program runs exactly the same as in the IPython interpreter.

well, it's not necessary what you should expect. Sage is an extension of Python, and overloads some
of Python functionality with its own versions.
The error message indicates that the crash happens in numerical linear algebra...
But, indeed, such crashes should not happen normally.
Thanks for the report.

 

I am running:

Kubuntu 12.04 (64-bit)


Sage Version 5.0.1, Release Date: 2012-06-10

Python 2.7.3
IPython 0.12.1

Dima Pasechnik

unread,
Jul 4, 2012, 5:56:44 AM7/4/12
to sage-s...@googlegroups.com
by the way, you incuded .pyc files in your tar archive, but you should not do this. These files are created automatically
by the interpreter from .py files!

Jan Groenewald

unread,
Jul 4, 2012, 6:03:07 AM7/4/12
to sage-s...@googlegroups.com
Hi

On 4 July 2012 11:53, Dima Pasechnik <dim...@gmail.com> wrote:


On Monday, 2 July 2012 21:17:25 UTC+8, Caluca wrote:
I have written a simple Python program consisting of several .py files. The program runs perfectly in the IPython interpreter, however I get a segmentation fault whenever I try to run it with Sage. The exact error I get is:

/usr/lib/sage/local/lib/libcsage.so(print_backtrace+0x31)[0x7f47350a7f46]
/usr/lib/sage/local/lib/libcsage.so(sigdie+0x14)[0x7f47350a7f78]
/usr/lib/sage/local/lib/libcsage.so(sage_signal_handler+0x20c)[0x7f47350a7bc6]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0)[0x7f473a94fcb0]
/usr/lib/sage/local/lib/libatlas.so(+0x66f0d)[0x7f472f43cf0d]

------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred in Sage.
This probably occurred because a *compiled* component of Sage has a bug
in it and is not properly wrapped with sig_on(), sig_off(). You might
want to run Sage under gdb with 'sage -gdb' to debug this.
Sage will now terminate.
------------------------------------------------------------------------
/usr/lib/sage/spkg/bin/sage: line 312:  5332 Segmentation fault      (core dumped) sage-ipython "$@" -i


The expected result is that the program runs exactly the same as in the IPython interpreter.


Note sage overrides some operators favoured by mathematicians, e.g. ^.

I get, Ubuntu 12.04, PPA Sage 5.0.1, sag -gdb:

 Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb2c17700 (LWP 15581)]
0x00007fffeb4e0f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /usr/lib/sage/local/lib/libatlas.so
(gdb) ) bt
#0  0x00007fffeb4e0f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /usr/lib/sage/local/lib/libatlas.so
#1  0x00007fffeb550f8f in ATL_dmmIJK2 ()
   from /usr/lib/sage/local/lib/libatlas.so
#2  0x00007fffeb551781 in ATL_dmmIJK ()
   from /usr/lib/sage/local/lib/libatlas.so
#3  0x00007fffeb547be5 in ATL_dgemm () from /usr/lib/sage/local/lib/libatlas.so
#4  0x00007fffeb97516d in ATL_dptgemm0 ()
   from /usr/lib/sage/local/lib/libatlas.so
#5  0x00007ffff77ece9a in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff6e194bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x0000000000000000 in ?? ()
(gdb)

0 jan@muizenberg:/var/autofs/misc/home/jan/t$dmesg |tail -4
[16092.553653] do_general_protection: 27 callbacks suppressed
[16092.553657] python[11201] general protection ip:7feb5b24cf0d sp:7feb42679b38 error:0 in libatlas.so[7feb5b1e6000+542000]
[16171.220888] python[13548] general protection ip:7f9df58a7f0d sp:7f9dc7ff3b38 error:0 in libatlas.so[7f9df5841000+542000]
[16233.702079] python[14560] general protection ip:7f8363b90f0d sp:7f832b2c6b38 error:0 in libatlas.so[7f8363b2a000+542000]
0 jan@muizenberg:/var/autofs/misc/home/jan/t$egrep 'name|flags' /proc/cpuinfo |head -2
model name    : Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
flags        : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority
0 jan@muizenberg:/var/autofs/misc/home/jan/t$


BTW, <Googling ATL_dJIK40x40x40TN40x40x0_a1_b1 () leads to (I think unrelated?)
http://trac.sagemath.org/sage_trac/ticket/11581

Regards,
Jan


--
  .~.
  /V\     Jan Groenewald
 /( )\    www.aims.ac.za
 ^^-^^


Dima Pasechnik

unread,
Jul 4, 2012, 6:05:32 AM7/4/12
to sage-s...@googlegroups.com
I cannot reproduce this on OSX10.6.8 machine running Sage 5.1.beta6.
Your example completes normally.

This might be due to the different setup, as Apple's Lapack/BLAS is used instead of 
Atlas.

On Wednesday, 4 July 2012 17:45:32 UTC+8, Caluca wrote:
Any help anyone?

Volker Braun

unread,
Jul 4, 2012, 6:38:05 AM7/4/12
to sage-s...@googlegroups.com
This looks suspiciously like a bug in ATLAS-devel (3.9.x) that I recently helped to track down. Is the Ubuntu PPA compiling Sage's own ATLAS library or is it using a system library? Note that Sage ships ATLAS-stable (3.8.x) for a good reason.

Dima Pasechnik

unread,
Jul 4, 2012, 11:46:20 AM7/4/12
to sage-s...@googlegroups.com
indeed, it seems to be not reproducible on "standard" Sage installs, so far (I also tried Linux x86_64 with Sage 5.1.something)

Jan Groenewald

unread,
Jul 4, 2012, 12:10:12 PM7/4/12
to sage-s...@googlegroups.com
Hi

On 4 July 2012 12:38, Volker Braun <vbrau...@gmail.com> wrote:
This looks suspiciously like a bug in ATLAS-devel (3.9.x) that I recently helped to track down. Is the Ubuntu PPA compiling Sage's own ATLAS library or is it using a system library? Note that Sage ships ATLAS-stable (3.8.x) for a good reason.

The Ubuntu PPA is just packaging the upstream compiled binary downloadable
from sagemath.org

Sage atlas:  atlas-3.8.4.p1.spkg

and just in case, system atlas: libatlas3gf-base 3.8.4-3build1

Note the original author appears to have compiled from source as he did not
mention the PPA. He did not say either way though.

Regards,
Jan

Jan Groenewald

unread,
Jul 4, 2012, 12:11:11 PM7/4/12
to sage-s...@googlegroups.com
Hi

On 4 July 2012 17:46, Dima Pasechnik <dim...@gmail.com> wrote:
indeed, it seems to be not reproducible on "standard" Sage installs, so far (I also tried Linux x86_64 with Sage 5.1.something)


On Wednesday, 4 July 2012 18:38:05 UTC+8, Volker Braun wrote:
This looks suspiciously like a bug in ATLAS-devel (3.9.x) that I recently helped to track down. Is the Ubuntu PPA compiling Sage's own ATLAS library or is it using a system library? Note that Sage ships ATLAS-stable (3.8.x) for a good reason.

Uhm, isn't the stable release compiled upstream at sagemath.org more "standard" than
a 5.1 beta compiled on a personal computer??

Regards,
Jan

Caluca

unread,
Jul 5, 2012, 1:48:15 AM7/5/12
to sage-s...@googlegroups.com
Hey guys thank you for your support. Indeed I installed the upstream-binary through Synaptic after adding the PPA in a terminal.

If you need any information regarding settings/libraries/packages on my laptop, please feel free to ask.

Dima Pasechnik

unread,
Jul 5, 2012, 2:00:01 AM7/5/12
to sage-s...@googlegroups.com


On Thursday, 5 July 2012 00:11:11 UTC+8, Jan Groenewald wrote:
Hi

On 4 July 2012 17:46, Dima Pasechnik <dim...@gmail.com> wrote:
indeed, it seems to be not reproducible on "standard" Sage installs, so far (I also tried Linux x86_64 with Sage 5.1.something)


On Wednesday, 4 July 2012 18:38:05 UTC+8, Volker Braun wrote:
This looks suspiciously like a bug in ATLAS-devel (3.9.x) that I recently helped to track down. Is the Ubuntu PPA compiling Sage's own ATLAS library or is it using a system library? Note that Sage ships ATLAS-stable (3.8.x) for a good reason.

Uhm, isn't the stable release compiled upstream at sagemath.org more "standard" than
a 5.1 beta compiled on a personal computer??

by "standard" I meant a non-PPA install.

Dima

Dima Pasechnik

unread,
Jul 5, 2012, 2:02:03 AM7/5/12
to sage-s...@googlegroups.com


On Thursday, 5 July 2012 13:48:15 UTC+8, Caluca wrote:
Hey guys thank you for your support. Indeed I installed the upstream-binary through Synaptic after adding the PPA in a terminal.

If you need any information regarding settings/libraries/packages on my laptop, please feel free to ask.

as a wild guess, can you remove all the .pyc files produced by ipython and then run Sage?


Caluca

unread,
Jul 5, 2012, 2:23:18 AM7/5/12
to sage-s...@googlegroups.com
@Dima

I will try that in about 1.5h.

Thanks

Jan Groenewald

unread,
Jul 5, 2012, 2:39:59 AM7/5/12
to sage-s...@googlegroups.com
Hi

On 5 July 2012 08:00, Dima Pasechnik <dim...@gmail.com> wrote:


On Thursday, 5 July 2012 00:11:11 UTC+8, Jan Groenewald wrote:
Hi

On 4 July 2012 17:46, Dima Pasechnik <dim...@gmail.com> wrote:
indeed, it seems to be not reproducible on "standard" Sage installs, so far (I also tried Linux x86_64 with Sage 5.1.something)


On Wednesday, 4 July 2012 18:38:05 UTC+8, Volker Braun wrote:
This looks suspiciously like a bug in ATLAS-devel (3.9.x) that I recently helped to track down. Is the Ubuntu PPA compiling Sage's own ATLAS library or is it using a system library? Note that Sage ships ATLAS-stable (3.8.x) for a good reason.

Uhm, isn't the stable release compiled upstream at sagemath.org more "standard" than
a 5.1 beta compiled on a personal computer??

by "standard" I meant a non-PPA install.

I donwloaded the upstream binary and tried that (non-PPA) instead.
The stable 5.0.1 on Ubuntu 12.04. It is still reproducible.

With the pyc files:

 Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb2ee0700 (LWP 31255)]
0x00007fffeb7a9f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
(gdb) bt
#0  0x00007fffeb7a9f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#1  0x00007fffeb819f8f in ATL_dmmIJK2 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#2  0x00007fffeb81a781 in ATL_dmmIJK ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#3  0x00007fffeb810be5 in ATL_dgemm ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#4  0x00007fffebc3e16d in ATL_dptgemm0 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so

#5  0x00007ffff77ece9a in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff6e194bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x0000000000000000 in ?? ()
(gdb)

Without the pyc files (removed them first)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffb2ee0700 (LWP 32264)]
0x00007fffeb7a9f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
(gdb) bt
#0  0x00007fffeb7a9f0d in ATL_dJIK40x40x40TN40x40x0_a1_b1 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#1  0x00007fffeb819f8f in ATL_dmmIJK2 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#2  0x00007fffeb81a781 in ATL_dmmIJK ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#3  0x00007fffeb810be5 in ATL_dgemm ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so
#4  0x00007fffebc3e16d in ATL_dptgemm0 ()
   from /srv/local/Disk_Space/jan/sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/libatlas.so

#5  0x00007ffff77ece9a in start_thread ()
   from /lib/x86_64-linux-gnu/libpthread.so.0
#6  0x00007ffff6e194bd in clone () from /lib/x86_64-linux-gnu/libc.so.6
#7  0x0000000000000000 in ?? ()
(gdb)

I will try a from-source compile of the stable release next.

Regards,
Jan

Caluca

unread,
Jul 5, 2012, 2:54:10 AM7/5/12
to sage-s...@googlegroups.com
Well it seems I have a little bit of time.

I still get the same error when removing the .pyc files beforehand. I tried something new, but this still does not work however there is a slight change in the error. Instead of starting a sage session and then executing my code with:

run flowSolver.py

I ran my code directly from the terminal without starting a sage session by:

sage flowSolver.py

In the first attempt I got:

/usr/lib/sage/spkg/bin/sage: line 312:  4135 Segmentation fault      (core dumped) sage-ipython "$@" -i

and in the second attempt I got

/usr/lib/sage/spkg/bin/sage: line 468:  5244 Segmentation fault      (core dumped) python "$@"

The errors are on different lines, respectively 312 and 468. I do not know whether this is relevant, but it doesn't hurt to share.

Jan Groenewald

unread,
Jul 5, 2012, 2:56:50 AM7/5/12
to sage-s...@googlegroups.com
Hi


This seems to be an Ubuntu 12.04 problem. On Ubuntu 11.04
with the same upstream binary:

    5 0.0020140316698371023 0.001542013044808182
   6 0.0019834456743228197 0.0015133962643927208
   7 0.0019536152967604622 0.0014857142847366934
   8 0.0019245234850758745 0.0014589328600844204
   9 0.0018961547284709374 0.0014330137481604196
  10 0.0018684955292540726 0.0014079150575883282
  11 0.0018415347444111442 0.0013835917295943654
  12 0.0018152637651007548 0.0013599961433163651
  13 0.0017896765121765098 0.0013370788289153368
  14 0.001764769237463005 0.0013147892681664715
  15 0.0017405401331557621 0.0012930767585252209
  16 0.0017169887646163316 0.0012718913139809771
  17 0.0016941153542435229 0.0012511845744305283
  18 0.0016719199551473378 0.0012309106948410859
  19 0.0016504015623261317 0.0012110271860831642
  20 0.0016295572152261967 0.0011914956808990625
  21 0.0016093811484123527 0.0011722826008898637
  22 0.0015898640462462818 0.001153359703499124
  23 0.0015709924528396796 0.0011347044915844869
  24 0.0015527483803025274 0.001116300472154339
...


Regards,
Jan

Dima Pasechnik

unread,
Jul 5, 2012, 3:00:14 AM7/5/12
to sage-s...@googlegroups.com
It would be great if you can narrow it down to the place in your code the crash takes place, and produce a short test that does not require manual intervention, yet demonstrates the bug... 

Jan Groenewald

unread,
Jul 5, 2012, 3:29:33 AM7/5/12
to sage-s...@googlegroups.com
Hi Caluca,


That may be the before and after the creation of the pyc files.

I only get this on line 468 though.


Could you adapt your program and shorten it to isolate the bug, so that we can run

$ sage -gdb
sage: run flowSolver.py

and get no interactive questions, i.e. hardcode some parameters, and a low number
of iterations so that it runs quickly, even 10 is enough. This will speed up testing a lot.

Regards,
Jan


--
To post to this group, send email to sage-s...@googlegroups.com
To unsubscribe from this group, send email to sage-support...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Caluca

unread,
Jul 5, 2012, 6:19:43 AM7/5/12
to sage-s...@googlegroups.com
@Jan Groenewald and Dima

I have hard-coded some parameters into the program. No manual interaction is needed anymore. Also the program performs only 10 iterations now, due to this the eventual physical results might be bogus, but that is not relevant for the debugging.

However I am at my uni now and I did not bring my laptop. The python environment at my uni has only numpy and no scipy, so at the moment I cannot isolate the bug. I will be able to do this in the evening (its now 12.19 PM)

Thank you for your help guys. I really appreciate it!
SimpleFlowSolver.tar.gz

Jan Groenewald

unread,
Jul 5, 2012, 6:38:15 AM7/5/12
to sage-s...@googlegroups.com, sage-...@googlegroups.com
Hi

[CC-ing to save-devel.]

I ran this on a from-source compiled 5.0.1 sage on Ubuntu 12.04. The problem
is NOT reproduced.

(the underlying problem might still be that during the compilation
somewhere linking to libraries escapes to system versions somewhere, which could
be very hard to trace... I'll leave that for others to ponder)

The upstream binary built on 10.04 running on 12.04 seems to be the problem:
sage-5.0.1-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux.tar.lzma

Note the 32bit is built ON 12.04 for 12.04, and probably does not exhibit this
problem.
sage-5.0.1-linux-32bit-ubuntu_12.04_lts-i686-Linux.tar.lzma

Is it possible for upstream to build ON Ubuntu 12.04 for 12.04? I have asked
before, and am not sure who is in charge of this.

I have asked a couple of times for build scripts. I am not familiar with build
scripts, cross-compiling, or whether a binary tarball as above is easily
produced with sage -bdist, but if someone helps me I am willing to build
ON 12.04 for 12.04 to be made available in the PPA, or even to build on
multiple versions of Ubuntu.

I'm not comfortable enough with this at the moment to be sure a binary
built on my CPU will run on all 64bit CPUs.

Carlos Baptista

unread,
Jul 5, 2012, 6:54:16 AM7/5/12
to sage-s...@googlegroups.com, sage-...@googlegroups.com
Thank you very much Jan Groenewald. I guess that the problem has now been identified.

So it would be best for me to wait until there is an upstream-binary available via the PPA which is built on 12.04 (64 bit) and for 12.04 (64 bit)? How long might it take, days, weeks, months?

Enfin, thank you very much Jan Groenewald.

Dima Pasechnik

unread,
Jul 5, 2012, 6:56:55 AM7/5/12
to sage-s...@googlegroups.com, sage-...@googlegroups.com


On Thursday, 5 July 2012 18:54:16 UTC+8, Carlos Baptista wrote:
Thank you very much Jan Groenewald. I guess that the problem has now been identified.

So it would be best for me to wait until there is an upstream-binary available via the PPA which is built on 12.04 (64 bit) and for 12.04 (64 bit)? How long might it take, days, weeks, months?

you could better build from the source, should take few hours at most...

Carlos Baptista

unread,
Jul 5, 2012, 7:10:20 AM7/5/12
to sage-s...@googlegroups.com
@ Dima Pasechnik

How can I do that? I am not that good with compiling and have been on Linux for less than a year. Hence the reason why I install almost everything through Synaptic (graphical package manager).

Jan Groenewald

unread,
Jul 5, 2012, 8:16:30 AM7/5/12
to sage-s...@googlegroups.com
Dear Carlos,

On 5 July 2012 13:10, Carlos Baptista <carloss...@gmail.com> wrote:
@ Dima Pasechnik

How can I do that? I am not that good with compiling and have been on Linux for less than a year. Hence the reason why I install almost everything through Synaptic (graphical package manager).


I will be updating the PPA, but this could take days or weeks until the binary is fixed.
This bug means that the official sage binary built on 10.04 is NOT supported on 12.04.

In the meantime, you can compile from source by putting these commands in a terminal
on a personal computer:

cd
mkdir src
cd src
wget -c http://boxen.math.washington.edu/home/sagemath/sage-mirror/src/sage-5.0.1.tar
tar -xvf sage-5.0.1.tar
cd sage-5.0.1
make
echo alias sage="$HOME/src/sage-5.0.1/sage" >> ~/.bashrc

Close and open the terminal and type either sage
or sage -notebook to open the notebook interface in a web browser.

Regards,
Jan


Carlos Baptista

unread,
Jul 5, 2012, 9:14:46 PM7/5/12
to sage-s...@googlegroups.com
Thank you very much Jan. I am compiling from source now. It is taking for ever. When its done and I have tested my program on it, I will report back.

Carlos Baptista

unread,
Jul 6, 2012, 5:02:52 AM7/6/12
to sage-s...@googlegroups.com
Well building from source took a little over 2 hours. Eventually I got an error during building Sage. If I try to run Save it tells me the file/directory does not exist.

I am not keen on trying this anew as it will take about 2 hours for each attempt. Hence I will remain patient for now and wait until the PPA has been updated for 12.04, 64 bit. This way it is easier for me.

Thank you very much for your help guys!

Jan Groenewald

unread,
Jul 6, 2012, 5:32:34 AM7/6/12
to sage-s...@googlegroups.com
Dear Carlos,

On 6 July 2012 11:02, Carlos Baptista <carloss...@gmail.com> wrote:
Well building from source took a little over 2 hours. Eventually I got an error during building Sage. If I try to run Save it tells me the file/directory does not exist.

I am not keen on trying this anew as it will take about 2 hours for each attempt. Hence I will remain patient for now and wait until the PPA has been updated for 12.04, 64 bit. This way it is easier for me.

Perhaps you did not have all the dependencies needed to build and run sage.

Try

sudo apt-get install build-essential gfortran dpkg-dev make m4 perl tarbinutils xz-lzma texlive-latex-recommended dvipng imagemagick ffmpeg

Then go in to the sage directory and type make again.

The PPA might take a few days at least, a few weeks at most.

Regards,
Jan

Carlos Baptista

unread,
Jul 6, 2012, 7:16:25 AM7/6/12
to sage-s...@googlegroups.com
Dear Jan,

Before installing those dependencies I checked whether I already had them. It turned out that I already had everything except "tarbinutils". However I cannot seems to find this one in Synaptic. However I do have "tar" and "binutils". Just to be sure that these packages did not corrupt at some point I re-installed them through Synaptic.

I will give it another go. I will report after.

Jan Groenewald

unread,
Jul 6, 2012, 7:35:35 AM7/6/12
to sage-s...@googlegroups.com
On 6 July 2012 13:16, Carlos Baptista <carloss...@gmail.com> wrote:
Dear Jan,

Before installing those dependencies I checked whether I already had them. It turned out that I already had everything except "tarbinutils". However I cannot seems to find this one in Synaptic. However I do have "tar" and "binutils". Just to be sure that these packages did not corrupt at some point I re-installed them through Synaptic.


Sorry, that is correct, tar and binutils

You should also have $HOME/src/sage-5.0.1/install.log, which will give more details
on the build failures.

Regards,
Jan

Carlos Baptista

unread,
Jul 6, 2012, 7:46:14 AM7/6/12
to sage-s...@googlegroups.com
I will have a look when it is build again, I threw everything away yesterday after it failed.

Carlos Baptista

unread,
Jul 6, 2012, 8:00:14 AM7/6/12
to sage-s...@googlegroups.com
Well I am getting this build error:

****************************************************
abort: No module named _socket!
Error with Sage root repository: 'hg incoming' failed.

real    0m0.083s
user    0m0.068s
sys     0m0.008s
************************************************************************
Error installing package sage_root-5.0.1
************************************************************************

I have attached my log file
install.log

Carlos Baptista

unread,
Jul 6, 2012, 8:00:24 AM7/6/12
to sage-s...@googlegroups.com
install.log

Dima Pasechnik

unread,
Jul 6, 2012, 10:26:53 AM7/6/12
to sage-s...@googlegroups.com
here is why _socket extension does not get build:

/home/carlos/Workspace/Sage/src/sage-5.0.1/spkg/build/python-2.7.3.p0/src/Modules/socketmodule.h:51:33: fatal error: bluetooth/bluetooth.h: No such file or directory

weird...

googling says you need to do
apt-get install libbluetooth-dev

Jan Groenewald

unread,
Jul 6, 2012, 10:42:49 AM7/6/12
to sage-s...@googlegroups.com
Hi

On 6 July 2012 16:26, Dima Pasechnik <dim...@gmail.com> wrote:
here is why _socket extension does not get build:

/home/carlos/Workspace/Sage/src/sage-5.0.1/spkg/build/python-2.7.3.p0/src/Modules/socketmodule.h:51:33: fatal error: bluetooth/bluetooth.h: No such file or directory

weird...

googling says you need to do
apt-get install libbluetooth-dev


Very weird. I don't have libbluetooth-dev installed and sage compiles OK. I do have a buetooth.h
in the kernel headers.

0 jan@muizenberg:/var/autofs/misc/home/jan$locate bluetooth.h^[[A/usr/src/linux-headers-3.2.0-26/include/net/bluetooth/bluetooth.h
0 jan@muizenberg:/var/autofs/misc/home/jan$dpkg -S /usr/src/linux-headers-3.2.0-26/include/net/bluetooth/bluetooth.h
linux-headers-3.2.0-26: /usr/src/linux-headers-3.2.0-26/include/net/bluetooth/bluetooth.h

And every ubuntu install should have the top level package ubuntu-desktop (I guess in Carlos' case kubuntu-desktop) which depends on linux-headers-generic.

Regards,
Jan

Dima Pasechnik

unread,
Jul 6, 2012, 10:50:19 AM7/6/12
to sage-s...@googlegroups.com
hmm, why would a desktop need linux-headers? 

Jeroen Demeyer

unread,
Jul 6, 2012, 10:59:37 AM7/6/12
to sage-s...@googlegroups.com
I don't understand. Python checks for the bluetooth headers:

checking bluetooth.h usability... no
checking bluetooth.h presence... no
checking for bluetooth.h... no
checking bluetooth/bluetooth.h usability... no
checking bluetooth/bluetooth.h presence... no
checking for bluetooth/bluetooth.h... no

So it should not attempt to include the bluetooth headers.
Maybe send the file SAGE_ROOT/spkg/build/python-2.7.3.p0/src/config.log

Carlos Baptista

unread,
Jul 6, 2012, 11:00:09 AM7/6/12
to sage-s...@googlegroups.com
I do have bluetooth.h but I did not have the libbluetooth-dev package. I installed it just now and lets hope for the best.

Carlos Baptista

unread,
Jul 6, 2012, 11:03:19 AM7/6/12
to sage-s...@googlegroups.com
Scanning through my old log I found the following:

checking bluetooth.h usability... no
checking bluetooth.h presence... no
checking for bluetooth.h... no
checking bluetooth/bluetooth.h usability... no
checking bluetooth/bluetooth.h presence... no
checking for bluetooth/bluetooth.h... no

But I do have bluetooth.h on my machine...

Jan Groenewald

unread,
Jul 6, 2012, 11:21:25 AM7/6/12
to sage-s...@googlegroups.com
Hi

On 6 July 2012 16:50, Dima Pasechnik <dim...@gmail.com> wrote:
hmm, why would a desktop need linux-headers? 

Compiling restricted drivers.

Regards,
Jan

Dima Pasechnik

unread,
Jul 6, 2012, 11:30:34 AM7/6/12
to sage-s...@googlegroups.com


On Friday, 6 July 2012 23:21:25 UTC+8, Jan Groenewald wrote:
Hi

On 6 July 2012 16:50, Dima Pasechnik <dim...@gmail.com> wrote:
hmm, why would a desktop need linux-headers? 

Compiling restricted drivers.

well, if one doesn't compile anything, as often happens, why headers?

Jan Groenewald

unread,
Jul 6, 2012, 11:37:05 AM7/6/12
to sage-s...@googlegroups.com
Hi

On 6 July 2012 17:30, Dima Pasechnik <dim...@gmail.com> wrote:


On Friday, 6 July 2012 23:21:25 UTC+8, Jan Groenewald wrote:
Hi

On 6 July 2012 16:50, Dima Pasechnik <dim...@gmail.com> wrote:
hmm, why would a desktop need linux-headers? 

Compiling restricted drivers.

well, if one doesn't compile anything, as often happens, why headers?

It is only there for people with hardware that need restricted drivers
via DKMS. Yes, many people don't need it.  Many do. Seems reasonable to me.
It's a union of people's needs not an intersection.

Regards,
Jan

Jan Groenewald

unread,
Jul 11, 2012, 1:45:28 AM7/11/12
to sage-s...@googlegroups.com
Hi

On 5 July 2012 14:16, Jan Groenewald <j...@aims.ac.za> wrote:
I will be updating the PPA, but this could take days or weeks until the binary is fixed.
This bug means that the official sage binary built on 10.04 is NOT supported on 12.04.


The PPA is now updated and no longer exhibits the bug.

Regards,
Jan

Carlos Baptista

unread,
Jul 11, 2012, 8:12:16 AM7/11/12
to sage-s...@googlegroups.com
Thanks a lot Jan. I will try it out when I am at home.

Carlos Baptista

unread,
Jul 12, 2012, 7:46:19 AM7/12/12
to sage-s...@googlegroups.com
Dear Jan,

Yesterday I installed the new Sage update from the PPA (Sage Version 5.1, Release Date: 2012-07-09). My Python code executes now without crashing due to error(s). However the figures that are generated by the end of my code are not shown. It simply takes my commands to produce a plot and does nothing with it. It does not even mention an error of some kind.

I have conceived a small test case which produces the same malfunctioning:

===============================

import numpy as np
import matplotlib.pyplot as plt

a = np.array([0,1,2,3,4,5,6,7,8,9,10])
b = np.array([0,1,4,9,16,25,36,49,64,81,100])

plt.figure()
plt.plot(a,b)
plt.show()

===============================

The above test case should produce the right half of a parabola and it works fine in ipython. However it does not work with Sage nor with Sage's ipython which can be invoked in a terminal through:

sage --ipython

I am however able to produce normal Sage, non-Python plots like:

plot(x^2)

Am I missing a package or do I have to adjust some settings?

Carlos Baptista

unread,
Jul 12, 2012, 8:38:31 AM7/12/12
to sage-s...@googlegroups.com
A google search led me to:


Here they describe how you can get the Matplotlib GUI to work. They however use a Tk backend and as I am on Kubuntu I do not prefer to use Tk/GTK/GTK+ packages. Personally I think that there should be a simpler solution (a.k.a. editing some kind of Sage configuration file).

Jan Groenewald

unread,
Jul 16, 2012, 10:40:30 AM7/16/12
to sage-s...@googlegroups.com
Hi Carlos
I see you already found information on the Matplotlib GUI above.

Just a note that this is not specific to the PPA. I get this behaviour
on the PPA installation and on a from-source compiled sage.
Reply all
Reply to author
Forward
0 new messages