External viewer

451 views
Skip to first unread message

Robert Samal

unread,
Jan 7, 2016, 10:49:44 AM1/7/16
to sage-support
Hi,

during some recent update of my laptop, sage ceased to show pictures from command-line.
That is, for instance:

sage: plot(x^2, [x,0,1])
Yields output
"Launched png viewer for Graphics object consisting of 1 graphics primitive"

Except no png viewer is launched (it used to start external image-viewer).

The png-files are properly created in the appropriate tmp folder.

Also starting pdf viewer works:
sage: view(x^2)
... starts a pdf viewer with x^2 typeset in tex.

I tried to check the viewer and everything seems to be OK:
sage: from sage.misc.viewer import viewer
sage: viewer('pdf')
'xdg-open'
sage: viewer('png')
'xdg-open'

And, when I try xdg-open in a shell (i.e., outside of sage), then it open correctly both png and pdf files.

Any ideas? It starts to be quite annoying (the only workaround I found is to save the plot to a png ...).

My system is ubuntu 15.10,
SageMath Version 6.10, Release Date: 2015-12-18 -- obtained from file
sage-6.10-Ubuntu_15.10-x86_64.tar.bz2.

But it did not work with sage 6.8 and 6.7 either. I'm not sure but I believe it worked with ubuntu 15.04 (and some previous version of sage).

Thanks in advance for any suggestion,

Robert Samal





Volker Braun

unread,
Jan 7, 2016, 11:16:38 AM1/7/16
to sage-support
What happens if you try to launch the viewer in a sage shell? 

sage -sh xdg-open /path/to/image.png

Robert Samal

unread,
Jan 7, 2016, 11:35:00 AM1/7/16
to sage-support

On Thursday, January 7, 2016 at 5:16:38 PM UTC+1, Volker Braun wrote:
What happens if you try to launch the viewer in a sage shell? 

sage -sh xdg-open /path/to/image.png

Good idea, didn't thought of that. I get some informative error messages (see below).
I may try to work it out from here, but if it is a bug that can bite more people than just me (as opposed to a messy installation on my laptop), it's probably worth if somebody knowledgeable could spell out, what is the issue exactly.

Here is the output:

eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9)
eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)





 

Volker Braun

unread,
Jan 7, 2016, 12:38:53 PM1/7/16
to sage-support
Can you tell us more about what eog links to?

$ sage -sh command -v eog
/usr/bin/eog
$ sage -sh ldd /usr/bin/eog     # adjust path as necessary

Also, are you overriding some paths?

$ sage -sh -c env | grep PATH

Robert Samal

unread,
Jan 7, 2016, 1:33:48 PM1/7/16
to sage-support
With pleasure!

PATH's:

samal@kamkoliv:~$ sage -sh -c env | grep PATH
SAGE_ORIG_LD_LIBRARY_PATH_SET=True
LIBRARY_PATH=/home/samal/local/SageMath/local/lib:/usr/lib/x86_64-linux-gnu
SAGE_ORIG_PATH=/home/samal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
LD_LIBRARY_PATH=/home/samal/local/SageMath/local/lib:/home/samal/local/SageMath/local/lib64:/home/samal/local/SageMath/local/lib/R/lib
CPATH=/home/samal/local/SageMath/local/include:/usr/include/x86_64-linux-gnu
DEFAULTS_PATH=/usr/share/gconf/gnome.default.path
PATH=/home/samal/local/SageMath/build/bin:/home/samal/local/SageMath/src/bin:/home/samal/local/SageMath/local/bin:/home/samal/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
MANDATORY_PATH=/usr/share/gconf/gnome.mandatory.path
SAGE_ORIG_PATH_SET=True
PYTHONPATH=/home/samal/local/SageMath/local/lib/python:/home/samal/local/SageMath/local/lib/python/site_packages
SAGE_ORIG_LD_LIBRARY_PATH=
WINDOWPATH=2
SINGULARPATH=/home/samal/local/SageMath/local/share/singular
GIT_EXEC_PATH=/home/samal/local/SageMath/local/libexec/git-core

linking:

