PyXMake Developer Guide: PyXMake.Build.Make.Make Class Reference

| PyXMake Developer Guide 1.0 PyXMake

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Attributes | List of all members
PyXMake.Build.Make.Make Class Reference

Abstract base class for all make objects. More...

Inheritance diagram for PyXMake.Build.Make.Make:

## Public Member Functions
| __init__ (self, BuildID, Srcs, scratch=os.getcwd(), verbose=0, *args, **kwargs)
| __posix__ (self, **kwargs)
| AddIncludePath (self, includes)
| AddDependencyPath (self, dependencies)
| UseLibraries (self, libs)
| SourcePath (self, path)
| OutputPath (self, path, files="")
| Environment (self, path, script="ifortvars.bat")
| Preprocessing (self, cmdstring='', inend='', outend='', copyfiles=[], replace={'!DEC$ IF':'#IF','!DEC$ ELSE':'#ELSE','!DEC$ ENDIF':'#ENDIF'})
| Build (self, cmdstring, **kwargs)
| Postprocessing (self, cmdstring='')
| run (cls, **kwargs)
| create (self, **kwargs)
Public Member Functions inherited from PyXMake.Tools.Utility.AbstractBase
| __new__ (cls, *args, **kwargs)
| recover (cls, *args)
| classify (cls, *args, **kwargs)
| jsonify (self)
| update (self, **kwargs)
| __repr__ (self)
| __str__ (self)
| __getstate__ (self)
| __setstate__ (self, _dict)

## Static Public Member Functions
| __parser__ ()
| Detach ()
| F2CPreprocessing (PreprocessingFile)
| sanitize (string, **kwargs)
| setup (*args, **kwargs)
Static Public Member Functions inherited from PyXMake.Tools.Utility.AbstractBase
| __getbase__ (base, cls)

## Public Attributes
| buildid = BuildID
| Base string of build object.
list | srcs = []
| Source file or folders.
list | bare = not BuildID and not self.srcs
| stype = kwargs.get("stype",'Fortran')
| Source file type.
| verbose = verbose
| Level of verbosity of the current build object.
| hasFoss = kwargs.get("foss", Utility.GetExecutable("choco") or Utility.GetPlatform() in ["linux"] or kwargs.get("bash",False))
| Toggle between free open source software and commercial 3rd party libraries.
| scrtdir = os.getcwd()
| Current scratch directory
| srcdir = os.getcwd()
| Default search directory for source files.
| outdir = os.getcwd()
| Default search directory for output.
_, self.intelpath, self.iniCompiler | intelpath = content
| Path to Intel Fortran Compiler (read from Paths.log or empty).
tuple | temps = ()
| Tuple of data to be removed after job completion.
list | incdirs = []
| List of include directories.
list | libdirs = []
| List of library directories.
list | libs = []
| List of actual libraries (by name) used during linking.
list | copyfiles = []
| List of files to be copied to the output directory after finish.
str | iniCompiler = ""
| Default initialization of compiler script.
bool | setarch = True if kwargs.get('arch', None) in ['x86', 'x64'] else False
| Define the architecture for the build directly by using the keyword argument "arch".
| msvsc = kwargs.get("msvsc",'vs2015')
| Default version of Microsoft visual studio used by the Intel Fortran Compiler.
str | architecture = 'x86'
| Processor architecture.
str | postcmd = ""
| Post build command.
| buildname = self.temps + (inputfile, )
str | precmd = self.iniCompiler+" "+cmdstring
| Command executed during pre-build event.
| compargs = cmdstring
| Command line arguments passed in by the user.
str | makecmd = self.iniCompiler+" "+os.path.join(self.path2exe,self.exe)+" "+ cmd + cmdstring
| Command executed during build event.
| mkl_dependency

## Protected Attributes
list | _mkl_includes = [x for x in self.incdirs if "mkl" in x]

## Detailed Description

Abstract base class for all make objects.

    Parent class for all make objects.

Inherited from built-in ABCMeta & object. Compatible with both Python 2.x and 3.x.

## Constructor & Destructor Documentation

## ◆ __init__()

PyXMake.Build.Make.Make.__init__ | ( |  | self,
|  |  | BuildID,
|  |  | Srcs,
|  |  | scratch = os.getcwd(),
|  |  | verbose = 0,
|  | * | args,
|  | ** | kwargs )

    Low-level initialization of parent class.

Reimplemented from PyXMake.Tools.Utility.AbstractBase.

Reimplemented in PyXMake.Build.Make.CCxx, PyXMake.Build.Make.Coverage, PyXMake.Build.Make.Custom, PyXMake.Build.Make.Doxygen, PyXMake.Build.Make.Fortran, PyXMake.Build.Make.Latex, PyXMake.Build.Make.NSIS, PyXMake.Build.Make.Py2X, PyXMake.Build.Make.PyInstaller, PyXMake.Build.Make.PyReq, PyXMake.Build.Make.Sphinx, and PyXMake.Build.Make.SSH.

Definition at line 461 of file Make.py.

## Member Function Documentation

## ◆ __parser__()

PyXMake.Build.Make.Make.__parser__ | ( |  | ) |
| static

    Default parser object for command line interface

    @author: Marc Garbade

Definition at line 622 of file Make.py.

## ◆ __posix__()

PyXMake.Build.Make.Make.__posix__ | ( |  | self,
|  | ** | kwargs )

    Request compatibility with Mingw64 and Linux.

Definition at line 602 of file Make.py.

## ◆ AddDependencyPath()

PyXMake.Build.Make.Make.AddDependencyPath | ( |  | self,
|  |  | dependencies )

    Define additional directories containing 3rd party libraries as comma separated list.

Definition at line 742 of file Make.py.

## ◆ AddIncludePath()

PyXMake.Build.Make.Make.AddIncludePath | ( |  | self,
|  |  | includes )

    Define additional include directories containing modules or source files as comma separated list.

Definition at line 734 of file Make.py.

## ◆ Build()

PyXMake.Build.Make.Make.Build | ( |  | self,
|  |  | cmdstring,
|  | ** | kwargs )

    Assemble command string for the main build event.

Reimplemented in PyXMake.Build.Make.CCxx, PyXMake.Build.Make.Coverage, PyXMake.Build.Make.Custom, PyXMake.Build.Make.Fortran, PyXMake.Build.Make.PyInstaller, and PyXMake.Build.Make.SSH.

Definition at line 883 of file Make.py.

## ◆ create()

PyXMake.Build.Make.Make.create | ( |  | self,
|  | ** | kwargs )

    Execute make command

Reimplemented in PyXMake.Build.Make.CCxx, PyXMake.Build.Make.Coverage, PyXMake.Build.Make.Fortran, PyXMake.Build.Make.Latex, PyXMake.Build.Make.NSIS, PyXMake.Build.Make.PyInstaller, PyXMake.Build.Make.PyReq, PyXMake.Build.Make.Sphinx, and PyXMake.Build.Make.SSH.

Definition at line 1024 of file Make.py.

## ◆ Detach()

PyXMake.Build.Make.Make.Detach | ( |  | ) |
| static

    Detach current console window from parent window.

    @author: Marc Garbade

Definition at line 642 of file Make.py.

## ◆ Environment()

PyXMake.Build.Make.Make.Environment | ( |  | self,
|  |  | path,
|  |  | script = "ifortvars.bat" )

    Load an additional environment file prior to execution of all commands.

Reimplemented in PyXMake.Build.Make.SSH.

Definition at line 783 of file Make.py.

## ◆ F2CPreprocessing()

PyXMake.Build.Make.Make.F2CPreprocessing | ( |  | PreprocessingFile | ) |
| static

    Replace incompatible Fortran PreProcessing directives with its C++ counterparts.

    @author: schu_a1

Definition at line 662 of file Make.py.

## ◆ OutputPath()

