summaryrefslogtreecommitdiff
path: root/numpy/distutils/system_info.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/distutils/system_info.py')
-rw-r--r--numpy/distutils/system_info.py89
1 files changed, 83 insertions, 6 deletions
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index d5a1687da..3dca7fb5a 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -62,6 +62,7 @@ Currently, the following classes are available, along with their section names:
blas_ilp64_plain_opt_info:ALL # usage recommended (general ILP64 BLAS, no symbol suffix)
blas_info:blas
blas_mkl_info:mkl
+ blas_ssl2_info:ssl2
blas_opt_info:ALL # usage recommended
blas_src_info:blas_src
blis_info:blis
@@ -93,9 +94,11 @@ Currently, the following classes are available, along with their section names:
lapack_ilp64_plain_opt_info:ALL # usage recommended (general ILP64 LAPACK, no symbol suffix)
lapack_info:lapack
lapack_mkl_info:mkl
+ lapack_ssl2_info:ssl2
lapack_opt_info:ALL # usage recommended
lapack_src_info:lapack_src
mkl_info:mkl
+ ssl2_info:ssl2
numarray_info:numarray
numerix_info:numerix
numpy_info:numpy
@@ -519,6 +522,7 @@ def get_info(name, notfound_action=0):
'lapack_atlas_3_10_threads': lapack_atlas_3_10_threads_info, # ditto
'flame': flame_info, # use lapack_opt instead
'mkl': mkl_info,
+ 'ssl2': ssl2_info,
# openblas which may or may not have embedded lapack
'openblas': openblas_info, # use blas_opt instead
# openblas with embedded lapack
@@ -527,6 +531,8 @@ def get_info(name, notfound_action=0):
'blis': blis_info, # use blas_opt instead
'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
'blas_mkl': blas_mkl_info, # use blas_opt instead
+ 'lapack_ssl2': lapack_ssl2_info,
+ 'blas_ssl2': blas_ssl2_info,
'accelerate': accelerate_info, # use blas_opt instead
'openblas64_': openblas64__info,
'openblas64__lapack': openblas64__lapack_info,
@@ -1260,7 +1266,7 @@ class mkl_info(system_info):
paths = os.environ.get('LD_LIBRARY_PATH', '').split(os.pathsep)
ld_so_conf = '/etc/ld.so.conf'
if os.path.isfile(ld_so_conf):
- with open(ld_so_conf, 'r') as f:
+ with open(ld_so_conf) as f:
for d in f:
d = d.strip()
if d:
@@ -1325,6 +1331,63 @@ class blas_mkl_info(mkl_info):
pass
+class ssl2_info(system_info):
+ section = 'ssl2'
+ dir_env_var = 'SSL2_DIR'
+ # Multi-threaded version. Python itself must be built by Fujitsu compiler.
+ _lib_ssl2 = ['fjlapackexsve']
+ # Single-threaded version
+ #_lib_ssl2 = ['fjlapacksve']
+
+ def get_tcsds_rootdir(self):
+ tcsdsroot = os.environ.get('TCSDS_PATH', None)
+ if tcsdsroot is not None:
+ return tcsdsroot
+ return None
+
+ def __init__(self):
+ tcsdsroot = self.get_tcsds_rootdir()
+ if tcsdsroot is None:
+ system_info.__init__(self)
+ else:
+ system_info.__init__(
+ self,
+ default_lib_dirs=[os.path.join(tcsdsroot, 'lib64')],
+ default_include_dirs=[os.path.join(tcsdsroot,
+ 'clang-comp/include')])
+
+ def calc_info(self):
+ tcsdsroot = self.get_tcsds_rootdir()
+
+ lib_dirs = self.get_lib_dirs()
+ if lib_dirs is None:
+ lib_dirs = os.path.join(tcsdsroot, 'lib64')
+
+ incl_dirs = self.get_include_dirs()
+ if incl_dirs is None:
+ incl_dirs = os.path.join(tcsdsroot, 'clang-comp/include')
+
+ ssl2_libs = self.get_libs('ssl2_libs', self._lib_ssl2)
+
+ info = self.check_libs2(lib_dirs, ssl2_libs)
+ if info is None:
+ return
+ dict_append(info,
+ define_macros=[('HAVE_CBLAS', None),
+ ('HAVE_SSL2', 1)],
+ include_dirs=incl_dirs,)
+ self.set_info(**info)
+
+
+class lapack_ssl2_info(ssl2_info):
+ pass
+
+
+class blas_ssl2_info(ssl2_info):
+ pass
+
+
+
class armpl_info(system_info):
section = 'armpl'
dir_env_var = 'ARMPL_DIR'
@@ -1787,7 +1850,7 @@ class lapack_opt_info(system_info):
notfounderror = LapackNotFoundError
# List of all known LAPACK libraries, in the default order
- lapack_order = ['armpl', 'mkl', 'openblas', 'flame',
+ lapack_order = ['armpl', 'mkl', 'ssl2', 'openblas', 'flame',
'accelerate', 'atlas', 'lapack']
order_env_var_name = 'NPY_LAPACK_ORDER'
@@ -1805,6 +1868,13 @@ class lapack_opt_info(system_info):
return True
return False
+ def _calc_info_ssl2(self):
+ info = get_info('lapack_ssl2')
+ if info:
+ self.set_info(**info)
+ return True
+ return False
+
def _calc_info_openblas(self):
info = get_info('openblas_lapack')
if info:
@@ -1971,7 +2041,7 @@ class blas_opt_info(system_info):
notfounderror = BlasNotFoundError
# List of all known BLAS libraries, in the default order
- blas_order = ['armpl', 'mkl', 'blis', 'openblas',
+ blas_order = ['armpl', 'mkl', 'ssl2', 'blis', 'openblas',
'accelerate', 'atlas', 'blas']
order_env_var_name = 'NPY_BLAS_ORDER'
@@ -1989,6 +2059,13 @@ class blas_opt_info(system_info):
return True
return False
+ def _calc_info_ssl2(self):
+ info = get_info('blas_ssl2')
+ if info:
+ self.set_info(**info)
+ return True
+ return False
+
def _calc_info_blis(self):
info = get_info('blis')
if info:
@@ -2190,7 +2267,7 @@ class blas_info(system_info):
}""")
src = os.path.join(tmpdir, 'source.c')
try:
- with open(src, 'wt') as f:
+ with open(src, 'w') as f:
f.write(s)
try:
@@ -2345,7 +2422,7 @@ class openblas_info(blas_info):
except Exception:
extra_args = []
try:
- with open(src, 'wt') as f:
+ with open(src, 'w') as f:
f.write(s)
obj = c.compile([src], output_dir=tmpdir)
try:
@@ -2456,7 +2533,7 @@ class flame_info(system_info):
# Add the additional "extra" arguments
extra_args = info.get('extra_link_args', [])
try:
- with open(src, 'wt') as f:
+ with open(src, 'w') as f:
f.write(s)
obj = c.compile([src], output_dir=tmpdir)
try: