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

Method customize

numpy/distutils/fcompiler/__init__.py:439–554  ·  view source on GitHub ↗

Customize Fortran compiler. This method gets Fortran compiler specific information from (i) class definition, (ii) environment, (iii) distutils config files, and (iv) command line (later overrides earlier). This method should be always called after constructing a

(self, dist = None)

Source from the content-addressed store, hash-verified

437 ## Public methods:
438
439 def customize(self, dist = None):
440 """Customize Fortran compiler.
441
442 This method gets Fortran compiler specific information from
443 (i) class definition, (ii) environment, (iii) distutils config
444 files, and (iv) command line (later overrides earlier).
445
446 This method should be always called after constructing a
447 compiler instance. But not in __init__ because Distribution
448 instance is needed for (iii) and (iv).
449 """
450 log.info('customize %s' % (self.__class__.__name__))
451
452 self._is_customised = True
453
454 self.distutils_vars.use_distribution(dist)
455 self.command_vars.use_distribution(dist)
456 self.flag_vars.use_distribution(dist)
457
458 self.update_executables()
459
460 # find_executables takes care of setting the compiler commands,
461 # version_cmd, linker_so, linker_exe, ar, and ranlib
462 self.find_executables()
463
464 noopt = self.distutils_vars.get('noopt', False)
465 noarch = self.distutils_vars.get('noarch', noopt)
466 debug = self.distutils_vars.get('debug', False)
467
468 f77 = self.command_vars.compiler_f77
469 f90 = self.command_vars.compiler_f90
470
471 f77flags = []
472 f90flags = []
473 freeflags = []
474 fixflags = []
475
476 if f77:
477 f77 = _shell_utils.NativeParser.split(f77)
478 f77flags = self.flag_vars.f77
479 if f90:
480 f90 = _shell_utils.NativeParser.split(f90)
481 f90flags = self.flag_vars.f90
482 freeflags = self.flag_vars.free
483 # XXX Assuming that free format is default for f90 compiler.
484 fix = self.command_vars.compiler_fix
485 # NOTE: this and similar examples are probably just
486 # excluding --coverage flag when F90 = gfortran --coverage
487 # instead of putting that flag somewhere more appropriate
488 # this and similar examples where a Fortran compiler
489 # environment variable has been customized by CI or a user
490 # should perhaps eventually be more thoroughly tested and more
491 # robustly handled
492 if fix:
493 fix = _shell_utils.NativeParser.split(fix)
494 fixflags = self.flag_vars.fix + f90flags
495
496 oflags, aflags, dflags = [], [], []

Callers 10

customized_fcompilerFunction · 0.80
customized_ccompilerFunction · 0.80
_find_existing_fcompilerFunction · 0.80
show_fcompilersFunction · 0.80
get_flags_archMethod · 0.80
_check_compilerMethod · 0.80
runMethod · 0.80
runMethod · 0.80
build_a_libraryMethod · 0.80
runMethod · 0.80

Calls 11

update_executablesMethod · 0.95
find_executablesMethod · 0.95
set_commandsMethod · 0.95
get_library_dirsMethod · 0.95
get_librariesMethod · 0.95
infoMethod · 0.80
use_distributionMethod · 0.80
startswithMethod · 0.80
getMethod · 0.45
splitMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected