Linking non framework Tcl/Tk on Mac OS X

Hi

I'm trying to track down a problem present in MacPorts Matplotlib
build and the TkAgg backend. It appears that Matplotlib is linking
against the system Tcl/Tk in /System/Library/Frameworks and not the
non-framework Tcl/Tk installed by MacPorts, as to be expected this is
causing segfaults when trying to use the TkAgg backend as the system
version of Tcl/Tk differs from the MacPorts version.

I've tried removing the list of directories to search for the
framework in setupext.py in the add_tk_flags() method, ie I've set
framework_dirs = [], and then set the paths to the Tcl/Tk header and
libraries in the hardcoded_tcl_config() method to point to the
MacPorts versions but this just leads to the build not being able to
find Tcl/Tk and therefore not building the TkAgg backend, the
following is displayed on build:

               Tkinter: no
                        * Tkinter present, but header files are not found.
                        * You may need to install development packages.

The header files are installed. Can Matplotlib be linked against a
non-framework build of Tcl/Tk on Mac OS X, and if so how?

Cheers

Adam

You’ll need to edit setupext.py to not inject the “-framework Tcl -framework Tk” flags.

  • Charlie
···

On Fri, Jun 27, 2008 at 12:36 AM, Adam Mercer <ramercer@…287…> wrote:

Hi

I’m trying to track down a problem present in MacPorts Matplotlib

build and the TkAgg backend. It appears that Matplotlib is linking

against the system Tcl/Tk in /System/Library/Frameworks and not the

non-framework Tcl/Tk installed by MacPorts, as to be expected this is

causing segfaults when trying to use the TkAgg backend as the system

version of Tcl/Tk differs from the MacPorts version.

I’ve tried removing the list of directories to search for the

framework in setupext.py in the add_tk_flags() method, ie I’ve set

framework_dirs = [], and then set the paths to the Tcl/Tk header and

libraries in the hardcoded_tcl_config() method to point to the

MacPorts versions but this just leads to the build not being able to

find Tcl/Tk and therefore not building the TkAgg backend, the

following is displayed on build:

           Tkinter: no

                    * Tkinter present, but header files are not found.

                    * You may need to install development packages.

The header files are installed. Can Matplotlib be linked against a

non-framework build of Tcl/Tk on Mac OS X, and if so how?

Cheers

Adam


Check out the new SourceForge.net Marketplace.

It’s the best place to buy or sell services for

just about anything Open Source.

http://sourceforge.net/services/buy/index.php


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Thanks Charlie, that does the trick.

Cheers

Adam

···

On Fri, Jun 27, 2008 at 12:03 PM, Charlie Moad <cwmoad@...287...> wrote:

You'll need to edit setupext.py to not inject the "-framework Tcl -framework
Tk" flags.