Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jmol on commandline broken #9232

Closed
vbraun opened this issue Jun 13, 2010 · 47 comments
Closed

jmol on commandline broken #9232

vbraun opened this issue Jun 13, 2010 · 47 comments

Comments

@vbraun
Copy link
Member

vbraun commented Jun 13, 2010

I can't see Graphics3d objects on the command line. For example,

sage: sphere()
sage: 

The command returns without starting jmol or producing any other graphical output.

Strangely enough, I can start jmol from the sage command line:

----------------------------------------------------------------------
| Sage Version 4.4.3, Release Date: 2010-06-04                       |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
sage: !jmol
splash_image=jar:file:/home/vbraun/opt/sage-hg/local/lib/python2.6/site-packages/sagenb-0.8-py2.6.egg/sagenb/data/jmol/Jmol.jar!/org/openscience/jmol/images/Jmol_splash.jpg
history file is /home/vbraun/.jmol/history
using Smarter Model Adapter
(C) 2008 Jmol Development
Jmol Version 11.6.16  2008-11-24 13:39
java.vendor:Sun Microsystems Inc.
java.version:1.6.0_18
os.name:Linux
memory:9.8/21.1
useCommandThread: false
User macros dir: /home/vbraun/.jmol/macros
       exists: false
  isDirectory: false

The following also works and shows a tachyon-generated plot:

sphere(viewer='tachyon')

More verbosity:

sage: sphere(verbosity=99)
Traceback (most recent call last):
  File "/home/vbraun/Sage/sage/local/bin/sage-pypkg-location", line 3, in <module>
    from pkg_resources import Requirement, working_set
zipimport.ZipImportError: can't decompress data; zlib not available
Jmol.jar not found

For the record, I'm running Fedora 13 x86_64


Apply attachment: trac_9232_call_jmol_correctly.patch and attachment: trac_9232-lighting.patch.

CC: @kcrisman @jasongrout @jdemeyer

Component: graphics

Author: Jonathan Gutow, Volker Braun

Reviewer: Jason Grout, Karl-Dieter Crisman, Volker Braun

Merged: sage-4.7.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/9232

@gutow
Copy link

gutow commented Jul 14, 2010

comment:1

Does it work if you install the new version of Jmol? See trac # 9238. I think this broke when the notebook was put inside an egg. I took that into account with the new version of Jmol.

@vbraun
Copy link
Member Author

vbraun commented Jul 14, 2010

comment:2

I installed http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.spkg (#9238) but it did not change anything. The verbose output above indicates that Jmol.jar is never opened, so it is not particularly surprising that an updated Jmol spkg has no effect.

@gutow
Copy link

gutow commented Jul 15, 2010

comment:3

It was worth a try as that still could have been a hidden Jmol.jar file not found error. This is different than the problem I addressed. Sorry. I would guess it is a problem with the "sphere" command. Does it work with a simple plot3d command? I've tested the 1.1 version on MacOS and Ubuntu and it seems to work for me.
Replying to @vbraun:

I installed http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.spkg (#9238) but it did not change anything. The verbose output above indicates that Jmol.jar is never opened, so it is not particularly surprising that an updated Jmol spkg has no effect.

@vbraun
Copy link
Member Author

vbraun commented Jul 15, 2010

comment:4

I only used the sphere() command because it is the fastest way to generate 3d graphics. Other 3d plotting commands fail in the same way:

sage: plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2))  # note: no output
sage: plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2), verbosity=99)
Traceback (most recent call last):
  File "/home/vbraun/Sage/sage/local/bin/sage-pypkg-location", line 3, in <module>
    from pkg_resources import Requirement, working_set
zipimport.ZipImportError: can't decompress data; zlib not available
Jmol.jar not found

@gutow
Copy link

gutow commented Jul 15, 2010

comment:5

Try installing the Jmol for notebook again. It looks like the file on my server got corrupted and was missing the Jmol.jar application file as well as some others..Not sure what happened but we've had some power outages and the server may have been rebuilt from backups. I've uploaded a new copy.

Because the name hasn't changed you will probably have to do some surgery to get it to download and do an install. You will need to delete any copies of the .spkg (or its uncompressed directory) that you find in any of these subdirectories of your sage install before trying an install. If you don't get a message about downloading the file you missed something:
spkg/build
spkg/installed
spkg/optional

Let us know if this fixes it. Sorry for the inconvenience.
Jonathan
Replying to @vbraun:

I only used the sphere() command because it is the fastest way to generate 3d graphics. Other 3d plotting commands fail in the same way:

sage: plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2))  # note: no output
sage: plot3d(lambda x, y: x^2 + y^2, (-2,2), (-2,2), verbosity=99)
Traceback (most recent call last):
  File "/home/vbraun/Sage/sage/local/bin/sage-pypkg-location", line 3, in <module>
    from pkg_resources import Requirement, working_set
zipimport.ZipImportError: can't decompress data; zlib not available
Jmol.jar not found

