Skip to content

Commit

Permalink
Add Tcl and Tk frameworks to the julia binaries.
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah committed Jul 20, 2013
1 parent dec6039 commit 76864b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ DEBUGFLAGS += $(FLAGS)
SHIPFLAGS += $(FLAGS)
JLDFLAGS += $(LDFLAGS) $(NO_WHOLE_ARCHIVE) $(call exec,$(LLVM_CONFIG) --ldflags) $(OSLIBS) $(RPATH)

ifeq ($(OS), Darwin)
JLDFLAGS += -framework Tcl -framework Tk
endif

julia-release julia-debug: %: %-basic %-readline

release debug:
Expand Down

8 comments on commit 76864b1

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see right now if this has already been reverted, but it seems like it should be (unless it fixed the issue with TK_LIBRARY, perhaps)

@ViralBShah
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to fix it for me - but I want others to try it out.

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, this works for the Tk issue. But it would probably be better to move this into the Tk.jl package to avoid linking statically against Tk and, by association, all of the graphics dylibs. Here's a useful resource on how:
http://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFBundles/AccessingaBundlesContents/AccessingaBundlesContents.html
In summary, Tk uses CFBundleGetBundleWithIdentifier, which can only be used if the application has been statically linked to a framework, or opened it previously with CFURLCreateWithFileSystemPath / CFBundleCreate.

@staticfloat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we also pull in Accelerate because of this, so if there's any way to shield Julia from that (if nothing else then just to silence the warnings) we should.

See #3780 for context

@ViralBShah
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be simpler to not link against these frameworks, and simply set the TK_LIBRARY environment variable in Tk.jl?

@ViralBShah
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, it is really convenient now to just download the latest mac 0.2 dmg and try this kind of stuff out. Love the nightlies!

@vtjnash
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViralBShah calling CFBundleCreate in Tk.jl has the same results as linking against the Tk framework, if you want to avoid setting the environment variable. Or to fix the Tk issue when using the system Tk, you can also directly set the Tcl variable tk_library.
You should probably also add an section to Tk.jl/deps/ext.jl which explicitly loads /usr/lib/lib{tcl,tk}.dylib (or the /S/L/F/Tk.framework/Tk) since we are adding an explicit expectation of using the system Tk framework (and not MacPorts / Homebrew / custom)

@ViralBShah
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #3794 to track this.

Please sign in to comment.