[Numpy-svn] r4295 - in branches/numpy.scons/numpy: core distutils/scons
numpy-svn at scipy.org
numpy-svn at scipy.org
Thu Oct 25 22:40:08 EDT 2007
Author: cdavid
Date: 2007-10-25 21:39:59 -0500 (Thu, 25 Oct 2007)
New Revision: 4295
Modified:
branches/numpy.scons/numpy/core/SConstruct
branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
branches/numpy.scons/numpy/distutils/scons/libinfo.py
Log:
Refactor the site.cfg part in custom checkers, to be reusable in generic checkers.
Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct 2007-10-25 15:07:36 UTC (rev 4294)
+++ branches/numpy.scons/numpy/core/SConstruct 2007-10-26 02:39:59 UTC (rev 4295)
@@ -1,4 +1,4 @@
-# Last Change: Thu Oct 25 04:00 PM 2007 J
+# Last Change: Fri Oct 26 11:00 AM 2007 J
# vim:syntax=python
import os
import sys
@@ -88,7 +88,6 @@
mlibs = [[], ['m'], ['cpml']]
mathlib = os.environ.get('MATHLIB')
if mathlib:
- # XXX: prepend it
mlibs.insert(0, mathlib)
for mlib in mlibs:
st = config.CheckBrokenMathlib(mlib)
@@ -99,7 +98,7 @@
import SCons
raise SCons.Errors.UserError("No usable mathlib was found: chose another "\
"one using the MATHLIB env variable, eg "\
- "MATHLIB=m")
+ "'MATHLIB=m python setup.py build'")
config_sym.append(('MATHLIB', mlib))
def check_lib(f, autoadd = 0):
@@ -145,7 +144,6 @@
build_blasdot = 1
else:
build_blasdot = 0
-#config.CheckMKL('/home/david/opt/intel/mkl/9.1.023/', '32')
config.Finish()
config_f = open('config.log', 'r')
Modified: branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/custom_checkers.py 2007-10-25 15:07:36 UTC (rev 4294)
+++ branches/numpy.scons/numpy/distutils/scons/custom_checkers.py 2007-10-26 02:39:59 UTC (rev 4295)
@@ -1,5 +1,5 @@
#! /usr/bin/env python
-# Last Change: Thu Oct 25 04:00 PM 2007 J
+# Last Change: Fri Oct 26 11:00 AM 2007 J
# Module for custom, common checkers for numpy (and scipy)
import sys
@@ -7,7 +7,7 @@
from copy import deepcopy
from distutils.util import get_platform
-from libinfo import get_config, get_paths, parse_config_param
+from libinfo import get_config, get_config_from_section
from libinfo_scons import NumpyCheckLib
from testcode_snippets import cblas_sgemm as cblas_src
@@ -104,29 +104,22 @@
return _check_include_and_run(context, 'ATLAS', None, ['atlas_enum.h', 'cblas.h'],
cblas_src, libs, libpath, [], [])
+def CheckAccelerate(context):
+ """Checker for Accelerate framework (on Mac OS X >= 10.3)."""
+
+ linkflags = ['-framework', 'Accelerate']
+
+ return _check_include_and_run(context, 'FRAMEWORK: Accelerate', None,
+ ['Accelerate/Accelerate.h'], cblas_src, [],
+ [], linkflags, [])
+
def CheckCBLAS(context):
# If section cblas is in site.cfg, use those options. Otherwise, use default
section = "cblas"
siteconfig, cfgfiles = get_config()
- if siteconfig.has_section('cblas'):
- import warnings
- import ConfigParser
- warnings.warn('FIXME: site.cfg not support yet')
- try:
- libpath = get_paths(siteconfig.get(section, 'library_dirs'))
- except ConfigParser.NoSectionError, e:
- libpath = []
-
- try:
- cpppath = get_paths(siteconfig.get(section, 'include_dirs'))
- except ConfigParser.NoSectionError, e:
- cpppath = []
-
- try:
- libs = parse_config_param(siteconfig.get(section, 'libraries'))
- except ConfigParser.NoSectionError, e:
- libs = []
+ (cpppath, libs, libpath), found = get_config_from_section(siteconfig, section)
+ if found:
headers = ['cblas.h']
linkflags = []
cflags = []
Modified: branches/numpy.scons/numpy/distutils/scons/libinfo.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/libinfo.py 2007-10-25 15:07:36 UTC (rev 4294)
+++ branches/numpy.scons/numpy/distutils/scons/libinfo.py 2007-10-26 02:39:59 UTC (rev 4295)
@@ -1,5 +1,5 @@
#! /usr/bin/env python
-# Last Change: Thu Oct 25 01:00 PM 2007 J
+# Last Change: Fri Oct 26 11:00 AM 2007 J
# Module for support to look for external code (replacement of
# numpy.distutils.system_info). KEEP THIS INDEPENDANT OF SCONS !
@@ -61,5 +61,30 @@
Example: if var is foo:bar, it will return ['foo', 'bar'] on posix."""
return var.split(os.pathsep)
+def get_config_from_section(siteconfig, section):
+ """For the given siteconfig and section, return the found information.
+
+ Returns a tuple (info, found), where:
+ info : tuple (cpppath, libs, libpath), containing a list of path or libraries
+ found: 1 if the section was found, 0 otherwise."""
+ if siteconfig.has_section(section):
+ try:
+ libpath = get_paths(siteconfig.get(section, 'library_dirs'))
+ except ConfigParser.NoSectionError, e:
+ libpath = []
+
+ try:
+ cpppath = get_paths(siteconfig.get(section, 'include_dirs'))
+ except ConfigParser.NoSectionError, e:
+ cpppath = []
+
+ try:
+ libs = parse_config_param(siteconfig.get(section, 'libraries'))
+ except ConfigParser.NoSectionError, e:
+ libs = []
+ return (cpppath, libs, libpath), 1
+ else:
+ return ([], [], []), 0
+
if __name__ == '__main__':
pass
More information about the Numpy-svn
mailing list