Opened 2 years ago

Closed 11 months ago

#25026 closed defect (fixed)

Update jmol to version 14.29.52

Reported by: embray Owned by:
Priority: blocker Milestone: sage-8.9
Component: packages: standard Keywords: sdl
Cc: fbissey, paulmasson, dimpase, egourgoulhon, jipilab, thansen Merged in:
Authors: Thierry Monteil Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: 25b056c (Commits) Commit: 25b056c24c9d485de71f59ef00c0b1ef4ba9329a
Dependencies: Stopgaps:

Description (last modified by tmonteil)

The current version of Jmol in Sage is broken on newer JRE versions. In particular it relies on a sun.audio package that apparently, has been removed from newer versions of Java. This causes Jmol to crash at startup.

The newest version fixes that issue, and presumably others.

Tarball: https://lipn.univ-paris13.fr/~monteil/hebergement/sage/tmp/jmol-14.29.52.tar.bz2

Attachments (2)

jmol-14.29.10.tar.bz2 (37.2 MB) - added by embray 2 years ago.
jmol-14.29.52.log (5.4 KB) - added by charpent 11 months ago.
(Attempt to) install the new jmol version.

Change History (71)

comment:1 Changed 2 years ago by embray

  • Authors set to Erik Bray
  • Branch set to u/embray/pkgs/jmol/update
  • Commit set to 76c89966de67866106faaf7901e9f216670b528d

New commits:

330e618Introduce SAGE_DESTDIR_LOCAL variable
9d14972Don't install gcc as part of gfortran
d525312Slight reworking of spkg-install for jmol to support DESTDIR installs and to use sage-dist-helpers where appropriate
880330fInstead of patching the 'jmol' script we just provide our own, simpler script specifically for use in Sage
76c8996upgraded jmol to 14.29.10

comment:2 Changed 2 years ago by embray

  • Dependencies set to #25025

Any suggestions for where I could dump the upstream tarball? I don't feel like hosting it on my personal dropbox, for example.

comment:3 Changed 2 years ago by fbissey

  • Cc fbissey added

comment:4 Changed 2 years ago by embray

Also if anyone really familiar with Jmol wants to test this, that would be good.

comment:5 Changed 2 years ago by fbissey

To be honest if the doc builds properly and the pictures for 3D plots are OK and it passes doctests, I don't think it needs more testing apart may be trying sphere() on the command line to see that everything is fine.

The doc build process and the doctesting stress jmol quite a bit already.

comment:6 Changed 2 years ago by tscrim

If you still need a place to host the tarball, send it to me in an e-mail and I will use my Google Drive.

comment:7 Changed 2 years ago by embray

I'm tempted to re-up the attachment limit on Trac again to allow it, since really it's not a big deal...

Changed 2 years ago by embray

comment:8 Changed 2 years ago by embray

  • Description modified (diff)
  • Status changed from new to needs_review

comment:9 Changed 2 years ago by embray

  • Description modified (diff)

comment:10 Changed 2 years ago by embray

We also need to fix the is_jvm_available() method to accept newer versions of Java...

comment:11 Changed 2 years ago by embray

A new error I'm getting even with the new jmol on Java 10:

sage: G=sphere((0,0,0),1)
sage: show(G,figsize=(5,5),title="Sample Figure",aspect_ratio=1);
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-2-32a6d0745925> in <module>()
----> 1 show(G,figsize=(Integer(5),Integer(5)),title="Sample Figure",aspect_ratio=Integer(1));

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/repl/rich_output/pretty_print.pyc in show(*args, **kwds)
    256         args[0].show()
    257         return
--> 258     pretty_print(*args, **kwds)

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/repl/rich_output/pretty_print.pyc in pretty_print(*args, **kwds)
    227             pass
    228         elif len(args) == 1:
--> 229             dm.display_immediately(*args, **kwds)
    230         else:
    231             SequencePrettyPrinter(*args, **kwds).pretty_print()

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in display_immediately(self, obj, **rich_repr_kwds)
    831             1/2
    832         """
--> 833         plain_text, rich_output = self._rich_output_formatter(obj, rich_repr_kwds)
    834         self._backend.display_immediately(plain_text, rich_output)
    835

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in _rich_output_formatter(self, obj, rich_repr_kwds)
    621         has_rich_repr = isinstance(obj, SageObject) and hasattr(obj, '_rich_repr_')
    622         if has_rich_repr:
--> 623             rich_output = self._call_rich_repr(obj, rich_repr_kwds)
    624         if isinstance(rich_output, OutputPlainText):
    625             plain_text = rich_output

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in _call_rich_repr(self, obj, rich_repr_kwds)
    579         if rich_repr_kwds:
    580             # do not ignore errors from invalid options
--> 581             return obj._rich_repr_(self, **rich_repr_kwds)
    582         try:
    583             return obj._rich_repr_(self)

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/plot/plot3d/base.pyx in sage.plot.plot3d.base.Graphics3d._rich_repr_ (build/cythonized/sage/plot/plot3d/base.c:5362)()
    146         ### Second, return the corresponding graphics file
    147         if viewer == 'jmol':
--> 148             return self._rich_repr_jmol(**opts)
    149         elif viewer == 'tachyon':
    150             preferred = (

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/plot/plot3d/base.pyx in sage.plot.plot3d.base.Graphics3d._rich_repr_jmol (build/cythonized/sage/plot/plot3d/base.c:7806)()
    271                                             stderr=STDOUT).rstrip()
    272             script = '''set defaultdirectory "{0}"\nscript SCRIPT\n'''.format(scene_native)
--> 273             jdata.export_image(targetfile=preview_png, datafile=script,
    274                                image_type="PNG",
    275                                figsize=opts['figsize'][0])

/home/embray/src/sagemath/sage/local/lib/python2.7/site-packages/sage/interfaces/jmoldata.pyc in export_image(self, targetfile, datafile, datafile_cmd, image_type, figsize, **kwds)
    181                 stdout=jout, stderr=jout, env=env)
    182         if not os.path.isfile(targetfile):
--> 183             raise RuntimeError("Jmol failed to create file %s, see %s for details"%(repr(targetfile), repr(scratchout)))
    184         os.unlink(scratchout)

RuntimeError: Jmol failed to create file '/home/embray/.sage/temp/NAVI-Brick/22388/dir_Zegm4i/preview.png', see '/home/embray/.sage/temp/NAVI-Brick/22388/tmp_UtrFaz.txt' for details
sage: cat '/home/embray/.sage/temp/NAVI-Brick/22388/tmp_UtrFaz.txt'
vwr handling error condition: java.lang.NoClassDefFoundError: org/apache/tools/bzip2/CBZip2InputStream
java.lang.NoClassDefFoundError: org/apache/tools/bzip2/CBZip2InputStream
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at org.jmol.api.Interface.getInterface(Interface.java:49)
        at org.jmol.viewer.Viewer.getJzt(Viewer.java:9600)
        at org.jmol.viewer.FileManager.getUnzippedReaderOrStreamFromName(FileManager.java:693)
        at org.jmol.viewer.FileManager.getBufferedReaderOrErrorMessageFromName(FileManager.java:610)
        at org.jmol.viewer.FileManager.getFileDataAsString(FileManager.java:812)
        at org.jmol.script.ScriptEval.compileScriptFileInternal(ScriptEval.java:965)
        at org.jmol.script.ScriptEval.cmdScript(ScriptEval.java:6533)
        at org.jmol.script.ScriptEval.processCommand(ScriptEval.java:2456)
        at org.jmol.script.ScriptEval.commandLoop(ScriptEval.java:2264)
        at org.jmol.script.ScriptEval.dispatchCommands(ScriptEval.java:2127)
        at org.jmol.script.ScriptEval.executeCommands(ScriptEval.java:417)
        at org.jmol.script.ScriptEval.evaluateCompiledScript(ScriptEval.java:403)
        at org.jmol.script.ScriptManager.evalStringWaitStatusQueued(ScriptManager.java:362)
        at org.jmol.viewer.Viewer.evalStringWaitStatusQueued(Viewer.java:3921)
        at org.jmol.viewer.Viewer.evalWait(Viewer.java:3900)
        at org.jmol.viewer.Viewer.scriptWaitStatus(Viewer.java:3891)
        at org.openscience.jmol.app.JmolApp.runScript(JmolApp.java:578)
        at org.openscience.jmol.app.JmolApp.startViewer(JmolApp.java:528)
        at org.openscience.jmol.app.JmolData.<init>(JmolData.java:85)
        at org.openscience.jmol.app.JmolData.main(JmolData.java:77)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.bzip2.CBZip2InputStream
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 22 more
script ERROR: java.lang.NoClassDefFoundError: org/apache/tools/bzip2/CBZip2InputStream
ImageEncoder width height 500 500

I'm starting to think perhaps jmol is just not well tested yet against the latest JRE and it's best to downgrade. Let me see if I can't find a workaround though...

comment:12 Changed 2 years ago by embray

Okay, part of the problem just has to do with handing spaces in filenames, and is not related to the Java version or the Jmol version. But the NoClassDefFoundError went away when I downgraded my Java and downgraded Jmol to the previous version :(

comment:13 Changed 2 years ago by saraedum

  • Status changed from needs_review to needs_work

I might have misunderstood the discussion on this ticket, but it seems that this needs work still?

comment:14 follow-up: Changed 2 years ago by charpent

Definitely needs_work I tried it as suggested here, and got a broken jsmol.

Last edited 2 years ago by charpent (previous) (diff)

comment:15 in reply to: ↑ 14 ; follow-up: Changed 2 years ago by charpent

Replying to charpent:

Definitely neds_work I tried it as suggested here, and got a broken jsmol.

It's more complicated that that. I happen to follow Debian testing quite closely, and I have presently the following JVM/JDK combos available :

root@asus16-ec:~# update-java-alternatives --list
java-1.8.0-openjdk-amd64       1081       /usr/lib/jvm/java-1.8.0-openjdk-amd64
java-1.9.0-openjdk-amd64       1091       /usr/lib/jvm/java-1.9.0-openjdk-amd64
java-gcj-4.8                              /usr/lib/jvm/java-gcj-4.8
java-gcj-4.9                              /usr/lib/jvm/java-gcj-4.9

When I do update-java-alternatives --set java-1.9.0-openjdk-amd64, I get the reported problem (i. e. no suitable java...). When I switch to update-java-alternatives --set java-1.9.0-openjdk-amd64 during the very same Sage session, java (and jmol) work(s).

Tentative conclusion : Java 9 is broken at least when packaged by Debian...

comment:16 in reply to: ↑ 15 Changed 2 years ago by charpent

Replying to charpent:

Tentative conclusion : Java 9 is broken at least when packaged by Debian...

One more data point in the same direction : the new jmol viewer (installed by the present ticket) works when one uses Java 8 (in my case, java-1.8.0-openjdk-amd64).

So I'll rephrase my tentative conclusion as "Java 9 is broken WRT our new jmol engine, at least when packaged by Debian".

I have reported this as Debian Bug 894570.

It could be interesting to know if some user of the Debian Sage package has hit this bug when following testing.

Last edited 2 years ago by slelievre (previous) (diff)

comment:17 Changed 2 years ago by embray

I have a fix to the "no suitable Java" issue I just haven't pushed yet. It doesn't work with JRE > 1.8 currently. It's just a stupid version string check.

However, even with that fixed I'm having problems with Jmol working, like, at all (even with this newest version, or on older Javas). That's just on Windows though, I haven't tested on other platforms yet...

Last edited 2 years ago by embray (previous) (diff)

comment:18 Changed 2 years ago by embray

  • Milestone changed from sage-8.2 to sage-8.3

comment:19 Changed 2 years ago by egourgoulhon

comment:20 Changed 2 years ago by embray

  • Milestone changed from sage-8.3 to sage-8.4

I believe this issue can reasonably be addressed for Sage 8.4.

comment:21 Changed 22 months ago by embray

  • Milestone changed from sage-8.4 to sage-8.5

comment:22 Changed 20 months ago by embray

  • Milestone changed from sage-8.5 to sage-8.7

Retargeting some of my tickets (somewhat optimistically for now).

comment:23 Changed 19 months ago by slelievre

Jmol 14.29.29 was released on 2018-11-30.

comment:24 Changed 17 months ago by embray

  • Milestone changed from sage-8.7 to sage-8.8

Moving all my in-progress tickets to 8.8 milestone.

comment:25 Changed 14 months ago by embray

  • Milestone changed from sage-8.8 to sage-8.9

Tickets still needing working or clarification should be moved to the next release milestone at the soonest (please feel free to revert if you think the ticket is close to being resolved).

comment:26 Changed 11 months ago by tmonteil

  • Branch changed from u/embray/pkgs/jmol/update to u/tmonteil/pkgs/jmol/update

comment:27 Changed 11 months ago by tmonteil

  • Authors changed from Erik Bray to Thierry Monteil
  • Commit changed from 76c89966de67866106faaf7901e9f216670b528d to 36d801f063e68f69f582cd5d8c625e44cc543262
  • Dependencies #25025 deleted
  • Description modified (diff)
  • Priority changed from major to blocker
  • Status changed from needs_work to needs_review
  • Summary changed from Update jmol to version 14.29.10 to Update jmol to version 14.29.52

Let me set this to blocker because currently jmol is broken from Debian buster on, hence probably on recent Ubuntus as well.


New commits:

88c719c#25026 : automatic construction of the jmol tarball
03128f9#25026 : jmol new package version and checksums
dbb16ef#25026 : fix and simplify jmol spkg-install
36d801f#25026 : upstream jmol contact changed

comment:28 Changed 11 months ago by tmonteil

  • Keywords sdl added

comment:29 follow-ups: Changed 11 months ago by charpent

Ahem...

Downloaded the tarball in upstream, make worked like a charm, but :

sage: plot3d(lambda x,y:x^2+y^2, (-2,2), (-2, 2), opacity=0.5).show()
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-4-3105a34b9ca4> in <module>()
----> 1 plot3d(lambda x,y:x**Integer(2)+y**Integer(2), (-Integer(2),Integer(2)), (-Integer(2), Integer(2)), opacity=RealNumber('0.5')).show()

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/plot/plot3d/base.pyx in sage.plot.plot3d.base.Graphics3d.show (build/cythonized/sage/plot/plot3d/base.c:20365)()
   1494         from sage.repl.rich_output import get_display_manager
   1495         dm = get_display_manager()
-> 1496         dm.display_immediately(self, **kwds)
   1497 
   1498     def _save_image_png(self, filename, **kwds):

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py in display_immediately(self, obj, **rich_repr_kwds)
    836         """
    837         plain_text, rich_output = self._rich_output_formatter(obj, rich_repr_kwds)
--> 838         self._backend.display_immediately(plain_text, rich_output)
    839 
    840 

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/backend_ipython.py in display_immediately(self, plain_text, rich_output)
    302             Example plain text output
    303         """
--> 304         formatdata, metadata = self.displayhook(plain_text, rich_output)
    305         print(formatdata[u'text/plain'])
    306 

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/backend_ipython.py in displayhook(self, plain_text, rich_output)
    265             return ({u'text/plain': msg}, {})
    266         elif isinstance(rich_output, OutputSceneJmol):
--> 267             msg = self.launch_jmol(rich_output, plain_text.text.get_unicode())
    268             return ({u'text/plain': msg}, {})
    269         elif isinstance(rich_output, OutputSceneWavefront):

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/backend_ipython.py in launch_jmol(self, output_jmol, plain_text)
    368         jdata = JmolData()
    369         if not jdata.is_jvm_available() and not DOCTEST_MODE:
--> 370             raise RuntimeError('jmol cannot run, no suitable java version found')
    371         launch_script = output_jmol.launch_script_filename()
    372         jmol_cmd = 'jmol'

RuntimeError: jmol cannot run, no suitable java version found
sage: 

BTW, I may have hosed my Java installation. On Debian testing,; I have :

root@zen-book-flip:~# update-java-alternatives --list
java-1.10.0-openjdk-amd64      1101       /usr/lib/jvm/java-1.10.0-openjdk-amd64
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64
root@zen-book-flip:~# 
root@zen-book-flip:~# update-java-alternatives --set java-1.11.0-openjdk-amd64
update-alternatives: erreur: pas d'alternatives pour mozilla-javaplugin.so
Last edited 11 months ago by charpent (previous) (diff)

Changed 11 months ago by charpent

(Attempt to) install the new jmol version.

comment:30 in reply to: ↑ 29 Changed 11 months ago by charpent

  • Status changed from needs_review to needs_work

Replying to charpent:

[ Snip... ]

BTW, I may have hosed my Java installation. On Debian testing,; I have :

root@zen-book-flip:~# update-java-alternatives --list
java-1.10.0-openjdk-amd64      1101       /usr/lib/jvm/java-1.10.0-openjdk-amd64
java-1.11.0-openjdk-amd64      1111       /usr/lib/jvm/java-1.11.0-openjdk-amd64
root@zen-book-flip:~# 
root@zen-book-flip:~# update-java-alternatives --set java-1.11.0-openjdk-amd64
update-alternatives: erreur: pas d'alternatives pour mozilla-javaplugin.so

No other part of my system seems perturbed : LibreOffice? , notoriously Java-greedy, works as advertized.

However, starting from my $SAGE_ROOT:

charpent@zen-book-flip:/usr/local/sage-P3-2$ sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/usr/local/sage-P3-2
(sage-sh) charpent@zen-book-flip:sage-P3-2$ /usr/local/sage-P3-2/local/bin/jmol/jmol
Jmol.jar not found in /usr/local/sage-P3-2/local/share/jmol
Error: Unable to access jarfile /usr/local/sage-P3-2/local/share/jmol/Jmol.jar
(sage-sh) charpent@zen-book-flip:sage-P3-2$ ls /usr/local/sage-P3-2/local/share/jmol/
appletweb  src
(sage-sh) charpent@zen-book-flip:sage-P3-2$ exit
exit
Exited Sage subshell.
charpent@zen-book-flip:/usr/local/sage-P3-2$ 

The installation procedure may miss something, it seems... I have uploaded the installation log (resulting from sage -f jmol).

==> needs_work.

Last edited 11 months ago by charpent (previous) (diff)

comment:31 Changed 11 months ago by git

  • Commit changed from 36d801f063e68f69f582cd5d8c625e44cc543262 to 8a380648f690c15a2763487378124fcafc1e42be

Branch pushed to git repo; I updated commit sha1. New commits:

8a38064#25026 : fix typos in spkg-install

comment:32 in reply to: ↑ 29 ; follow-up: Changed 11 months ago by tmonteil

OK, i was too fast, here is a corrected spkg-install script.

Since you used the wrong spkg-install, you may have to do the following cleanup before retrying:

rm -rf /usr/local/sage-P3-2/local/bin/jmol

Replying to charpent:

RuntimeError?: jmol cannot run, no suitable java version found

You should install the default-jre package.

comment:33 Changed 11 months ago by tmonteil

  • Status changed from needs_work to needs_review

comment:34 in reply to: ↑ 32 Changed 11 months ago by charpent

Replying to tmonteil:

OK, i was too fast, here is a corrected spkg-install script.

Since you used the wrong spkg-install, you may have to do the following cleanup before retrying:

rm -rf /usr/local/sage-P3-2/local/bin/jmol

Been there, done that, didn't even hot the tee-shirt:

sage: implicit_plot3d(lambda x,y,z:x^2+y^2+z^2-1, (-1,1), (-1,1), (-1,1))
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-37831fbba399> in <module>()
----> 1 implicit_plot3d(lambda x,y,z:x**Integer(2)+y**Integer(2)+z**Integer(2)-Integer(1), (-Integer(1),Integer(1)), (-Integer(1),Integer(1)), (-Integer(1),Integer(1)))

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/IPython/core/displayhook.py in __call__(self, result)
    244             self.start_displayhook()
    245             self.write_output_prompt()
--> 246             format_dict, md_dict = self.compute_format_data(result)
    247             self.update_user_ns(result)
    248             self.fill_exec_result(result)

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/IPython/core/displayhook.py in compute_format_data(self, result)
    148 
    149         """
