#11287: Interface to runsnake and import_statements
------------------------------------------+---------------------------------
   Reporter:  nthiery                     |          Owner:  tbd                
              
       Type:  enhancement                 |         Status:  needs_work         
              
   Priority:  major                       |      Milestone:  sage-4.7.1         
              
  Component:  performance                 |       Keywords:  runsnake, prun, 
profiling, days30
Work_issues:                              |       Upstream:  N/A                
              
   Reviewer:  Franco Saliola, Simon King  |         Author:  Nicolas M. ThiƩry  
              
     Merged:                              |   Dependencies:                     
              
------------------------------------------+---------------------------------

Comment(by saliola):

 Replying to [comment:21 nthiery]:

 > MacOS users (Anne!): The runsnake run author was kind enough to add a
 workaround in runsnake to make it work out of the box on MacOS. He would
 like to get it tested. Could you try out the attached devel version of
 runsnake, and see if:

 I gave it a try, and have some comments.

 1. The patch does not apply cleanly on top of sage-4.7.rc1; in the file
 `doc/en/reference/misc.rst` there is a conflict because of `classgraph`.
 So your patch needs a very trivial rebase.

 2. I checked and it seems that wxPython is already installed on two
 different Mac OS X systems I tested. Is this a standard python library on
 Mac OSX? So there might be no need to install it.

 3. Just running runsnake does not work:
 {{{
 Traceback (most recent call last):
   File "/usr/local/bin/runsnake", line 8, in <module>
     load_entry_point('RunSnakeRun==2.0.1', 'gui_scripts', 'runsnake')()
   File "/Library/Python/2.6/site-
 packages/RunSnakeRun-2.0.1-py2.6.egg/runsnakerun/macshim.py", line 7, in
 macshim
     env={"VERSIONER_PYTHON_PREFER_32_BIT":"yes"}
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py",
 line 444, in call
     return Popen(*popenargs, **kwargs).wait()
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py",
 line 595, in __init__
     errread, errwrite)
   File
 
"/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/subprocess.py",
 line 1106, in _execute_child
     raise child_exception
 OSError: [Errno 2] No such file or directory
 }}}
 So I started poking around in {{{macshim.py}}}. It seems the problem is
 with the env dictionary
 {{{
     env={"VERSIONER_PYTHON_PREFER_32_BIT":"yes"}
 }}}
 The documentation for the subprocess module says that env must provide any
 variables required for the program to execute. This includes the path; so
 one either needs to provide the path to runsnake32 as an environment
 variable, or just give the complete path to runsnake32. Here is a modified
 version of {{{macshim.py}}} that works for me:
 {{{
 def macshim():
     """Shim to run 32-bit on 64-bit mac as a sub-process"""
     import subprocess, sys
     subprocess.call([
         sys.argv[0]+'32'
     ]+sys.argv[1:],
         env={"VERSIONER_PYTHON_PREFER_32_BIT":"yes"}
     )
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11287#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to