@vbraun
Copy link
Member Author

vbraun commented Jul 15, 2010

comment:6

I did a

[vbraun@localhost sage]$ rm ./spkg/optional/Jmol_for_SageNoteBook-1.1.spkg
[vbraun@localhost sage]$ ./sage -f http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.spkg

and it re-downloaded the Jmol spkg. Still fails with the same error message.

@gutow
Copy link

gutow commented Jul 15, 2010

comment:7

There is something special about your system...I've just retested that things work for Sage 4.4.3 on MacOS and Ubuntu Linux. Let's see if everything actually got installed:
Can you please post the directory listing (ls -l please) for the following two directories:
/local/lib/python2.6/site-packages/sagenb-0.8-py2.6.egg/sagenb/data/jmol
and
/local/lib/python2.6/site-packages/sagenb-0.8-py2.6.egg/sagenb/data/jmol/appletweb

If everything is there, I'm mystified. If everything is not, then something is wrong with the install for your system and the .spkg needs to be fixed.

Jonathan
Replying to @vbraun:

I did a

[vbraun@localhost sage]$ rm ./spkg/optional/Jmol_for_SageNoteBook-1.1.spkg
[vbraun@localhost sage]$ ./sage -f http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.spkg

and it re-downloaded the Jmol spkg. Still fails with the same error message.

@vbraun
Copy link
Member Author

vbraun commented Jul 15, 2010

comment:8

I saved the sys.path within sage-pypkg-location, and it reads:

/home/vbraun/opt/sage-4.5.alpha1/local/bin
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/setuptools-0.6c9-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/Twisted-9.0.0-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/ZODB3-3.7.0-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zdaemon-2.0.0-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/ZConfig-2.5-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.testing-3.5.0-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.proxy-3.4.0-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/Pygments-0.11.1-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/Jinja-1.2-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/Jinja2-2.1.1-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/Sphinx-0.6.3-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/SQLAlchemy-0.5.8-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/pytz-2010h-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.i18nmessageid-3.5.2-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.event-3.5.0_1-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/ClientForm-0.2.10-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/mechanize-0.1.11-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.interface-3.6.1-py2.6-linux-x86_64.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.schema-3.6.3-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/zope.testbrowser-3.8.1-py2.6.egg
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/sagenb-0.8-py2.6.egg
/home/vbraun/opt/sage-4.5.alpha1
/home/vbraun/Sage/sage/local/lib/python
/home/vbraun/Sage/sage/local/lib64/python26.zip
/home/vbraun/Sage/sage/local/lib64/python2.6
/home/vbraun/Sage/sage/local/lib64/python2.6/plat-linux2
/home/vbraun/Sage/sage/local/lib64/python2.6/lib-tk
/home/vbraun/Sage/sage/local/lib64/python2.6/lib-old
/home/vbraun/Sage/sage/local/lib64/python2.6/lib-dynload
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages
/home/vbraun/Sage/sage/local/lib/python2.6/site-packages/PIL

But sage install zlib in

[vbraun@volker-two sage-4.5.alpha1]$ find | grep zlib.so
./local/lib/python2.6/lib-dynload/zlib.so

Note: /lib/, not /lib64/. This explains why zlib cannot be imported. For the record, all libraries are 64-bit on my system.

From within Sage, on the other hand, sys.path is set appropriately:

sage: '/home/vbraun/Sage/sage/local/lib/python2.6/lib-dynload' in sys.path
True

@vbraun
Copy link
Member Author

vbraun commented Aug 5, 2010

comment:9