--> 150         return self.shell.display_formatter.format(result)
    151 
    152     # This can be set to True by the write_output_prompt method in a subclass

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/display/formatter.py in format(self, obj, include, exclude)
    198         """
    199         # First, use Sage rich output if there is any
--> 200         sage_format, sage_metadata = self.dm.displayhook(obj)
    201         assert PLAIN_TEXT in sage_format, 'plain text is always present'
    202         if not set(sage_format.keys()).issubset(self.default_mime()):

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/display_manager.py in displayhook(self, obj)
    810         self._backend.set_underscore_variable(obj)
    811         plain_text, rich_output = self._rich_output_formatter(obj, dict())
--> 812         return self._backend.displayhook(plain_text, rich_output)
    813 
    814     def display_immediately(self, obj, **rich_repr_kwds):

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/backend_ipython.py in displayhook(self, plain_text, rich_output)
    265             return ({u'text/plain': msg}, {})
    266         elif isinstance(rich_output, OutputSceneJmol):
--> 267             msg = self.launch_jmol(rich_output, plain_text.text.get_unicode())
    268             return ({u'text/plain': msg}, {})
    269         elif isinstance(rich_output, OutputSceneWavefront):

/usr/local/sage-P3-2/local/lib/python3.7/site-packages/sage/repl/rich_output/backend_ipython.py in launch_jmol(self, output_jmol, plain_text)
    368         jdata = JmolData()
    369         if not jdata.is_jvm_available() and not DOCTEST_MODE:
--> 370             raise RuntimeError('jmol cannot run, no suitable java version found')
    371         launch_script = output_jmol.launch_script_filename()
    372         jmol_cmd = 'jmol'

RuntimeError: jmol cannot run, no suitable java version found

However, jmol can be successfully invoked from the sage shell (but not from the system prompt, which is normal, as far as I understand this):

charpent@zen-book-flip:/usr/local/sage-P3-2$ local/bin/jmol 
Jmol.jar not found in /jmol
Error: Unable to access jarfile /jmol/Jmol.jar
charpent@zen-book-flip:/usr/local/sage-P3-2$ sage -sh

Starting subshell with Sage environment variables set.  Don't forget
to exit when you are done.  Beware:
 * Do not do anything with other copies of Sage on your system.
 * Do not use this for installing Sage packages using "sage -i" or for
   running "make" at Sage's root directory.  These should be done
   outside the Sage shell.

Bypassing shell configuration files...

Note: SAGE_ROOT=/usr/local/sage-P3-2
(sage-sh) charpent@zen-book-flip:sage-P3-2$ local/bin/jmol 
426 translations loaded
548 translations loaded
splash_image=jar:file:/usr/local/sage-P3-2/local/share/jmol/Jmol.jar!/org/openscience/jmol/app/images/Jmol_splash.jpg
history file is /home/charpent/.jmol/history
user properties file is /home/charpent/.jmol/properties
(C) 2015 Jmol Development
Jmol Version: 14.29.52  2019-08-18 15:32
java.vendor: Java: Debian
java.version: Java 11.0.5-ea
os.name: Linux
Access: ALL
memory: 17.3/262.1
processors available: 8
useCommandThread: false
User macros dir: /home/charpent/.jmol/macros
       exists: false
  isDirectory: false

## NOTE : a jmol window opened (solid black content, but menus, icons, etc... present).

(sage-sh) charpent@zen-book-flip:sage-P3-2$ exit
exit
Exited Sage subshell.
charpent@zen-book-flip:/usr/local/sage-P3-2$ local/bin/jmol 
Jmol.jar not found in /jmol
Error: Unable to access jarfile /jmol/Jmol.jar
charpent@zen-book-flip:/usr/local/sage-P3-2$ 

Back to the old drawing board, I guess...

==> needs_work

Replying to charpent:

RuntimeError?: jmol cannot run, no suitable java version found

You should install the default-jre package.

Was present from the start (as well as default-jdk, BTW). Again,LibreOffice? finds both java 10 and java 11 in their normal Debian-designated directories...

comment:35 follow-ups: Changed 11 months ago by tmonteil

OK, maybe there is a Python 3 thing going on, i am using Python 2, let me recompile everything for Python 3 so that i can reproduce your error.

Regarding local/bin/jmol not working from a standard shell, it is normal since the script relies on variables such as SAGE_SHARE that are not defined.

Are you saying that, when local/bin/jmol is run from the Sage shell (sage -sh), you do not see the menu ?

comment:36 in reply to: ↑ 35 Changed 11 months ago by charpent

Replying to tmonteil:

OK, maybe there is a Python 3 thing going on, i am using Python 2, let me recompile everything for Python 3 so that i can reproduce your error.

Regarding local/bin/jmol not working from a standard shell, it is normal since the script relies on variables such as SAGE_SHARE that are not defined.

We agreee

Are you saying that, when local/bin/jmol is run from the Sage shell (sage -sh), you do not see the menu ?

I DO se the menu and icons.The only unexpected thing is the black image...

comment:37 in reply to: ↑ 35 ; follow-up: Changed 11 months ago by tmonteil

Replying to tmonteil:

OK, maybe there is a Python 3 thing going on, i am using Python 2, let me recompile everything for Python 3 so that i can reproduce your error.

Works well on Python 3 as well, so i can not reproduce your issue.

Could you try to bypass the is_jvm_available() test and see if you get something ?

Could you tell more about your configuration so that i try to simulate it in a VM ?

Could someone else test the branch as well ?

comment:38 Changed 11 months ago by tmonteil

  • Cc paulmasson dimpase egourgoulhon jipilab thansen added

comment:39 in reply to: ↑ 37 ; follow-up: Changed 11 months ago by charpent

Replying to tmonteil:

Replying to tmonteil:

OK, maybe there is a Python 3 thing going on, i am using Python 2, let me recompile everything for Python 3 so that i can reproduce your error.

Works well on Python 3 as well, so i can not reproduce your issue.

Could you try to bypass the is_jvm_available() test and see if you get something ?

I do get a jmol display behaving as expected.

Could you tell more about your configuration so that i try to simulate it in a VM ?

What do you want to know ? (I'm notoriously bad at tea leaves reading, and I'm still running H. sapiens sapiens L. v1.0, without mind-reading interface nor divinatory coprocessor...).

Could someone else test the branch as well ?

That is a necessity ! Given past history, I'd recommend a test on as many Macintoshes as possible... and on embray's port to Cygwin.

comment:40 in reply to: ↑ 39 ; follow-up: Changed 11 months ago by tmonteil

Replying to charpent:

Replying to tmonteil:

Replying to tmonteil:

OK, maybe there is a Python 3 thing going on, i am using Python 2, let me recompile everything for Python 3 so that i can reproduce your error.

Works well on Python 3 as well, so i can not reproduce your issue.

Could you try to bypass the is_jvm_available() test and see if you get something ?

I do get a jmol display behaving as expected.

OK, great, so the issue is very narrowed now.

What is the output of

java -version

in a terminal ?

Could you tell more about your configuration so that i try to simulate it in a VM ?

What do you want to know ? (I'm notoriously bad at tea leaves reading, and I'm still running H. sapiens sapiens L. v1.0, without mind-reading interface nor divinatory coprocessor...).

I was thinking on which distro/release/arch, java packages, and options passed to compile Sage, but given the previous answer, i think we do not need that anymore.

Could someone else test the branch as well ?

That is a necessity ! Given past history, I'd recommend a test on as many Macintoshes as possible... and on embray's port to Cygwin.

comment:41 in reply to: ↑ 40 ; follow-up: Changed 11 months ago by charpent

Replying to tmonteil:

[ Snip... ]

What is the output of

java -version
charpent@zen-book-flip:/usr/local/sage-P3-2$ java -version
openjdk version "11.0.5-ea" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-ea+6-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.5-ea+6-post-Debian-2, mixed mode, sharing)

in a terminal ?

Could you tell more about your configuration so that i try to simulate it in a VM ?

What do you want to know ? (I'm notoriously bad at tea leaves reading, and I'm still running H. sapiens sapiens L. v1.0, without mind-reading interface nor divinatory coprocessor...).

I was thinking on which distro/release/arch, java packages, and options passed to compile Sage, but given the previous answer, i think we do not need that anymore.

Debian testing (religiously updated) ; java packages:

charpent@zen-book-flip:/usr/local/sage-P3-2$ dpkg -l "*openjdk*" | grep ii
ii  openjdk-10-jdk:amd64          10.0.2+13-2  amd64        OpenJDK Development Kit (JDK)
ii  openjdk-10-jdk-headless:amd64 10.0.2+13-2  amd64        OpenJDK Development Kit (JDK) (headless)
ii  openjdk-10-jre:amd64          10.0.2+13-2  amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-10-jre-headless:amd64 10.0.2+13-2  amd64        OpenJDK Java runtime, using Hotspot JIT (headless)
ii  openjdk-11-jdk:amd64          11.0.5+6-2   amd64        OpenJDK Development Kit (JDK)
ii  openjdk-11-jdk-headless:amd64 11.0.5+6-2   amd64        OpenJDK Development Kit (JDK) (headless)
ii  openjdk-11-jre:amd64          11.0.5+6-2   amd64        OpenJDK Java runtime, using Hotspot JIT
ii  openjdk-11-jre-headless:amd64 11.0.5+6-2   amd64        OpenJDK Java runtime, using Hotspot JIT (headless)

Sage's compilation by make, after configuring for Python 3 (once). A couple releases ago, I started to report the results I get from ptestalllong in sage-release.

[ Snip again... ]

Last edited 11 months ago by charpent (previous) (diff)

comment:42 follow-up: Changed 11 months ago by dimpase

jmol (or perhaps java in general?) is pathetically ill-designed to deal with it being launched in a slightly non-standard windowing enviroment (here it's xmonad on Gentoo). It just won't go away and die after doing Help/About Jmol in its menu.

Also, the mouse pointer is off by a position while using jmol's menu, it does not point to the item one wants to click, but much lower, around the next item (I guess it depends on screen resolution etc)

$ java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (IcedTea 3.13.0) (Gentoo icedtea-3.13.0)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Last edited 11 months ago by dimpase (previous) (diff)

comment:43 Changed 11 months ago by dimpase

this appears to work on my Gentoo box. I'll test more on OSX and some other Linux...

comment:44 in reply to: ↑ 41 ; follow-up: Changed 11 months ago by tmonteil

  • Cc arojas added

Replying to charpent:

Replying to tmonteil:

[ Snip... ]

What is the output of

java -version
charpent@zen-book-flip:/usr/local/sage-P3-2$ java -version
openjdk version "11.0.5-ea" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-ea+6-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.5-ea+6-post-Debian-2, mixed mode, sharing)

Very weird, it should be accepted by the test. Within a Sage command-line, what is the output of:

sage: from sage.cpython.string import bytes_to_str
sage: import subprocess, re
sage: version = bytes_to_str(subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT))
sage: version

Followed by:

sage: java_version = re.search(r'version.*([1][.][789]|"[\d.]+")', version)
sage: bool(java_version)

Replying to dimpase:

this appears to work on my Gentoo box. I'll test more on OSX and some other Linux...

Great.

comment:45 in reply to: ↑ 42 ; follow-up: Changed 11 months ago by tmonteil

Replying to dimpase:

jmol (or perhaps java in general?) is pathetically ill-designed to deal with it being launched in a slightly non-standard windowing enviroment (here it's xmonad on Gentoo). It just won't go away and die after doing Help/About Jmol in its menu.

Also, the mouse pointer is off by a position while using jmol's menu, it does not point to the item one wants to click, but much lower, around the next item (I guess it depends on screen resolution etc)

OK, is the situation worse than before ?

comment:46 in reply to: ↑ 45 Changed 11 months ago by dimpase

Replying to tmonteil:

Replying to dimpase:

jmol (or perhaps java in general?) is pathetically ill-designed to deal with it being launched in a slightly non-standard windowing enviroment (here it's xmonad on Gentoo). It just won't go away and die after doing Help/About Jmol in its menu.

Also, the mouse pointer is off by a position while using jmol's menu, it does not point to the item one wants to click, but much lower, around the next item (I guess it depends on screen resolution etc)

OK, is the situation worse than before ?

not really, sorry for noise. So far no reason not go forward withg this.

comment:47 in reply to: ↑ 44 Changed 11 months ago by charpent

Sorry for the delay : I ha to run my useful_work_emulator in a couple of meetings...

Replying to tmonteil:

Replying to charpent:

Replying to tmonteil:

[ Snip... ]

What is the output of

java -version
charpent@zen-book-flip:/usr/local/sage-P3-2$ java -version
openjdk version "11.0.5-ea" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-ea+6-post-Debian-2)
OpenJDK 64-Bit Server VM (build 11.0.5-ea+6-post-Debian-2, mixed mode, sharing)

Very weird, it should be accepted by the test. Within a Sage command-line, what is the output of:

sage: from sage.cpython.string import bytes_to_str
sage: import subprocess, re
sage: version = bytes_to_str(subprocess.check_output(['java', '-version'], stderr=subprocess.STDOUT))
sage: version

Followed by:

sage: java_version = re.search(r'version.*([1][.][789]|"[\d.]+")', version)
sage: bool(java_version)
sage: sage: from sage.cpython.string import bytes_to_str
....: sage: import subprocess, re
....: sage: version = bytes_to_str(subprocess.check_output(['java', '-version'],
....:  stderr=subprocess.STDOUT))
....: sage: version
....: 
'openjdk version "11.0.5-ea" 2019-10-15\nOpenJDK Runtime Environment (build 11.0.5-ea+6-post-Debian-2)\nOpenJDK 64-Bit Server VM (build 11.0.5-ea+6-post-Debian-2, mixed mode, sharing)\n'
sage: sage: java_version = re.search(r'version.*([1][.][789]|"[\d.]+")', version
....: )
....: sage: bool(java_version)
....: 
False

Replying to dimpase:

this appears to work on my Gentoo box. I'll test more on OSX and some other Linux...

Great.

comment:48 Changed 11 months ago by tmonteil

OK, the -ea is parasiting the check for a version number. Actually, the current code just checks that the version number looks like numbers and dots, but it does not really check for any given interval of versions. Let us fix that.

comment:49 Changed 11 months ago by git

  • Commit changed from 8a380648f690c15a2763487378124fcafc1e42be to a23c91850db9b5ca167cbcdd5fe8269e98196c56

Branch pushed to git repo; I updated commit sha1. New commits:

a23c918#25026 : fix java version number checking

comment:50 follow-ups: Changed 11 months ago by tmonteil

Needs review.

comment:51 in reply to: ↑ 50 Changed 11 months ago by charpent

Replying to tmonteil:

Needs review.

Seems to work:

  • reverted the test short-circuit
  • fetched your last branch
  • quick test (displaying a sphere and a cone) ==> works.

ptestlong underway...

comment:52 in reply to: ↑ 50 Changed 11 months ago by jipilab

Replying to tmonteil:

Needs review.

  • Fetched the current branch
  • Downloaded tarball
  • sage -f jmol
  • Drew successfully a polyhedron with jmol (my original problem)

Works on debian buster with openjdk version "11.0.4" and Sage8.9rc0 with python3.

Any things else I should test?

Last edited 11 months ago by jipilab (previous) (diff)

comment:53 Changed 11 months ago by charpent

  • Status changed from needs_review to positive_review

Okay. ptestlong doesn't show anything not already reported.

==> positive_review. But this should be confirmed on other platforms.

comment:54 Changed 11 months ago by egourgoulhon

Works on Ubuntu 18.04 (openjdk 11.0.4) with Python 3 Sage. So +1 for the positive review. Thank you Thierry!

comment:55 Changed 11 months ago by dimpase

on my museum MacBookAir? from 2010 running OSX 10.13.6, with

$ java -version
java version "1.8.0_191"
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

I am getting

sage: sphere(viewer="jmol")
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-1-bd168a4fee36> in <module>()
----> 1 sphere(viewer="jmol")

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in __call__(self, result)
    244             self.start_displayhook()
    245             self.write_output_prompt()
--> 246             format_dict, md_dict = self.compute_format_data(result)
    247             self.update_user_ns(result)
    248             self.fill_exec_result(result)

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/IPython/core/displayhook.pyc in compute_format_data(self, result)
    148 
    149         """