PyXMake.Build.Make.Make.OutputPath | ( |  | self,
|  |  | path,
|  |  | files = "" )

    Define a new output directory. Output is written to the workspace by default.

Reimplemented in PyXMake.Build.Make.CCxx, PyXMake.Build.Make.Fortran, and PyXMake.Build.Make.SSH.

Definition at line 769 of file Make.py.

## ◆ Postprocessing()

PyXMake.Build.Make.Make.Postprocessing | ( |  | self,
|  |  | cmdstring = '' )

    Assemble command string for the post-build event.

Reimplemented in PyXMake.Build.Make.SSH.

Definition at line 914 of file Make.py.

## ◆ Preprocessing()

PyXMake.Build.Make.Make.Preprocessing | ( |  | self,
|  |  | cmdstring = '',
|  |  | inend = '',
|  |  | outend = '',
|  |  | copyfiles = [],
|  |  | replace = {'!DEC$ IF':'#IF','!DEC$ ELSE':'#ELSE','!DEC$ ENDIF':'#ENDIF'} )

    Assemble command string for the pre-build event.

Reimplemented in PyXMake.Build.Make.Fortran, PyXMake.Build.Make.PyInstaller, and PyXMake.Build.Make.PyReq.

Definition at line 813 of file Make.py.

## ◆ run()

PyXMake.Build.Make.Make.run | ( |  | cls,
|  | ** | kwargs )

    Assemble command string for the post-build event.

Definition at line 1015 of file Make.py.

## ◆ sanitize()

PyXMake.Build.Make.Make.sanitize | ( |  | string,
|  | ** | kwargs )
| static

    Provide a dictionary with substrings to replace in the given input.

    @note: Defaults to replace architecture and platform identifiers

Definition at line 923 of file Make.py.

## ◆ setup()

PyXMake.Build.Make.Make.setup | ( | * | args,
|  | ** | kwargs )
| static

    Initialize a predefined compiler tool chain of all requirements are met.

    @note: Only meaningful on NT systems.

Definition at line 937 of file Make.py.

## ◆ SourcePath()

PyXMake.Build.Make.Make.SourcePath | ( |  | self,
|  |  | path )

    Define a new source directory. Input is read from workspace by default.

Definition at line 758 of file Make.py.

## ◆ UseLibraries()

PyXMake.Build.Make.Make.UseLibraries | ( |  | self,
|  |  | libs )

    Define which non-default libraries should be used during linking.

Definition at line 750 of file Make.py.

## Member Data Documentation

## ◆ _mkl_includes

list PyXMake.Build.Make.Make._mkl_includes = [x for x in self.incdirs if "mkl" in x]
| protected

Definition at line 592 of file Make.py.

## ◆ architecture

str PyXMake.Build.Make.Make.architecture = 'x86'

Processor architecture.

Definition at line 542 of file Make.py.

## ◆ bare

list PyXMake.Build.Make.Make.bare = not BuildID and not self.srcs

Definition at line 474 of file Make.py.

## ◆ buildid

PyXMake.Build.Make.Make.buildid = BuildID

Base string of build object.

Defines the base string of the current build object. The final build name used in the instanced objects is assembled using this immutable base id.

Definition at line 468 of file Make.py.

## ◆ buildname

PyXMake.Build.Make.Make.buildname = self.temps + (inputfile, )

Definition at line 822 of file Make.py.

## ◆ compargs

PyXMake.Build.Make.Make.compargs = cmdstring

Command line arguments passed in by the user.

Definition at line 909 of file Make.py.

## ◆ copyfiles

list PyXMake.Build.Make.Make.copyfiles = []

List of files to be copied to the output directory after finish.

to is initial calling script.

List of files copied to the output directory.

Definition at line 520 of file Make.py.

## ◆ hasFoss

PyXMake.Build.Make.Make.hasFoss = kwargs.get("foss", Utility.GetExecutable("choco") or Utility.GetPlatform() in ["linux"] or kwargs.get("bash",False))

