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

darwin failure #50

Closed
nolta opened this issue Jul 16, 2013 · 14 comments
Closed

darwin failure #50

nolta opened this issue Jul 16, 2013 · 14 comments
Labels

Comments

@nolta
Copy link
Member

nolta commented Jul 16, 2013

Deleted ~/.julia, chose "source" build option.

julia> using Winston
ERROR: TclError("error initializing Tk: Can't find a usable tk.tcl in the following directories: \n    /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tk8.5/Resources/Scripts /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5 /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tk8.5/Resources/Scripts /Users/nolta/julia/usr/lib/tk8.5 /Users/nolta/julia/usr/lib/tk8.5/Resources/Scripts ~/Library/Tcl/tk8.5 ~/Library/Tcl/tk8.5/Resources/Scripts /Library/Tcl/tk8.5 /Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/tk8.5 /System/Library/Tcl/tk8.5/Resources/Scripts /System/Library/Tcl/8.5/tk8.5 /System/Library/Tcl/8.5/tk8.5/Resources/Scripts ~/Library/Frameworks/tk8.5 ~/Library/Frameworks/tk8.5/Resources/Scripts /Library/Frameworks/tk8.5 /Library/Frameworks/tk8.5/Resources/Scripts /System/Library/Frameworks/tk8.5 /System/Library/Frameworks/tk8.5/Resources/Scripts /Users/nolta/julia/lib/tk8.5 /Users/nolta/julia/usr/library\n\n\n\nThis probably means that tk wasn't installed properly.\n")
 in init at /Users/nolta/.julia/Tk/src/tkwidget.jl:36
 in include_from_node1 at loading.jl:91 (repeats 2 times)
 in reload_path at loading.jl:114
 in require at loading.jl:48
 in include_from_node1 at loading.jl:91 (repeats 3 times)
 in reload_path at loading.jl:114
 in require at loading.jl:48
at /Users/nolta/.julia/Tk/src/tkwidget.jl:426
at /Users/nolta/.julia/Tk/src/Tk.jl:24
at /Users/nolta/.julia/Winston/src/tk.jl:1
at /Users/nolta/.julia/Winston/src/plot.jl:13
at /Users/nolta/.julia/Winston/src/Winston.jl:2495
@ViralBShah
Copy link
Collaborator

We can now use the native Tk on OS X, but apparently, the following environment variable is required, despite the search path having it:

Try TK_LIBRARY=/System/Library/Frameworks/Tk.framework/Versions/8.5/Resources/Scripts

@nolta
Copy link
Member Author

nolta commented Jul 17, 2013

A little better:

julia> using Winston

julia> plot([1,2,3])
error during Tk callback: 
ERROR: error compiling curve: error compiling stroke: could not load module libcairo: dlopen(libcairo.dylib, 1): image not found
 in render at /Users/nolta/.julia/Winston/src/paint.jl:280
 in render at /Users/nolta/.julia/Winston/src/Winston.jl:2407
 in render at /Users/nolta/.julia/Winston/src/Winston.jl:932
 in compose_interior at /Users/nolta/.julia/Winston/src/Winston.jl:1158
 in compose at /Users/nolta/.julia/Winston/src/Winston.jl:1684
 in page_compose at /Users/nolta/.julia/Winston/src/Winston.jl:1701
 in anonymous at /Users/nolta/.julia/Winston/src/tk.jl:49
 in draw at /Users/nolta/.julia/Tk/src/tkwidget.jl:225
 in configure at /Users/nolta/.julia/Tk/src/tkwidget.jl:220
 in init_canvas at /Users/nolta/.julia/Tk/src/tkwidget.jl:380
 in anonymous at /Users/nolta/.julia/Tk/src/tkwidget.jl:359
 in jl_tcl_callback at /Users/nolta/.julia/Tk/src/tkwidget.jl:119
 in tcl_doevent at /Users/nolta/.julia/Tk/src/tkwidget.jl:20
 in wait_initialized at /Users/nolta/.julia/Tk/src/tkwidget.jl:408
 in getgc at /Users/nolta/.julia/Tk/src/tkwidget.jl:417
 in anonymous at /Users/nolta/.julia/Winston/src/tk.jl:46
 in draw at /Users/nolta/.julia/Tk/src/tkwidget.jl:225
 in display at /Users/nolta/.julia/Winston/src/tk.jl:51
 in tk at /Users/nolta/.julia/Winston/src/tk.jl:36
 in _plot at /Users/nolta/.julia/Winston/src/plot.jl:99
 in plot at /Users/nolta/.julia/Winston/src/plot.jl:20

And then julia crashes.

@ViralBShah
Copy link
Collaborator

@vtjnash This never used to be a problem before. How come it is looking for libcairo instead of something like libcairo-2? I wonder if this is related to your recent changes.

@ViralBShah
Copy link
Collaborator

@staticfloat Any ideas what we can do about making sure that the system Tk is used if other Tk installations are present? Perhaps we should put the environment setting in Tk.jl?

Using the system provided Tk will greatly simplify things, although it seems to have caused some short term trouble.

@vtjnash
Copy link
Contributor

vtjnash commented Jul 18, 2013

@ViralBShah There are several typos in Cairo.jl where it uses :libcairo

@ViralBShah
Copy link
Collaborator

Strange how this never got caught before.

@vtjnash
Copy link
Contributor

vtjnash commented Jul 18, 2013

Those uses were hidden by the deprecation warnings.

We use the first version of Tk that is found on the system, preferring Tk 8.6 to 8.5. Can I point out JuliaLang/julia#2716 before you add environment variables to Tk.jl?

@nolta
Copy link
Member Author

nolta commented Jul 18, 2013

Ok, plots work after fixing the :libcairo.

But i'm little unclear on the need for TK_LIBRARY. There aren't multiple Tk installations on my mac, just the system Tk.

@vtjnash
Copy link
Contributor

vtjnash commented Jul 18, 2013

I'm with you on that. Except that I also have MacPorts Tk in my LD_LIBRARY_PATH (for picking up Cairo), and it works fine without that variable.

I knew about this variable because it was also failing on windows for the same reason.

Perhaps we can come up with some way to automatically set tk_library, documented at http://www.tcl.tk/man/tcl8.6/TkCmd/tkvars.htm#M4, based upon a better guess at the libtk search path? (perhaps based on http://stackoverflow.com/questions/6676525/how-to-get-the-absolute-library-file-name-corresponding-to-a-relative-path-given)

@vtjnash
Copy link
Contributor

vtjnash commented Jul 18, 2013

(the equivalent function on windows appears to be http://msdn.microsoft.com/en-us/library/windows/desktop/ms683198(v=vs.85).aspx)

@mlubin
Copy link

mlubin commented Jul 18, 2013

Can the new library verification hook in BinDeps help out with this? @loladiro

@staticfloat
Copy link
Contributor

Was the only issue the libcairo typos, or is there still a problem?

@ViralBShah
Copy link
Collaborator

It still doesn't work without the environment variable. For the binaries, I have added the environment setting to the startup script, but based on responses on the list, it doesn't seem to be working. Perhaps we may need to link with -framework Tk or some such thing on OS X.

@vtjnash
Copy link
Contributor

vtjnash commented Jul 19, 2013

If you look at the source code for Tk, it is supposed to read this path out of the resource fork. But that seems to be failing. I don't understand why it doesn't work.

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

No branches or pull requests

5 participants