samal@kamkoliv:~$ sage -sh ldd /usr/bin/eog
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirclient.so.9)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmircommon.so.5)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9)
/usr/bin/eog: /home/samal/local/SageMath/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0)
    linux-vdso.so.1 =>  (0x00007ffe63d40000)
    libeog.so => /usr/lib/eog/libeog.so (0x00007f628d7f8000)
    libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f628cf08000)
    libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f628cb87000)
    libgirepository-1.0.so.1 => /usr/lib/x86_64-linux-gnu/libgirepository-1.0.so.1 (0x00007f628c953000)
    libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f628c700000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f628c3f1000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f628c1d3000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f628be09000)
    libgnome-desktop-3.so.10 => /usr/lib/x86_64-linux-gnu/libgnome-desktop-3.so.10 (0x00007f628bbce000)
    libpeas-gtk-1.0.so.0 => /usr/lib64/libpeas-gtk-1.0.so.0 (0x00007f628b9c0000)
    libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007f628b6ec000)
    libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f628b4c7000)
    libpeas-1.0.so.0 => /usr/lib64/libpeas-1.0.so.0 (0x00007f628b2b2000)
    libexif.so.12 => /usr/lib/x86_64-linux-gnu/libexif.so.12 (0x00007f628b06e000)
    liblcms2.so.2 => /usr/lib/x86_64-linux-gnu/liblcms2.so.2 (0x00007f628ae17000)
    libexempi.so.3 => /usr/lib/x86_64-linux-gnu/libexempi.so.3 (0x00007f628aadc000)
    librsvg-2.so.2 => /usr/lib/x86_64-linux-gnu/librsvg-2.so.2 (0x00007f628a8a6000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f628a684000)
    libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f628a371000)
    libjpeg.so.8 => /usr/lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f628a11c000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6289e14000)
    libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f6289ada000)
    libz.so.1 => /home/samal/local/SageMath/local/lib/libz.so.1 (0x00007f62898c0000)
    libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f62896bc000)
    libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f62894af000)
    libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f628929f000)
    libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f6289099000)
    libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f6288e90000)
    libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f6288c61000)
    libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007f628897b000)
    libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f6288765000)
    libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f6288517000)
    libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f62882d9000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f62880b5000)
    libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f6287e99000)
    libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f6287c91000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6287a24000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f628da6e000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f628781c000)
    libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f6287619000)
    libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f628740e000)
    libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f6287204000)
    libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f6287001000)
    libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f6286dfe000)
    libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f6286bbf000)
    libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007f62869b7000)
    libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f62867b5000)
    libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007f62865a7000)
    libmirclient.so.9 => /usr/lib/x86_64-linux-gnu/libmirclient.so.9 (0x00007f6286322000)
    libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f6286110000)
    libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f6285ee7000)
    libstdc++.so.6 => /home/samal/local/SageMath/local/lib64/libstdc++.so.6 (0x00007f6285bdd000)
    libgcc_s.so.1 => /home/samal/local/SageMath/local/lib64/libgcc_s.so.1 (0x00007f62859c7000)
    libcroco-0.6.so.3 => /usr/lib/x86_64-linux-gnu/libcroco-0.6.so.3 (0x00007f628578c000)
    libxml2.so.2 => /usr/lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f62853d4000)
    libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f6285127000)
    libfreetype.so.6 => /home/samal/local/SageMath/local/lib/libfreetype.so.6 (0x00007f6284e90000)
    libpng12.so.0 => /home/samal/local/SageMath/local/lib/libpng12.so.0 (0x00007f6284c6b000)
    libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f6284a67000)
    libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f628485d000)
    libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f628463c000)
    libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f6284432000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f628422e000)
    libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f6283ffd000)
    libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f6283db1000)
    libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f6283b53000)
    libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f628394a000)
    libmircommon.so.5 => /usr/lib/x86_64-linux-gnu/libmircommon.so.5 (0x00007f628370c000)
    libmirprotobuf.so.3 => /usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3 (0x00007f62834b1000)
    libboost_system.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0 (0x00007f62832ad000)
    libprotobuf-lite.so.9 => /usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9 (0x00007f628307c000)
    libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f6282ce8000)
    libbz2.so.1 => /home/samal/local/SageMath/local/lib/libbz2.so.1 (0x00007f6282ad8000)
    libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f62828d4000)
    libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f62826ce000)
    libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f628dbca000)
    libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f62824b2000)
    libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f62822ab000)
    libboost_filesystem.so.1.58.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0 (0x00007f6282093000)
    libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f62805dc000)
    liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f62803ba000)
    libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f62800d8000)
    libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f627fec5000)

Robert Samal

unread,
Jan 7, 2016, 1:43:24 PM1/7/16
to sage-support
Well, perhaps I've found a solution.
When comparing the above output with
$ldd /usr/bin/eog
(that is, with what is eog linked in the system), it turns out it uses

/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21

whereas in sage it uses

/home/samal/local/SageMath/local/lib64/libstdc++.so.6.0.20

that is, an older version. Not sure, what the difference is, but when I put the newer version of the library
(by
$cd SageMath/local/lib64
$rm libstdc++.so.6
$ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 libstdc++.so.6
)
it resolves the problem!

Thanks a lot for your help! I believe the eog and most of my system is standard ubuntu 15.10, so it may be possible that this is happening to quite a few other people ... not sure how to test this though.

Volker Braun

unread,
Jan 7, 2016, 1:44:38 PM1/7/16
to sage-support
Oh yes, this is Sage-6.10. Your system libstdc++.so is incompatible with the one from gcc bundled in Sage. Starting with Sage-7 we don't use LD_LIBRARY_PATH any more, this will solve your problem.
Reply all
Reply to author
Forward
0 new messages