--> 150         return self.shell.display_formatter.format(result)
    151 
    152     # This can be set to True by the write_output_prompt method in a subclass

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/sage/repl/display/formatter.pyc in format(self, obj, include, exclude)
    198         """
    199         # First, use Sage rich output if there is any
--> 200         sage_format, sage_metadata = self.dm.displayhook(obj)
    201         assert PLAIN_TEXT in sage_format, 'plain text is always present'
    202         if not set(sage_format.keys()).issubset(self.default_mime()):

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/sage/repl/rich_output/display_manager.pyc in displayhook(self, obj)
    810         self._backend.set_underscore_variable(obj)
    811         plain_text, rich_output = self._rich_output_formatter(obj, dict())
--> 812         return self._backend.displayhook(plain_text, rich_output)
    813 
    814     def display_immediately(self, obj, **rich_repr_kwds):

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_ipython.pyc in displayhook(self, plain_text, rich_output)
    265             return ({u'text/plain': msg}, {})
    266         elif isinstance(rich_output, OutputSceneJmol):
--> 267             msg = self.launch_jmol(rich_output, plain_text.text.get_unicode())
    268             return ({u'text/plain': msg}, {})
    269         elif isinstance(rich_output, OutputSceneWavefront):

/Volumes/MacHD/home/sagetrac-mirror/local/lib/python2.7/site-packages/sage/repl/rich_output/backend_ipython.pyc in launch_jmol(self, output_jmol, plain_text)
    368         jdata = JmolData()
    369         if not jdata.is_jvm_available() and not DOCTEST_MODE:
--> 370             raise RuntimeError('jmol cannot run, no suitable java version found')
    371         launch_script = output_jmol.launch_script_filename()
    372         jmol_cmd = 'jmol'

RuntimeError: jmol cannot run, no suitable java version found

comment:56 Changed 11 months ago by dimpase

  • Status changed from positive_review to needs_work

comment:57 Changed 11 months ago by jhpalmieri

I get the same thing on OS X 10.14.6. From bash:

$ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

The reference manual looks fine, though.

Last edited 11 months ago by jhpalmieri (previous) (diff)

comment:58 Changed 11 months ago by git

  • Commit changed from a23c91850db9b5ca167cbcdd5fe8269e98196c56 to 1c5d695b0bcf4a853df55fc1c5a86500c6218ecf

Branch pushed to git repo; I updated commit sha1. New commits:

1c5d695#25026 : major java version number X appears as 1.X.blah or X.blah

comment:59 Changed 11 months ago by tmonteil

  • Status changed from needs_work to needs_review

OK, the major version X we want to extract either appears as X.blah or as 1.X.blah.

I wonder whether cygwin's java ships yet another version format.

comment:60 Changed 11 months ago by jhpalmieri

That works for me.

comment:61 follow-up: Changed 11 months ago by dimpase

I think it's a bit hopless to merely chase numbers. E.g. IBM's java implementation OpenJ9 has versions of the form 0.X.Y, see https://github.com/eclipse/openj9/releases

Can one instead test a feature?

comment:62 in reply to: ↑ 61 Changed 11 months ago by tmonteil

Replying to dimpase:

I think it's a bit hopless to merely chase numbers. E.g. IBM's java implementation OpenJ9 has versions of the form 0.X.Y, see https://github.com/eclipse/openj9/releases

While we are at it, it is not a hard task to add the 0.X.Y form.

Can one instead test a feature?

If you know which one, why not.

The benefit of having a (working) version-based test, is that we can also fix some upper bound (the previous version of jmol was not working for java > 8).

comment:63 follow-ups: Changed 11 months ago by jhpalmieri

The existing src/sage/interfaces/jmoldata.py checks for version numbers, so testing for a feature could go on another ticket: I don't think it should hold up this one.

comment:64 Changed 11 months ago by arojas

  • Cc arojas removed

comment:65 Changed 11 months ago by git

  • Commit changed from 1c5d695b0bcf4a853df55fc1c5a86500c6218ecf to 25b056c24c9d485de71f59ef00c0b1ef4ba9329a

Branch pushed to git repo; I updated commit sha1. New commits:

25b056c#25026 : major java version 0.X.blah format for openj9

comment:66 in reply to: ↑ 63 Changed 11 months ago by tmonteil

Replying to jhpalmieri:

The existing src/sage/interfaces/jmoldata.py checks for version numbers, so testing for a feature could go on another ticket: I don't think it should hold up this one.

Agreed, especially since jmol is currently broken on many distros.

comment:67 in reply to: ↑ 63 Changed 11 months ago by dimpase

Replying to jhpalmieri:

The existing src/sage/interfaces/jmoldata.py checks for version numbers, so testing for a feature could go on another ticket: I don't think it should hold up this one.

Right. In fact I - clueless about java - misunderstood the meaning of the version part of the output of java -version - it's not really implementation-dependent, it's apparently indicating java.version (a "system property" of the JVM). There are two possible formats for java.version:

Java 8 or lower: 1.X.A_B, 1.X.Y (X<9)

Java 9 or higher: X.Y.Z (X>8)

I could not find anywhere any stipulaton of what java -version should print, but it appears very plausable that every implementation puts java.version there.

One certainly can write a bit of Java code to test java.version, this would be a fool-proof way. So a future ticket can just do this.

comment:68 Changed 11 months ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

OK, this works now on OSX 10.13, as well.

comment:69 Changed 11 months ago by vbraun

  • Branch changed from u/tmonteil/pkgs/jmol/update to 25b056c24c9d485de71f59ef00c0b1ef4ba9329a
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.