summaryrefslogtreecommitdiff
path: root/numpy/distutils/system_info.py
diff options
context:
space:
mode:
authorRobert Cimrman <cimrman3@ntc.zcu.cz>2006-03-27 14:17:54 +0000
committerRobert Cimrman <cimrman3@ntc.zcu.cz>2006-03-27 14:17:54 +0000
commitd3f62a662cb0e4ed514f6c0999ca5930b84c7aeb (patch)
tree6cd27e4fe17857fa9b53b4cbeda87fbc46852535 /numpy/distutils/system_info.py
parent768e57a8cfc5a75a66bc6ed982ee256b3bddc15e (diff)
downloadnumpy-d3f62a662cb0e4ed514f6c0999ca5930b84c7aeb.tar.gz
umfpack detection added
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r--numpy/distutils/system_info.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 644da207c..f7a6d2866 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -33,6 +33,7 @@ classes are available:
gtkp_2_info
xft_info
freetype2_info
+ umfpack_info
Usage:
info_dict = get_info(<name>)
@@ -240,6 +241,7 @@ def get_info(name,notfound_action=0):
'gtk+-2.0':gtkp_2_info,
'xft':xft_info,
'freetype2':freetype2_info,
+ 'umfpack':umfpack_info,
}.get(name.lower(),system_info)
return cl().get_info(notfound_action)
@@ -303,6 +305,13 @@ class NumericNotFoundError(NotFoundError):
class X11NotFoundError(NotFoundError):
"""X11 libraries not found."""
+class UmfpackNotFoundError(NotFoundError):
+ """
+ UMFPACK sparse solver (http://www.cise.ufl.edu/research/sparse/umfpack/)
+ not found. Directories to search for the libraries can be specified in the
+ numpy/distutils/site.cfg file (section [umfpack]) or by setting
+ the UMFPACK environment variable."""
+
class system_info:
""" get_info() is the only public method. Don't use others.
@@ -1667,6 +1676,39 @@ class freetype2_info(_pkg_config_info):
append_config_exe = 'freetype2'
version_macro_name = 'FREETYPE2_VERSION'
+class umfpack_info(system_info):
+ section = 'umfpack'
+ dir_env_var = 'UMFPACK'
+ notfounderror = UmfpackNotFoundError
+
+ def calc_info(self):
+ lib_dirs = self.get_lib_dirs()
+ incl_dirs = self.get_include_dirs()
+ info = {}
+ for lib in ['umfpack', 'amd']:
+ for d in lib_dirs:
+# print d, lib
+ p = self.combine_paths (d,['lib'+lib+'.a'],)
+# print '->', p
+ if p:
+ dict_append( info, extra_objects = p )
+ break
+ p = self.combine_paths (d,['lib'+lib+so_ext])
+ if p:
+ dict_append( info, libraries = [lib], library_dirs = [d] )
+ break
+# print '=>', info
+ if info is None:
+ return
+ for d in incl_dirs:
+# print d
+ if len(self.combine_paths(d,['umfpack.h']))==1:
+ dict_append(info,include_dirs=[d],
+ define_macros=[('SCIPY_UMFPACK_H',None)])
+ self.set_info(**info)
+ return
+ return
+
## def vstr2hex(version):
## bits = []
## n = [24,16,8,4,0]