PyXMake Developer Guide 1.0
PyXMake
Loading...
Searching...
No Matches
PyXMake.Build.Make.Fortran Class Reference

Base class for all Fortran build events. More...

Inheritance diagram for PyXMake.Build.Make.Fortran:
PyXMake.Build.Make.Make PyXMake.Build.Make.NT PyXMake.Build.Make.POSIX PyXMake.Tools.Utility.AbstractBase PyXMake.Build.Make.OS PyXMake.Build.Make.OS PyXMake.Tools.Utility.AbstractBase PyXMake.Tools.Utility.AbstractBase

Public Member Functions

 __init__ (self, *args, **kwargs)
 
 OutputPath (self, modulepath=None, libpath=os.getcwd())
 
 Preprocessing (self, inend='', outend='', copyfiles=[], replace={'!DEC$ IF':'#IF','!DEC$ ELSE':'#ELSE','!DEC$ ENDIF':'#ENDIF'}, decorator="!DEC$ ATTRIBUTES DLLEXPORT::")
 
 Wrapper (self, module_name, source_name=None)
 
 Build (self, cmdstring, **kwargs)
 
 create (self, **kwargs)
 
- Public Member Functions inherited from PyXMake.Build.Make.Make
 __posix__ (self, **kwargs)
 
 AddIncludePath (self, includes)
 
 AddDependencyPath (self, dependencies)
 
 UseLibraries (self, libs)
 
 SourcePath (self, path)
 
 Environment (self, path, script="ifortvars.bat")
 
 Postprocessing (self, cmdstring='')
 
 run (cls, **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)
 
- Public Member Functions inherited from PyXMake.Build.Make.NT
- Public Member Functions inherited from PyXMake.Build.Make.OS
- Public Member Functions inherited from PyXMake.Build.Make.POSIX
 __create__ (self, **kwargs)
 

Public Attributes

str MakeObjectKind = "gfortran"
 String identifier of current instance.
 
bool isStatic = True if kwargs.get('lib', 'static') not in ['shared', 'SHARED', 'Shared'] else False
 Static or dynamic link library flag.
 
str architecture = "x86":
 
 libs = list(Utility.ArbitraryFlattening(self.libs))
 
tuple libname = ("lib" if Utility.GetPlatform() in ["linux"] else "") + self.buildid + self.architecture
 Name of library, assembled using BuildID.
 
tuple buildname = self.libname
 Temporary build name.
 
 incremental = kwargs.get("incremental",False)
 
str intermediate_wrapper = ""
 Wrapper interface file for 3rd party FORTRAN code.
 
str wrapper_source = ""
 
str wrapper_module = "pyx_module.f90"
 
list linkedIn = []
 List of libraries which should be statically linked in.
 
list libdirs = []
 Blank version of list containing library directories without initially specifying MKL.
 
 hasFoss
 
 outmodule = modulepath
 Output path for module or header files.
 
 outlibs = libpath
 Output path for library files.
 
 scrtdir = Utility.GetTemporaryFileName(extension=str(os.path.splitext(TmpFile)[1]))
 
str buildname
 
 precmd = _preprocessing
 
 temps = self.temps + (TmpFile, self.intermediate_wrapper, self.wrapper_module, )
 
str incremental = ' -object:'+self.libname+' -module:'+self.outmodule+' -I:"'+self.outmodule+'"'
 
str isStatic = 'link -dll -fixed:no -defaultlib:libcmt.lib -nodefaultlib:msvcrt.lib '
 
 compargs = cmdstring
 Used defined command line options.
 
str makecmd = self.iniCompiler+" "
 Intel Compiler command.
 
tuple linkcmd = librarian +self.libname+'.obj -nologo -machine:'+self.architecture+' -out:'+os.path.join(self.outlibs,self.libname+ext)
 Intel Linker command.
 
 verbose = self.scrtdir)
 
str postcmd = '':
 
- Public Attributes inherited from PyXMake.Build.Make.Make
 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
 
- Public Attributes inherited from PyXMake.Build.Make.NT
str SystemObjectKind = "NT"
 String identifier of current instance.
 