Toggle between free open source software and commercial 3rd party libraries.

On POSIX systems, only free open source software is supported. On Windows, the Intel Compiler Library as well as the package manager MINGW64 are natively supported. All other variants have no supported presets.

Definition at line 485 of file Make.py.

## ◆ incdirs

PyXMake.Build.Make.Make.incdirs = []

List of include directories.

Definition at line 512 of file Make.py.

## ◆ iniCompiler

str PyXMake.Build.Make.Make.iniCompiler = ""

Default initialization of compiler script.

Only set on NT systems. There is no compiler initialization script for Linux

Definition at line 524 of file Make.py.

## ◆ intelpath

PyXMake.Build.Make.Make.intelpath = content

Path to Intel Fortran Compiler (read from Paths.log or empty).

Uses absolute system path of MKL library.

Definition at line 504 of file Make.py.

## ◆ libdirs

PyXMake.Build.Make.Make.libdirs = []

List of library directories.

Definition at line 514 of file Make.py.

## ◆ libs

list PyXMake.Build.Make.Make.libs = []

List of actual libraries (by name) used during linking.

Definition at line 516 of file Make.py.

## ◆ makecmd

PyXMake.Build.Make.Make.makecmd = self.iniCompiler+" "+os.path.join(self.path2exe,self.exe)+" "+ cmd + cmdstring

Command executed during build event.

Definition at line 911 of file Make.py.

## ◆ mkl_dependency

PyXMake.Build.Make.Make.mkl_dependency

Definition at line 1059 of file Make.py.

## ◆ msvsc

PyXMake.Build.Make.Make.msvsc = kwargs.get("msvsc",'vs2015')

Default version of Microsoft visual studio used by the Intel Fortran Compiler.

Defaults to 'vs2015'.

Definition at line 531 of file Make.py.

## ◆ outdir

PyXMake.Build.Make.Make.outdir = os.getcwd()

Default search directory for output.

Output directory can be parsed as relative or absolute path w.r.t.

to is initial calling script.

Definition at line 494 of file Make.py.

## ◆ postcmd

PyXMake.Build.Make.Make.postcmd = ""

Post build command.

Defaults to an empty string.

Definition at line 572 of file Make.py.

## ◆ precmd

PyXMake.Build.Make.Make.precmd = self.iniCompiler+" "+cmdstring

Command executed during pre-build event.

Definition at line 877 of file Make.py.

## ◆ scrtdir

PyXMake.Build.Make.Make.scrtdir = os.getcwd()

Current scratch directory

Definition at line 490 of file Make.py.

## ◆ setarch

PyXMake.Build.Make.Make.setarch = True if kwargs.get('arch', None) in ['x86', 'x64'] else False

Define the architecture for the build directly by using the keyword argument "arch".

Defaults to None, in which case the architecture is determined by using the python executable.

Definition at line 528 of file Make.py.

## ◆ srcdir

PyXMake.Build.Make.Make.srcdir = os.getcwd()

Default search directory for source files.

Source directory can be parsed as relative or absolute path w.r.t.

to is initial calling script.

Definition at line 492 of file Make.py.

## ◆ srcs

PyXMake.Build.Make.Make.srcs = []

Source file or folders.

Definition at line 470 of file Make.py.

## ◆ stype

PyXMake.Build.Make.Make.stype = kwargs.get("stype",'Fortran')

Source file type.

Definition at line 476 of file Make.py.

## ◆ temps

tuple PyXMake.Build.Make.Make.temps = ()

Tuple of data to be removed after job completion.

Definition at line 508 of file Make.py.

## ◆ verbose

PyXMake.Build.Make.Make.verbose = verbose

Level of verbosity of the current build object.

Define the verbosity level of the current build object. Defaults to 0 and suppresses all outputs to the command line. A higher value increases the level of verbosity up to a maximum level of 2.

Definition at line 481 of file Make.py.

The documentation for this class was generated from the following file:

- src/PyXMake/Build/Make.py