For the record, creating a symlink $SAGE_ROOT/local/lib64 pointing to $SAGE_ROOT/local/lib works. Another workaround is adding LIBRARY_PATH to DYLD_LIBRARY_PATH in sage-native-execute (from logix/#sage-devel).

I still don't understand the underlying cause, where does python get the incorrect path from?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Dec 13, 2010

comment:10

#10286 is a follow-up which hopefully fixes this, such that this ticket can be closed as a duplicate when #10286 got merged.

@gutow gutow assigned gutow and unassigned jasongrout and williamstein Mar 21, 2011
@gutow
Copy link

gutow commented Mar 22, 2011

Attachment: trac_9232_plot3d_base_pyx.patch.gz

plot3d/base.pyx fixes to launch Jmol from cmd line

@gutow
Copy link

gutow commented Mar 22, 2011

Notebook fixes for launch Jmol from cmd line

@gutow
Copy link

gutow commented Mar 22, 2011

Reviewer: Jason Grout, Karl-Dieter Crisman

@gutow
Copy link

gutow commented Mar 22, 2011

comment:13

Attachment: trac_9232_notebook_fixes.patch.gz

The above patches combined with installation of a newer version of Jmol fix this problem for Sage 4.6.2. To install the new Jmol

./sage -f "http://www.uwosh.edu/faculty_staff/gutow/Jmol_for_SageNoteBook-1.1.5.spkg"

Note that my linux and MacOS versions of sage seemed to have slightly different mercurial tracking. On MacOS you get a warning about the SageMenu.mnu file, when you apply the notebook_fixes patch. That is OK, the other untracked files are properly added.

@gutow
Copy link

gutow commented Mar 22, 2011

Author: Jonathan Gutwo

@gutow gutow added this to the sage-4.7 milestone Mar 22, 2011
@kcrisman
Copy link
Member

comment:14

This will have to be part of a new SageNB package before it can be merged. See also #9238.

@kcrisman
Copy link
Member

Changed author from Jonathan Gutwo to Jonathan Gutow

@gutow
Copy link

gutow commented Mar 22, 2011

comment:15

Replying to @kcrisman:

This will have to be part of a new SageNB package before it can be merged. See also #9238.

OK, so what does that involve? Does this mean make a complete .spkg of the sageNB? Then where do things have to go? Also don't we need positive reviews first?

@kcrisman
Copy link
Member

comment:24

Replying to @vbraun:

I applied the jmol spkg and trac_9232_plot3d_base_pyx.patch and jmol is still broken on the command line, Fedora 14 x86_64. I need to add trac_10286_call_jmol_correctly.patch from #10286 on top of it. The issue is that sage-native-execute must not be used for sage components like jmol.

Thanks for that feedback very much. Ok, then I propose that that patch gets moved here, and then #10286 can be just about sage-native-execute. Am I correct in assuming that only that patch from #10286 is needed to fix the behavior?

@vbraun
Copy link
Member Author

vbraun commented Mar 25, 2011

comment:25

Yes, it would be fine to move trac_10286_call_jmol_correctly.patch here. Only that one-liner is needed.

@kcrisman
Copy link
Member

Attachment: trac_9232_call_jmol_correctly.patch.gz

Apply this second.

@kcrisman
Copy link
Member

Changed reviewer from Jason Grout, Karl-Dieter Crisman to Jason Grout, Karl-Dieter Crisman, Volker Braun

@kcrisman
Copy link
Member

Changed author from Jonathan Gutow to Jonathan Gutow, Volker Braun

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member

comment:26

Okay, this should be all okay then.

@kcrisman
Copy link
Member

comment:27

Things are a little bit of a mess because of the potential for flask changeover in SageNB. What do people think of this?

  1. This ticket is used just for adding Volker's patch. No sagenb change needed.
  2. Jonathan's patches for the menu, help, and surface lighting/spt files are moved to J. Gutow's update to Jmol in the notebook... #9238.
  3. J. Gutow's update to Jmol in the notebook... #9238 and all its attendant pieces become part of the flask notebook changeover, and henceforth the property of those doing that :)
    Otherwise this has the potential to just bitrot forever.

@jasongrout
Copy link
Member

comment:28

The flask notebook has already split off of the current notebook. So any patches that are applied to the current sage notebook will also need to be applied to the new notebook, probably in parallel.

I'm already working on moving #9238 over to the new notebook. It's just a matter of applying the patch to the new notebook, as far as I can tell. (We'll find out better once we actually get jmol working with the new notebook!)

@gutow
Copy link

gutow commented Mar 29, 2011

comment:29

Should I continue to put my patches into #9238? I've still got some fixes that should reduce memory problems making Safari somewhat more reliable and I may be able to get the advanced controls working in IE.

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member

comment:30

Jonathan, definitely keep working on #9238. Jason can just put those things in the new notebook. Having something working completely is a very good idea, and we can continue to test it on the old notebook, which is still the current notebook, after all.

I do think we need to also add the piece of #9238 that changes the lighting. Currently I have good lighting in the command line and bad lighting in the notebook, even without the new jmol - someone the new jmol is called from the notebook, even though I didn't install it in this version!!! I even checked this in the advanced menu. Mystifying.

I'm just testing quick, and then I'll post patches. Since they aren't mine, I feel free to give positive review.

@kcrisman
Copy link
Member

Attachment: trac_9232-lighting.patch.gz

@kcrisman
Copy link
Member

@kcrisman

This comment has been minimized.

@kcrisman
Copy link
Member

kcrisman commented Apr 6, 2011

comment:32

Just a ping to let the release manager know this is ready for alpha4.

:-)

@jdemeyer
Copy link

jdemeyer commented Apr 7, 2011

comment:33

Please confirm that the sagenb does not need to be applied.

@jdemeyer
Copy link

jdemeyer commented Apr 7, 2011

comment:34

I meant to say more precisely: please confirm that the patch attachment: trac_9232_notebook_fixes.patch may be ignored.

@gutow
Copy link

gutow commented Apr 7, 2011

comment:35

That is correct. Only the two patches listed at the end of the description are necessary. The other two have been incorporated into ticket #9238 because they are enhancements to how Jmol works.

@jdemeyer
Copy link

jdemeyer commented Apr 7, 2011

Merged: sage-4.7.alpha4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants