On 06/10/10 12:30 PM, Jason Grout wrote:
On 6/9/10 10:22 PM, John Hunter wrote:
On Wed, Jun 9, 2010 at 9:15 PM, John Hunter<jdh2...@gmail.com> wrote:

* 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.

Sorry, upon rereading your post, I see you are building on a solaris
platform and not an OSX platform. It does look like you need an entry
in basedir that maps your solaris sys.platform -> [sage_lib].
Presumably this is 'sunos5'.


Yes. Currently, the patched setupext.py file looks like:

---------------------------------
### FOR SAGE
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'],
}
---------------------------------


AND there's another patch, where basedir is actually used:

-------------------------------
def add_base_flags(module):
incdirs = filter(os.path.exists,
[os.path.join(p, 'include') for p in basedir[sys.platform] ])
libdirs = filter(os.path.exists,
[os.path.join(p, 'lib') for p in basedir[sys.platform] ]+
[os.path.join(p, 'lib64') for p in basedir[sys.platform] ] )

module.include_dirs.extend(incdirs)
module.include_dirs.append('.')
module.include_dirs.append(sage_inc)
module.library_dirs.extend(libdirs)
module.library_dirs.extend([sage_lib])
---------------------------------

(note that we added sage_inc and sage_lib *after* the platform specific
directories) (and we confusingly use append and extend---minor nitpick,
though).

So my guess is that sunos5 is getting set in the basedirs definition,
and then the sage-specific directories are then getting appended after
the platform-specific directories in the second piece of code above.

What if we merely change the second piece of code to be:

---------------------------------
def add_base_flags(module):
module.include_dirs.append(os.environ['SAGE_LOCAL'] + '/include/')
module.library_dirs.append(os.environ['SAGE_LOCAL'] + '/lib/')

incdirs = filter(os.path.exists,
[os.path.join(p, 'include') for p in basedir[sys.platform] ])
libdirs = filter(os.path.exists,
[os.path.join(p, 'lib') for p in basedir[sys.platform] ]+
[os.path.join(p, 'lib64') for p in basedir[sys.platform] ] )

module.include_dirs.extend(incdirs)
module.include_dirs.append('.')
module.library_dirs.extend(libdirs)
-------------------------------------

(and we leave the definition of basedir alone). That puts the sage
directories in front of the platform-specific directories on all platforms.

Thanks,

Jason


Note also
1) There is a section "def check_for_freetype():"
2) The code seems to have changed in the latest matplotlib, so I would not waste too much time over that in Sage if you intend updating matplotlib. I'd fix it after updating.

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

Reply via email to