- Public Attributes inherited from PyXMake.Build.Make.OS
str SystemObjectKind = "Base"
 String identifier of current instance.
 
- Public Attributes inherited from PyXMake.Build.Make.POSIX
str SystemObjectKind = "POSIX"
 String identifier of current instance.
 
 scrtdir
 Overwrite create method in all subclasses to use a predefined MakeFile for all builds.
 
 temps = self.temps + ("Makefile",)
 Overwrite create method in all subclasses to use a predefined MakeFile for all builds.
 
 environ = copy.deepcopy(getattr(os.environ,"_data",{}))
 
 precmd = GetPreprocessingCommand(1).split() + self.precmd.split()[4:]; self.precmd.insert(-1,"-o")
 
str precmd = ""
 
 verbose
 
 intermediate_wrapper
 
 wrapper_module = self.scrtdir)
 
 libdirs
 
 outdir
 Accept both OutLibs and OutDir variable.
 
 outlibs = self.outmodule:
 
 outmodule = True)
 

Additional Inherited Members

- Static Public Member Functions inherited from PyXMake.Build.Make.Make
 __parser__ ()
 
 Detach ()
 
 F2CPreprocessing (PreprocessingFile)
 
 sanitize (string, **kwargs)
 
 setup (*args, **kwargs)
 
- Static Public Member Functions inherited from PyXMake.Tools.Utility.AbstractBase
 __getbase__ (base, cls)
 
- Protected Attributes inherited from PyXMake.Build.Make.Make
list _mkl_includes = [x for x in self.incdirs if "mkl" in x]
 

Detailed Description

Base class for all Fortran build events.

Inherited class to build projects using Intel Fortran.

Inherited from Make and flavors in dependence of the underlying or requested operating system (optionally).

Constructor & Destructor Documentation

◆ __init__()

PyXMake.Build.Make.Fortran.__init__ ( self,
* args,
** kwargs )
Initialization of Fortran class object.

Reimplemented from PyXMake.Build.Make.Make.

Definition at line 1551 of file Make.py.

Member Function Documentation

◆ Build()

PyXMake.Build.Make.Fortran.Build ( self,
cmdstring,
** kwargs )
Assemble command strings for the main build event.

Reimplemented from PyXMake.Build.Make.Make.

Definition at line 1681 of file Make.py.

◆ create()

PyXMake.Build.Make.Fortran.create ( self,
** kwargs )
Execute make command

Reimplemented from PyXMake.Build.Make.Make.

Definition at line 1736 of file Make.py.

◆ OutputPath()

PyXMake.Build.Make.Fortran.OutputPath ( self,
modulepath = None,
libpath = os.getcwd() )
Define output directories for modules and libraries. 

Reimplemented from PyXMake.Build.Make.Make.

Definition at line 1602 of file Make.py.

◆ Preprocessing()

PyXMake.Build.Make.Fortran.Preprocessing ( self,
inend = '',
outend = '',
copyfiles = [],
replace = {'!DEC$ IF':'#IF','!DEC$ ELSE':'#ELSE','!DEC$ ENDIF':'#ENDIF'},
decorator = "!DEC$ ATTRIBUTES DLLEXPORT::" )
Assemble command string for the pre-build event.

Reimplemented from PyXMake.Build.Make.Make.

Definition at line 1615 of file Make.py.

◆ Wrapper()

PyXMake.Build.Make.Fortran.Wrapper ( self,
module_name,
source_name = None )
Assemble command string for the pre-build event.

Definition at line 1658 of file Make.py.

Member Data Documentation

◆ architecture

str PyXMake.Build.Make.Fortran.architecture = "x86":

Definition at line 1564 of file Make.py.

◆ buildname [1/2]

tuple PyXMake.Build.Make.Fortran.buildname = self.libname

Temporary build name.


Definition at line 1578 of file Make.py.

◆ buildname [2/2]

str PyXMake.Build.Make.Fortran.buildname

Definition at line 1636 of file Make.py.

◆ compargs

PyXMake.Build.Make.Fortran.compargs = cmdstring

Used defined command line options.

