Definition of compiler object
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | cc |
Path to the C compiler |
||
character(len=:), | public, | allocatable | :: | cxx |
Path to the C++ compiler |
||
logical, | public | :: | echo | = | .true. |
Print all commands |
|
character(len=:), | public, | allocatable | :: | fc |
Path to the Fortran compiler |
||
integer(kind=compiler_enum), | public | :: | id | = | id_unknown |
Identifier of the compiler |
|
logical, | public | :: | verbose | = | .true. |
Verbose output of command |
Compile a C object
Compile a C object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
character(len=*), | intent(in) | :: | input |
Source file input |
||
character(len=*), | intent(in) | :: | output |
Output file of object |
||
character(len=*), | intent(in) | :: | args |
Arguments for compiler |
||
character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
integer, | intent(out) | :: | stat |
Status flag |
Compile a CPP object
Compile a CPP object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
character(len=*), | intent(in) | :: | input |
Source file input |
||
character(len=*), | intent(in) | :: | output |
Output file of object |
||
character(len=*), | intent(in) | :: | args |
Arguments for compiler |
||
character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
integer, | intent(out) | :: | stat |
Status flag |
Compile a Fortran object
Compile a Fortran object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
character(len=*), | intent(in) | :: | input |
Source file input |
||
character(len=*), | intent(in) | :: | output |
Output file of object |
||
character(len=*), | intent(in) | :: | args |
Arguments for compiler |
||
character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
integer, | intent(out) | :: | stat |
Status flag |
Enumerate libraries, based on compiler and platform
Enumerate libraries, based on compiler and platform
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | prefix | |||
type(string_t), | intent(in) | :: | libs(:) |
Get default compiler flags
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
logical, | intent(in) | :: | release |
Get feature flag
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | feature |
Get flag for include directories
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | path |
Get flags for the main linking command
Get special flags for the main linker
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | language | |||
character(len=:), | intent(out), | allocatable | :: | flags |
Get flag for module output directories
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | path |
Check whether this is a GNU compiler
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Check whether this is an Intel compiler
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Check whether compiler is recognized
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Link executable
Link an executable
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
character(len=*), | intent(in) | :: | output |
Output file of object |
||
character(len=*), | intent(in) | :: | args |
Arguments for compiler |
||
character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
integer, | intent(out) | :: | stat |
Status flag |
Return compiler name
Return a compiler name string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
Representation as string
type :: compiler_t
!> Identifier of the compiler
integer(compiler_enum) :: id = id_unknown
!> Path to the Fortran compiler
character(len=:), allocatable :: fc
!> Path to the C compiler
character(len=:), allocatable :: cc
!> Path to the C++ compiler
character(len=:), allocatable :: cxx
!> Print all commands
logical :: echo = .true.
!> Verbose output of command
logical :: verbose = .true.
contains
!> Get default compiler flags
procedure :: get_default_flags
!> Get flag for module output directories
procedure :: get_module_flag
!> Get flag for include directories
procedure :: get_include_flag
!> Get feature flag
procedure :: get_feature_flag
!> Get flags for the main linking command
procedure :: get_main_flags
!> Compile a Fortran object
procedure :: compile_fortran
!> Compile a C object
procedure :: compile_c
!> Compile a CPP object
procedure :: compile_cpp
!> Link executable
procedure :: link
!> Check whether compiler is recognized
procedure :: is_unknown
!> Check whether this is an Intel compiler
procedure :: is_intel
!> Check whether this is a GNU compiler
procedure :: is_gnu
!> Enumerate libraries, based on compiler and platform
procedure :: enumerate_libraries
!> Return compiler name
procedure :: name => compiler_name
end type compiler_t