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)
| 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 = [], [], [] |
no test coverage detected