problem with animate on OS X 10.5, Sage 3.1.2

9 views
Skip to first unread message

John H Palmieri

unread,
Sep 27, 2008, 8:41:10 PM9/27/08
to sage-support
Can anyone else reproduce this?

sage: a = animate([sin(x + float(k)) for k in srange(0,2*pi,0.3)],
xmin=0, xmax=2*pi, figsize=[2,1])
sage: a
Animation with 21 frames
sage: a.show()
dyld: Symbol not found: __cg_png_create_info_struct
Referenced from:
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/
Fram\
eworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /Applications/sage/local/lib//libPng.dylib

sh: line 1: 75999 Trace/BPT trap convert -delay 20 -loop 0
*.png
"/Users/palmieri/.sage/sage_notebook/worksheets/admin/46/cells/37/
sage0.\
gif"

mabshoff

unread,
Sep 27, 2008, 8:51:12 PM9/27/08
to sage-support


On Sep 27, 5:41 pm, John H Palmieri <jhpalmier...@gmail.com> wrote:
> Can anyone else reproduce this?

I can't since I do not have convert on a Mac, but the problem is that
we switched to a dynamic libpng. The solution is:

* create a convert script in $SAGE_LOCAL/bin
* set DYLD_LIBRARY_PATH to SAGE_ORIG_DYLD_LIBRARY_PATH
* call convert with an absolute path (use "which convert" from
outside Sage) and pass on all parameters (i.e. /use/local/foo/convert
"$@")

We should probably do that automatically on OSX for convert, emacs and
the other usual suspects. The problem boils down to Apple renaming
some of the symbols in libpng and creating libPng.dylib in the
process.

Cheers,

Michael

Marshall Hampton

unread,
Sep 28, 2008, 12:51:57 PM9/28/08
to sage-support
That works for me (i.e. the animate command behaves properly), but
I've ceased to understand my own setup after trying to help with trac
#2094. I am just mentioning this because I don't think I did what
Michael is describing. I have a convert in /usr/local/bin/ that seems
to be what is being used. I am happy to run any diagnostic command if
it would help.

-M. Hampton

William Stein

unread,
Sep 28, 2008, 3:40:43 PM9/28/08
to sage-s...@googlegroups.com

The right solution, which we've probably halfway already done
if I remember correctly, is to write a Sage function called
"run_command" that resets the environment as you suggest
above, runs the subcommand, and returns. This should be
completely transparent to the user, and should do the right
thing on Linux, OS X, etc. Then the animate command
would call convert via run_command instead of os.system.

William

mabshoff

unread,
Sep 28, 2008, 3:46:56 PM9/28/08
to sage-support
Yes, for the convert command this should be used. Once we do that this
should also stop the annoying "convert not found" crap printed when
doctesting.

That still does not resolve the issue for Emacs that is launched due
to hg executing EDITOR.

> William

Cheers,

Michael

Jason Grout

unread,
Sep 29, 2008, 10:40:28 AM9/29/08
to sage-s...@googlegroups.com


See http://trac.sagemath.org/sage_trac/ticket/975 for a solution that is
already put in place. Basically, use
$SAGE_ROOT/local/bin/sage-native-execute, which does exactly what
mabshoff says above.

Thanks,

Jason

John H Palmieri

unread,
Sep 29, 2008, 2:15:14 PM9/29/08
to sage-support


On Sep 29, 7:40 am, Jason Grout <jason-s...@creativetrax.com> wrote:
>
> See http://trac.sagemath.org/sage_trac/ticket/975for a solution that is
> already put in place.  Basically, use
> $SAGE_ROOT/local/bin/sage-native-execute, which does exactly what
> mabshoff says above.

So like the following?

<http://trac.sagemath.org/sage_trac/ticket/4216>

By the way, is there a way to tell which calls to os.system should use
sage-native-execute, or should we just deal with case-by-case?

John

mabshoff

unread,
Sep 29, 2008, 2:20:56 PM9/29/08
to sage-support


On Sep 29, 11:15 am, John H Palmieri <jhpalmier...@gmail.com> wrote:
> On Sep 29, 7:40 am, Jason Grout <jason-s...@creativetrax.com> wrote:
>
>
>
> > Seehttp://trac.sagemath.org/sage_trac/ticket/975fora solution that is
> > already put in place.  Basically, use
> > $SAGE_ROOT/local/bin/sage-native-execute, which does exactly what
> > mabshoff says above.
>
> So like the following?
>
> <http://trac.sagemath.org/sage_trac/ticket/4216>

Yep, pretty much.

> By the way, is there a way to tell which calls to os.system should use
> sage-native-execute, or should we just deal with case-by-case?

sage-native-execute sets [DY]LD_LIBRARY_PATH depending if the binary
is in $SAGE_LOCAL/bin or not and avoids the kind of missing or
incorrect symbol problem. I would always prefer sage-native-execute
over os.system.

>   John

Cheers,

Michael
Reply all
Reply to author
Forward
0 new messages