MCPcopy Create free account
hub / github.com/numpy/numpy / get_mkl_rootdir

Method get_mkl_rootdir

numpy/distutils/system_info.py:1264–1290  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1262 _lib_mkl = ['mkl_rt']
1263
1264 def get_mkl_rootdir(self):
1265 mklroot = os.environ.get('MKLROOT', None)
1266 if mklroot is not None:
1267 return mklroot
1268 paths = os.environ.get('LD_LIBRARY_PATH', '').split(os.pathsep)
1269 ld_so_conf = '/etc/ld.so.conf'
1270 if os.path.isfile(ld_so_conf):
1271 with open(ld_so_conf) as f:
1272 for d in f:
1273 d = d.strip()
1274 if d:
1275 paths.append(d)
1276 intel_mkl_dirs = []
1277 for path in paths:
1278 path_atoms = path.split(os.sep)
1279 for m in path_atoms:
1280 if m.startswith('mkl'):
1281 d = os.sep.join(path_atoms[:path_atoms.index(m) + 2])
1282 intel_mkl_dirs.append(d)
1283 break
1284 for d in paths:
1285 dirs = glob(os.path.join(d, 'mkl', '*'))
1286 dirs += glob(os.path.join(d, 'mkl*'))
1287 for sub_dir in dirs:
1288 if os.path.isdir(os.path.join(sub_dir, 'lib')):
1289 return sub_dir
1290 return None
1291
1292 def __init__(self):
1293 mklroot = self.get_mkl_rootdir()

Callers 1

__init__Method · 0.95

Calls 7

openFunction · 0.85
stripMethod · 0.80
startswithMethod · 0.80
getMethod · 0.45
splitMethod · 0.45
joinMethod · 0.45
indexMethod · 0.45

Tested by

no test coverage detected