Serializable platform configuration (compiler + OS only)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=compiler_enum), | public | :: | compiler | = | id_all | ||
integer, | public | :: | os_type | = | OS_ALL |
Initialize a new platform config from compiler name Automatically selects correct Intel compiler version based on OS
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | compiler | |||
integer, | intent(in) | :: | os_type |
Initialize a new platform config from compiler enum ID
Automatically selects correct Intel compiler version based on OS
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=compiler_enum), | intent(in) | :: | compiler_id | |||
integer, | intent(in) | :: | os_type |
Properties
Whether the configuration is generic
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
Get compiler name as string
Get compiler name as string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
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 to TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(inout) | :: | self | |||
type(toml_table), | intent(inout) | :: | table | |||
type(error_t), | intent(out), | allocatable | :: | error |
Print information
Write information on instance (similar style to profile_config_t%info)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self | |||
integer, | intent(in) | :: | unit | |||
integer, | intent(in), | optional | :: | verbosity |
Validation
Check if a platform configuration is valid (no unknowns, compatible compiler+OS)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
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 |
Load from TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(inout) | :: | self | |||
type(toml_table), | intent(inout) | :: | table | |||
type(error_t), | intent(out), | allocatable | :: | error |
Return .true. if THIS platform selector is compatible with CURRENT (wildcards allowed)
Return .true. if SELF is suitable for a given target platform
Rules: - compiler matches if SELF%compiler == id_all OR == target%compiler - os matches if SELF%os_type == OS_ALL OR == target%os_type - id_unknown / OS_UNKNOWN in SELF are treated as “no match” (conservative) - Intel compilers must match OS (ifort unix/windows versions use different flags)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self | |||
type(platform_config_t), | intent(in) | :: | target |
Get configuration name as it appears in the manifest
Get configuration name
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
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 |
Get OS name as string
Get OS name as string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_t), | intent(in) | :: | self |
Compare two platform_config_t (semantic equality)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(platform_config_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 |
type, extends(serializable_t) :: platform_config_t integer(compiler_enum) :: compiler = id_all integer :: os_type = OS_ALL contains procedure :: serializable_is_same => platform_is_same procedure :: dump_to_toml procedure :: load_from_toml !> Print information procedure :: info !> Return .true. if THIS platform selector is compatible with CURRENT (wildcards allowed) procedure :: matches => platform_is_suitable !> Get compiler name as string procedure :: compiler_name => platform_compiler_name !> Get OS name as string procedure :: os_name => platform_os_name !> Get configuration name as it appears in the manifest procedure :: name => platform_config_name !> Validation procedure :: is_valid => platform_is_valid !> Properties procedure, non_overridable :: any_compiler procedure, non_overridable :: any_os procedure, non_overridable :: any_platform end type platform_config_t