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

Method set_exe

numpy/distutils/fcompiler/__init__.py:312–342  ·  view source on GitHub ↗
(exe_key, f77=None, f90=None)

Source from the content-addressed store, hash-verified

310 "%s value %r is invalid in class %s" %
311 (name, value, self.__class__.__name__))
312 def set_exe(exe_key, f77=None, f90=None):
313 cmd = self.executables.get(exe_key, None)
314 if not cmd:
315 return None
316 # Note that we get cmd[0] here if the environment doesn't
317 # have anything set
318 exe_from_environ = getattr(self.command_vars, exe_key)
319 if not exe_from_environ:
320 possibles = [f90, f77] + self.possible_executables
321 else:
322 possibles = [exe_from_environ] + self.possible_executables
323
324 seen = set()
325 unique_possibles = []
326 for e in possibles:
327 if e == '<F77>':
328 e = f77
329 elif e == '<F90>':
330 e = f90
331 if not e or e in seen:
332 continue
333 seen.add(e)
334 unique_possibles.append(e)
335
336 for exe in unique_possibles:
337 fc_exe = cached_find_executable(exe)
338 if fc_exe:
339 cmd[0] = fc_exe
340 return fc_exe
341 self.set_command(exe_key, None)
342 return None
343
344 ctype = self.compiler_type
345 f90 = set_exe('compiler_f90')

Callers

nothing calls this directly

Calls 3

set_commandMethod · 0.95
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected