[Scipy-svn] r4933 - trunk/scipy/sparse/linalg/eigen/arpack

scipy-svn@scip... scipy-svn@scip...
Sun Nov 2 19:32:54 CST 2008


Author: cdavid
Date: 2008-11-02 19:32:36 -0600 (Sun, 02 Nov 2008)
New Revision: 4933

Modified:
   trunk/scipy/sparse/linalg/eigen/arpack/setup.py
Log:
Adapt distutils build to deal with C/F ABI wrappers for arpack.

Modified: trunk/scipy/sparse/linalg/eigen/arpack/setup.py
===================================================================
--- trunk/scipy/sparse/linalg/eigen/arpack/setup.py	2008-11-03 01:28:54 UTC (rev 4932)
+++ trunk/scipy/sparse/linalg/eigen/arpack/setup.py	2008-11-03 01:32:36 UTC (rev 4933)
@@ -1,7 +1,23 @@
 #!/usr/bin/env python
-
+import re
 from os.path import join
 
+def needs_veclib_wrapper(info):
+    """Returns true if needs special veclib wrapper.""" 
+    import re
+    r_accel = re.compile("Accelerate")
+    r_vec = re.compile("vecLib")
+    res = False
+    try:
+        tmpstr = info['extra_link_args']
+        for i in tmpstr:
+            if r_accel.search(i) or r_vec.search(i):
+                res = True
+    except KeyError:
+        pass
+
+    return res
+
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.system_info import get_info, NotFoundError
     from numpy.distutils.misc_util import Configuration
@@ -19,6 +35,12 @@
     arpack_sources.extend([join('ARPACK','UTIL', '*.f')])
     arpack_sources.extend([join('ARPACK','LAPACK', '*.f')])
 
+    if needs_veclib_wrapper(lapack_opt):
+        arpack_src += [pjoin('ARPACK', 'FWRAPPERS', 'veclib_cabi_f.f'),
+                       pjoin('ARPACK', 'FWRAPPERS', 'veclib_cabi_c.c')]
+    else:
+        arpack_src += [pjoin('ARPACK', 'FWRAPPERS', 'dummy.f')]
+
     config.add_library('arpack', sources=arpack_sources,
                        include_dirs=[join('ARPACK', 'SRC')])
 



More information about the Scipy-svn mailing list