On Wed, Jun 9, 2010 at 2:08 PM, Dr. David Kirkby <david.kir...@onetel.net> wrote:
>> The mpl configure happens in setupext.py that lives next to setup.py. >> It tries to use pkgconfig if it is available to find freetype, so you >> may have luck setting your PKG_CONFIG_PATH if you are using it. > > I was not using PKG_CONFIG_PATH What I am suggesting is that you might want to. > Would it be a good idea in general to set PKG_CONFIG_PATH to a directory in > Sage? I'm not sure if it would need to be $SAGE_LOCAL, $SAGE_LOCAL/lib, or > $SAGE_LOCAL/lib/pkgconfig. It should be set to the subdir that includes the *.pc files, most likely $SAGE_LOCAL/lib/pkgconfig from the candidates above. > I would have thought that it sensible to prepend the required Sage directory > to PKG_CONFIG_PATH, in much the same way as $SAGE_LOCAL/bin is prepended to > PATH and $SAGE_LOCAL/lib is prepended to LD_LIBRARY_PATH. At the moment, > that is not happening in Sage, despite there being several configuration > files in the directory $SAGE_LOCAL/lib/pkgconfig. If $SAGE_LOCAL/lib/pkgconfigs has *.pc fles in it, prepending this dir to your PKG_CONFIG_PATH env var, or setting PKG_CONFIG_PATH to it if it is not otherwise defined, is certainly a good idea vis-a-vid mpl, because we do rely on pkg-config if it is available. > What I can't understand is how /usr/sfw/include/freetype2 was found though. > There was certainly no PKG_CONFIG_PATH set to anything like /usr/sfw, though > /usr/sfw/bin was in my path, and there is a directory /usr/sfw/lib/pkgconfig > > So how did matplotlib find the freetype headers in /usr/sfw/include? This is strange given that you are patching basedir as you indicated below. The only things I can think of are: * sys.platform != 'darwin' on the box you are building on. In this case you need to modify your patch to include sys.platform. This is the most likely culprit as far as I can see. * something about your build environment is not clean... * PKG_CONFIG_PATH is somehow set in your build env and includes the sfw tree JDH > There is a file /usr/sfw/bin/freetype-config which I thought might have been > the culprit. > > >> Alternatively, there is a dictionary in setupext.py called basedirs >> that maps platform to list of directories to search for support libs. >> You might want to modify the defaults to find the directory containing >> the sage supplied versions. >> >> JDH > > At the moment, setupext.py is patched in Sage to: > > sage_inc = os.environ['SAGE_LOCAL'] + '/include/' > sage_lib = os.environ['SAGE_LOCAL'] + '/lib/' > > basedir = { > 'win32' : ['win32_static',], > 'linux2' : [sage_lib], > 'linux' : ['/usr/local', '/usr',], > 'cygwin' : ['/usr/local', '/usr',], > '_darwin' : ['/sw/lib/freetype2', '/sw/lib/freetype219', '/usr/local', > '/usr', '/sw'], > # it appears builds with darwin are broken because of all the > # different flags the deps can be compile with, so I am pushing > # people to : > # make -f make.osx fetch deps mpl_build mpl_install > > 'darwin' : [sage_lib], > > 'freebsd4' : ['/usr/local', '/usr'], > 'freebsd5' : ['/usr/local', '/usr'], > 'freebsd6' : ['/usr/local', '/usr'], > 'sunos5' : [os.getenv('MPLIB_BASE') or '/usr/local',], > 'gnukfreebsd5' : ['/usr/local', '/usr'], > 'gnukfreebsd6' : ['/usr/local', '/usr'], > 'aix5' : ['/usr/local'], > } > > So sage_lib is used on linux, but not Solaris. Does that make any sense even > on Linux - forget Solaris for a minute? Given all the other directories in > the 'basedir' list do *not* end in "lib", I can't see why the one for Linux > should have substiuted $SAGE_LOCAL/lib. It would seem more logical for it to > be $SAGE_LOCAL and not $SAGE_LOCAL/lib. > > Anyway, given all the above, what would seem most logical to put on that > 'sunos5' line, which is the one that is relevant here, since that is what > python is indicating. > > > drkir...@hawk:~$ python > Python 2.6.4 (r264:75706, Feb 14 2010, 14:03:47) [C] on sunos5 > Type "help", "copyright", "credits" or "license" for more information. >>>> import sys >>>> sys.platform > 'sunos5' >>>> > > > Dave > > -- > To post to this group, send an email to sage-devel@googlegroups.com > To unsubscribe from this group, send an email to > sage-devel+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/sage-devel > URL: http://www.sagemath.org > -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org