Fixed discovery of Numpy directories under Windows

This commit is contained in:
Ray Speth
2011-12-14 19:34:43 +00:00
parent b78fa7c9de
commit b0d75cafea
2 changed files with 11 additions and 2 deletions

View File

@@ -7,10 +7,13 @@ localenv = env.Clone()
gcv = distutils.sysconfig.get_config_var
localenv.Append(CPPPATH=[gcv('INCLUDEPY')],
localenv.Append(CPPPATH=[gcv('INCLUDEPY'), env['python_array_include']],
SHLINKFLAGS=gcv('LDFLAGS'),
CPPFLAGS=[gcv('BASECFLAGS'), gcv('OPT')])
if localenv['OS'] == 'Windows':
localenv.Append(LIBPATH=pjoin(gcv('prefix'), 'libs'))
make_setup = localenv.SubstFile('setup.py', 'setup.py.in')
if env['python_package'] == 'full':

View File

@@ -467,7 +467,13 @@ if env['python_package'] in ('full','default'):
if env['python_array_home']:
sys.path.append(env['python_array_home'])
try:
__import__(env['python_array'])
np = __import__(env['python_array'])
try:
env['python_array_include'] = np.get_include()
except AttributeError:
print """WARNING: Couldn't find include directory for Python array package"""
env['python_array_include'] = ''
print """INFO: Building the full Python package using %s.""" % env['python_array']
env['python_package'] = 'full'
except ImportError: