[SciPy-dev] system_info problem
Robert Cimrman
cimrman3 at ntc.zcu.cz
Thu Feb 23 06:46:48 EST 2006
Hi,
I am trying to (finally) move UMFPACK out of the sandbox to the scipy
proper and so I need checking for its libraries via system_info.py of
numpy distutils.
I have added a new section to site.cfg:
[umfpack]
library_dirs =
/home/share/software/packages/UMFPACK/UMFPACK/Lib:/home/share/software/packages/UMFPACK/AMD/Lib
include_dirs = /home/share/software/packages/UMFPACK/UMFPACK/Include
umfpack_libs = umfpack, amd
the names of the libraries are libumfpack.a, libamd.a - they are
correctly found in 'system_info._check_libs()' by
'self._lib_list(lib_dir, libs, exts)', but then the function fails,
since 'len(found_libs) == len(libs)' which is wrong. Can some
numpy.distutils expert help me? Below is the new umfpack_info class I
have written using the blas_info class as template.
yours clueless,
r.
PS: I do this because I prefer having the umfpack installed separately.
It will be used, if present, to replace the default superLU-based sparse
solver. Moving its sources under scipy/Lib/sparse would solve this
issue, but Tim Davis recently changed the license of UMFPACK to GPL, and
so the last version available for the direct inclusion is 4.4. (4.6 is
the current one). Opinions are of course welcome.
--
class umfpack_info(system_info):
section = 'umfpack'
dir_env_var = 'UMFPACK'
_lib_names = ['umfpack', 'amd']
includes = 'umfpack.h'
notfounderror = UmfpackNotFoundError
def calc_info(self):
info = {}
lib_dirs = self.get_lib_dirs()
print lib_dirs
umfpack_libs = self.get_libs('umfpack_libs', self._lib_names)
print umfpack_libs
for d in lib_dirs:
libs = self.check_libs(d,umfpack_libs,[])
print d, libs
if libs is not None:
dict_append(info,libraries=libs)
break
else:
return
include_dirs = self.get_include_dirs()
print include_dirs
h = (self.combine_paths(lib_dirs+include_dirs,includes) or
[None])[0]
if h:
h = os.path.dirname(h)
dict_append(info,include_dirs=[h])
print info
self.set_info(**info)
More information about the SciPy-Dev
mailing list