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 |
Fortran feature support
Run a single-source Fortran program using the current compiler Compile a Fortran object Create temporary source file Write contents Compile and link program Run and retrieve exit code
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
character(len=*), | intent(in) | :: | input |
Program Source |
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 |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Write serializable object to file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Write serializable object to a formatted Fortran unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
Formatted unit |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format requested? |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
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 |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency tree from file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency tree from file init JSON interpreter Read object from TOML table
use default TOML parser
Read object from TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
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
Check that two source files are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Serialization interface
Check that two compiler_t objects are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Test load/write roundtrip
Test serialization of a serializable object Dump to scratch file Load from scratch file Check same
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | message | |||
type(error_t), | intent(out), | allocatable | :: | error |
Check if the current compiler supports 128-bit real precision
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
Check if the current compiler supports 80-bit “extended” real precision
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
type, extends(serializable_t) :: 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 !> Serialization interface procedure :: serializable_is_same => compiler_is_same procedure :: dump_to_toml => compiler_dump procedure :: load_from_toml => compiler_load !> Fortran feature support procedure :: check_fortran_source_runs procedure :: with_xdp procedure :: with_qp !> Return compiler name procedure :: name => compiler_name end type compiler_t