Definition at line 1709 of file Make.py.

◆ hasFoss

PyXMake.Build.Make.Fortran.hasFoss

Definition at line 1598 of file Make.py.

◆ incremental [1/2]

PyXMake.Build.Make.Fortran.incremental = kwargs.get("incremental",False)

Definition at line 1581 of file Make.py.

◆ incremental [2/2]

str PyXMake.Build.Make.Fortran.incremental = ' -object:'+self.libname+' -module:'+self.outmodule+' -I:"'+self.outmodule+'"'

Definition at line 1688 of file Make.py.

◆ intermediate_wrapper

PyXMake.Build.Make.Fortran.intermediate_wrapper = ""

Wrapper interface file for 3rd party FORTRAN code.

Automatically creates a module of the underlying source material.

Definition at line 1585 of file Make.py.

◆ isStatic [1/2]

PyXMake.Build.Make.Fortran.isStatic = True if kwargs.get('lib', 'static') not in ['shared', 'SHARED', 'Shared'] else False

Static or dynamic link library flag.

Definition at line 1560 of file Make.py.

◆ isStatic [2/2]

str PyXMake.Build.Make.Fortran.isStatic = 'link -dll -fixed:no -defaultlib:libcmt.lib -nodefaultlib:msvcrt.lib '

Definition at line 1700 of file Make.py.

◆ libdirs

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

Blank version of list containing library directories without initially specifying MKL.


Definition at line 1595 of file Make.py.

◆ libname

tuple PyXMake.Build.Make.Fortran.libname = ("lib" if Utility.GetPlatform() in ["linux"] else "") + self.buildid + self.architecture

Name of library, assembled using BuildID.

Definition at line 1576 of file Make.py.

◆ libs

PyXMake.Build.Make.Fortran.libs = list(Utility.ArbitraryFlattening(self.libs))

Definition at line 1571 of file Make.py.

◆ linkcmd

tuple PyXMake.Build.Make.Fortran.linkcmd = librarian +self.libname+'.obj -nologo -machine:'+self.architecture+' -out:'+os.path.join(self.outlibs,self.libname+ext)

Intel Linker command.

Definition at line 1727 of file Make.py.

◆ linkedIn

list PyXMake.Build.Make.Fortran.linkedIn = []

List of libraries which should be statically linked in.

Definition at line 1591 of file Make.py.

◆ makecmd

str PyXMake.Build.Make.Fortran.makecmd = self.iniCompiler+" "

Intel Compiler command.

Definition at line 1711 of file Make.py.

◆ MakeObjectKind

str PyXMake.Build.Make.Fortran.MakeObjectKind = "gfortran"

String identifier of current instance.


Definition at line 1557 of file Make.py.

◆ outlibs

PyXMake.Build.Make.Fortran.outlibs = libpath

Output path for library files.

Definition at line 1612 of file Make.py.

◆ outmodule

PyXMake.Build.Make.Fortran.outmodule = modulepath

Output path for module or header files.


Definition at line 1610 of file Make.py.

◆ postcmd

PyXMake.Build.Make.Fortran.postcmd = '':

Definition at line 1784 of file Make.py.

◆ precmd

PyXMake.Build.Make.Fortran.precmd = _preprocessing

Definition at line 1655 of file Make.py.

◆ scrtdir

PyXMake.Build.Make.Fortran.scrtdir = Utility.GetTemporaryFileName(extension=str(os.path.splitext(TmpFile)[1]))

Definition at line 1631 of file Make.py.

◆ temps

PyXMake.Build.Make.Fortran.temps = self.temps + (TmpFile, self.intermediate_wrapper, self.wrapper_module, )

Definition at line 1678 of file Make.py.

◆ verbose

PyXMake.Build.Make.Fortran.verbose = self.scrtdir)

Definition at line 1748 of file Make.py.

◆ wrapper_module

PyXMake.Build.Make.Fortran.wrapper_module = "pyx_module.f90"

Definition at line 1587 of file Make.py.

◆ wrapper_source

PyXMake.Build.Make.Fortran.wrapper_source = ""

Definition at line 1586 of file Make.py.


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