This module defines compiler options to use for the debug and release builds.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public, | parameter | :: | LANG_C | = | 2 | |
| integer, | public, | parameter | :: | LANG_CXX | = | 3 | |
| integer, | public, | parameter | :: | LANG_FORTRAN | = | 1 |
Source languages |
| integer, | public, | parameter | :: | compiler_enum | = | kind(id_unknown) | |
| character(len=*), | public, | parameter | :: | flag_cray_fixed_form | = | " -ffixed" | |
| character(len=*), | public, | parameter | :: | flag_cray_free_form | = | " -ffree" | |
| character(len=*), | public, | parameter | :: | flag_cray_implicit_typing | = | " -el" | |
| character(len=*), | public, | parameter | :: | flag_cray_no_implicit_typing | = | " -dl" | |
| character(len=*), | public, | parameter | :: | flag_flang_debug | = | " -g" | |
| character(len=*), | public, | parameter | :: | flag_flang_fixed_form | = | " -ffixed-form" | |
| character(len=*), | public, | parameter | :: | flag_flang_free_form | = | " -ffree-form" | |
| character(len=*), | public, | parameter | :: | flag_flang_no_implicit_typing | = | " -fimplicit-none" | |
| character(len=*), | public, | parameter | :: | flag_flang_openmp | = | " -fopenmp" | |
| character(len=*), | public, | parameter | :: | flag_flang_opt | = | " -O3" | |
| character(len=*), | public, | parameter | :: | flag_flang_pic | = | " -fPIC" | |
| character(len=*), | public, | parameter | :: | flag_gnu_backtrace | = | " -fbacktrace" | |
| character(len=*), | public, | parameter | :: | flag_gnu_check | = | " -fcheck=bounds -fcheck=array-temps" | |
| character(len=*), | public, | parameter | :: | flag_gnu_coarray | = | " -fcoarray=single" | |
| character(len=*), | public, | parameter | :: | flag_gnu_debug | = | " -g" | |
| character(len=*), | public, | parameter | :: | flag_gnu_external | = | " -Wimplicit-interface" | |
| character(len=*), | public, | parameter | :: | flag_gnu_fixed_form | = | " -ffixed-form" | |
| character(len=*), | public, | parameter | :: | flag_gnu_free_form | = | " -ffree-form" | |
| character(len=*), | public, | parameter | :: | flag_gnu_limit | = | " -fmax-errors=1" | |
| character(len=*), | public, | parameter | :: | flag_gnu_no_implicit_external | = | " -Werror=implicit-interface" | |
| character(len=*), | public, | parameter | :: | flag_gnu_no_implicit_typing | = | " -fimplicit-none" | |
| character(len=*), | public, | parameter | :: | flag_gnu_openmp | = | " -fopenmp" | |
| character(len=*), | public, | parameter | :: | flag_gnu_opt | = | " -O3 -funroll-loops" | |
| character(len=*), | public, | parameter | :: | flag_gnu_pic | = | " -fPIC" | |
| character(len=*), | public, | parameter | :: | flag_gnu_warn | = | " -Wall -Wextra -Wno-external-argument-mismatch" | |
| character(len=*), | public, | parameter | :: | flag_ibmxl_backslash | = | " -qnoescape" | |
| character(len=*), | public, | parameter | :: | flag_intel_align | = | " -align all" | |
| character(len=*), | public, | parameter | :: | flag_intel_align_win | = | " /align:all" | |
| character(len=*), | public, | parameter | :: | flag_intel_backtrace | = | " -traceback" | |
| character(len=*), | public, | parameter | :: | flag_intel_backtrace_win | = | " /traceback" | |
| character(len=*), | public, | parameter | :: | flag_intel_byterecl | = | " -assume byterecl" | |
| character(len=*), | public, | parameter | :: | flag_intel_byterecl_win | = | " /assume:byterecl" | |
| character(len=*), | public, | parameter | :: | flag_intel_check | = | " -check all" | |
| character(len=*), | public, | parameter | :: | flag_intel_check_win | = | " /check:all" | |
| character(len=*), | public, | parameter | :: | flag_intel_debug | = | " -O0 -g" | |
| character(len=*), | public, | parameter | :: | flag_intel_debug_win | = | " /Od /Z7" | |
| character(len=*), | public, | parameter | :: | flag_intel_fixed_form | = | " -fixed" | |
| character(len=*), | public, | parameter | :: | flag_intel_fixed_form_win | = | " /fixed" | |
| character(len=*), | public, | parameter | :: | flag_intel_fp | = | " -fp-model precise -pc64" | |
| character(len=*), | public, | parameter | :: | flag_intel_fp_win | = | " /fp:precise" | |
| character(len=*), | public, | parameter | :: | flag_intel_free_form | = | " -free" | |
| character(len=*), | public, | parameter | :: | flag_intel_free_form_win | = | " /free" | |
| character(len=*), | public, | parameter | :: | flag_intel_limit | = | " -error-limit 1" | |
| character(len=*), | public, | parameter | :: | flag_intel_limit_win | = | " /error-limit:1" | |
| character(len=*), | public, | parameter | :: | flag_intel_llvm_check | = | " -check all,nouninit" | |
| character(len=*), | public, | parameter | :: | flag_intel_nogen | = | " -nogen-interfaces" | |
| character(len=*), | public, | parameter | :: | flag_intel_nogen_win | = | " /nogen-interfaces" | |
| character(len=*), | public, | parameter | :: | flag_intel_openmp | = | " -qopenmp" | |
| character(len=*), | public, | parameter | :: | flag_intel_openmp_win | = | " /Qopenmp" | |
| character(len=*), | public, | parameter | :: | flag_intel_opt | = | " -O3" | |
| character(len=*), | public, | parameter | :: | flag_intel_opt_win | = | " /O3" | |
| character(len=*), | public, | parameter | :: | flag_intel_pthread | = | " -reentrancy threaded" | |
| character(len=*), | public, | parameter | :: | flag_intel_pthread_win | = | " /reentrancy:threaded" | |
| character(len=*), | public, | parameter | :: | flag_intel_standard_compliance | = | " -standard-semantics" | |
| character(len=*), | public, | parameter | :: | flag_intel_standard_compliance_win | = | " /standard-semantics" | |
| character(len=*), | public, | parameter | :: | flag_intel_unknown_cmd_err | = | " -diag-error 10006" | |
| character(len=*), | public, | parameter | :: | flag_intel_unknown_cmd_err_win | = | " /Qdiag-error:10006" | |
| character(len=*), | public, | parameter | :: | flag_intel_warn | = | " -warn all" | |
| character(len=*), | public, | parameter | :: | flag_intel_warn_win | = | " /warn:all" | |
| character(len=*), | public, | parameter | :: | flag_lfortran_fixed_form | = | " --fixed-form" | |
| character(len=*), | public, | parameter | :: | flag_lfortran_implicit_external | = | " --implicit-interface" | |
| character(len=*), | public, | parameter | :: | flag_lfortran_implicit_typing | = | " --implicit-typing" | |
| character(len=*), | public, | parameter | :: | flag_lfortran_openmp | = | " --openmp" | |
| character(len=*), | public, | parameter | :: | flag_lfortran_opt | = | " --fast" | |
| character(len=*), | public, | parameter | :: | flag_nag_backtrace | = | " -gline" | |
| character(len=*), | public, | parameter | :: | flag_nag_check | = | " -C" | |
| character(len=*), | public, | parameter | :: | flag_nag_coarray | = | " -coarray=single" | |
| character(len=*), | public, | parameter | :: | flag_nag_debug | = | " -g -O0" | |
| character(len=*), | public, | parameter | :: | flag_nag_fixed_form | = | " -fixed" | |
| character(len=*), | public, | parameter | :: | flag_nag_fpp | = | " -fpp" | |
| character(len=*), | public, | parameter | :: | flag_nag_free_form | = | " -free" | |
| character(len=*), | public, | parameter | :: | flag_nag_no_implicit_typing | = | " -u" | |
| character(len=*), | public, | parameter | :: | flag_nag_openmp | = | " -openmp" | |
| character(len=*), | public, | parameter | :: | flag_nag_opt | = | " -O4" | |
| character(len=*), | public, | parameter | :: | flag_nag_pic | = | " -PIC" | |
| character(len=*), | public, | parameter | :: | flag_pgi_backslash | = | " -Mbackslash" | |
| character(len=*), | public, | parameter | :: | flag_pgi_check | = | " -Mbounds -Mchkptr -Mchkstk" | |
| character(len=*), | public, | parameter | :: | flag_pgi_debug | = | " -g" | |
| character(len=*), | public, | parameter | :: | flag_pgi_fixed_form | = | " -Mfixed" | |
| character(len=*), | public, | parameter | :: | flag_pgi_free_form | = | " -Mfree" | |
| character(len=*), | public, | parameter | :: | flag_pgi_openmp | = | " -mp" | |
| character(len=*), | public, | parameter | :: | flag_pgi_traceback | = | " -traceback" | |
| character(len=*), | public, | parameter | :: | flag_pgi_warn | = | " -Minform=inform" |
| enumerator | :: | id_all | = | -1 | |
| enumerator | :: | id_unknown | = | 0 | |
| enumerator | :: | id_gcc | = | 1 | |
| enumerator | :: | id_f95 | = | 2 | |
| enumerator | :: | id_caf | = | 3 | |
| enumerator | :: | id_intel_classic_nix | = | 4 | |
| enumerator | :: | id_intel_classic_mac | = | 5 | |
| enumerator | :: | id_intel_classic_windows | = | 6 | |
| enumerator | :: | id_intel_llvm_nix | = | 7 | |
| enumerator | :: | id_intel_llvm_windows | = | 8 | |
| enumerator | :: | id_intel_llvm_unknown | = | 9 | |
| enumerator | :: | id_pgi | = | 10 | |
| enumerator | :: | id_nvhpc | = | 11 | |
| enumerator | :: | id_nag | = | 12 | |
| enumerator | :: | id_flang_classic | = | 13 | |
| enumerator | :: | id_flang | = | 14 | |
| enumerator | :: | id_amdflang | = | 15 | |
| enumerator | :: | id_f18 | = | 16 | |
| enumerator | :: | id_ibmxl | = | 17 | |
| enumerator | :: | id_cray | = | 18 | |
| enumerator | :: | id_lahey | = | 19 | |
| enumerator | :: | id_lfortran | = | 20 |
Create debug printout
String representation of a compiler object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
Representation as string
String representation of an archiver object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(archiver_t), | intent(in) | :: | self |
Instance of the archiver object |
Representation as string
Definition of archiver object
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | ar |
Path to archiver |
||
| logical, | public | :: | echo | = | .true. |
Print all command |
|
| logical, | public | :: | use_response_file | = | .false. |
Use response files to pass arguments |
|
| logical, | public | :: | verbose | = | .true. |
Verbose output of command |
| generic, public :: dump => dump_to_toml, dump_to_file, dump_to_unit | |
| procedure, public :: dump_to_toml | |
| generic, public :: load => load_from_toml, load_from_file, load_from_unit | |
| procedure, public :: load_from_toml | |
| procedure, public :: make_archive | Create static archive |
| generic, public :: operator(==) => serializable_is_same | |
| procedure, public :: serializable_is_same => ar_is_same | Serialization interface |
| procedure, public, non_overridable :: test_serialization | Test load/write roundtrip |
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 |
| procedure, public :: check_c_flags_supported | |
| procedure, public :: check_c_source_runs | C feature support |
| procedure, public :: check_cxx_flags_supported | |
| procedure, public :: check_cxx_source_runs | C++ feature support |
| procedure, public :: check_flags_supported | |
| procedure, public :: check_fortran_source_runs | Fortran feature support |
| procedure, public :: compile_c | Compile a C object |
| procedure, public :: compile_cpp | Compile a CPP object |
| procedure, public :: compile_fortran | Compile a Fortran object |
| generic, public :: dump => dump_to_toml, dump_to_file, dump_to_unit | |
| procedure, public :: dump_to_toml => compiler_dump | |
| procedure, public :: enumerate_libraries | Enumerate libraries, based on compiler and platform |
| procedure, public :: get_default_flags | Get default compiler flags |
| procedure, public :: get_export_flags | Get library export flags |
| procedure, public :: get_feature_flag | Get feature flag |
| procedure, public :: get_headerpad_flags | Generate header padding flags for macOS executables |
| procedure, public :: get_include_flag | Get flag for include directories |
| procedure, public :: get_install_name_flags | Get library install name flags |
| procedure, public :: get_main_flags | Get flags for the main linking command |
| procedure, public :: get_module_flag | Get flag for module output directories |
| procedure, public :: get_preprocess_flag | Get flag that preprocesses a source whose suffix asks for it |
| procedure, public :: is_gnu | Check whether this is a GNU compiler |
| procedure, public :: is_intel | Check whether this is an Intel compiler |
| procedure, public :: is_unknown | Check whether compiler is recognized |
| procedure, public :: link => link_executable | Link executable |
| procedure, public :: link_shared | Link a shared library |
| generic, public :: load => load_from_toml, load_from_file, load_from_unit | |
| procedure, public :: load_from_toml => compiler_load | |
| procedure, public :: name => compiler_name | Return compiler name |
| generic, public :: operator(==) => serializable_is_same | |
| procedure, public :: serializable_is_same => compiler_is_same | Serialization interface |
| procedure, public, non_overridable :: test_serialization | Test load/write roundtrip |
| procedure, public :: with_qp | |
| procedure, public :: with_xdp |
Check that two archiver_t objects are equal All checks passed!
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(archiver_t), | intent(in) | :: | this | |||
| class(serializable_t), | intent(in) | :: | that |
Check if the given C compile and/or link flags are accepted by the C compiler
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | compile_flags | ||
| character(len=*), | intent(in), | optional | :: | link_flags |
Check if the given C source code compiles, links, and runs successfully Create temporary source file Write contents Get flags Compile Link using C compiler for pure C programs Run Delete temporary files
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
| character(len=*), | intent(in) | :: | input |
C program source |
||
| character(len=*), | intent(in), | optional | :: | compile_flags |
Optional build and link flags |
|
| character(len=*), | intent(in), | optional | :: | link_flags |
Optional build and link flags |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler | |||
| character(len=*), | intent(in) | :: | expected |
Check if the given C++ compile and/or link flags are accepted by the C++ compiler
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | compile_flags | ||
| character(len=*), | intent(in), | optional | :: | link_flags |
Check if the given C++ source code compiles, links, and runs successfully Create temporary source file Write contents Get flags Compile Link using C++ compiler for pure C++ programs Run Delete temporary files
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
| character(len=*), | intent(in) | :: | input |
C++ program source |
||
| character(len=*), | intent(in), | optional | :: | compile_flags |
Optional build and link flags |
|
| character(len=*), | intent(in), | optional | :: | link_flags |
Optional build and link flags |
Check if the given compile and/or link flags are accepted by the compiler
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in), | optional | :: | compile_flags | ||
| character(len=*), | intent(in), | optional | :: | link_flags |
Run a single-source Fortran program using the current compiler Compile a Fortran object Create temporary source file Write contents Get flags Intel: Needs -warn last for error on unknown command line arguments to work 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 |
||
| character(len=*), | intent(in), | optional | :: | compile_flags |
Optional build and link flags |
|
| character(len=*), | intent(in), | optional | :: | link_flags |
Optional build and link flags |
Convert compiler enum to name (reverse of match_compiler_type)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=compiler_enum), | intent(in) | :: | id |
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 |
Return a compiler name string
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
Representation as string
String representation of an archiver object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(archiver_t), | intent(in) | :: | self |
Instance of the archiver object |
Representation as string
String representation of a compiler object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
Representation as string
Link flags without the options that the compile flags already pass: executables are
linked with both, and a metapackage can set the same option in each (OpenMP), which a
strict compiler rejects when repeated (NAG: -openmp). Only an option standing alone
is dropped: paths, libraries, linker flags, repeats, and options that take an argument
stay with that argument. The flags are split on blanks, not parsed, so Windows paths
keep their backslashes.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | link_flags | |||
| character(len=*), | intent(in) | :: | compile_flags |
True when the string ends in a blank (space or tab), i.e. its last character separates it from anything concatenated after it.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | str |
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(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| logical, | intent(in) | :: | release |
Generate library export flags for a shared library build
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler |
||
| character(len=*), | intent(in) | :: | target_dir |
Path and package name |
||
| character(len=*), | intent(in) | :: | target_name |
Path and package name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in) | :: | feature |
Generate header padding flags for install_name_tool compatibility on macOS
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in) | :: | path |
Generate install_name flag for a shared library build on macOS
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in) | :: | target_dir | |||
| character(len=*), | intent(in) | :: | target_name |
This function will parse and read the macros list and return them as defined flags. Set macro defintion symbol on the basis of compiler used Check if macros are not allocated. Split the macro name and value.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=compiler_enum), | intent(in) | :: | id | |||
| type(string_t), | intent(in), | allocatable | :: | macros_list(:) | ||
| type(version_t), | intent(in), | optional | :: | version |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in) | :: | path |
Get the flag that preprocesses a Fortran source with an upper-case .F90 or .F suffix,
for compilers that do not do so on their own: NAG runs fpp by suffix only on .ff90,
.ff95 and .ff sources
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self | |||
| character(len=*), | intent(in) | :: | source_file |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Identify a compiler from its name, and for a compiler named like LLVM flang, from its installation: AOCC, like other classic flang installs, also calls its compiler flang
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler |
Whether a compiler named flang is classic flang: its driver runs the flang1 program installed next to it, which LLVM flang does not have
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler |
Check if C++ compiler is GNU-based by checking its version output
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler |
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 |
Append new flags to existing flags, removing duplicates and empty flags (string version)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=:), | intent(inout), | allocatable | :: | flags | ||
| character(len=*), | intent(in) | :: | new_flags |
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 |
||
| type(compile_command_table_t), | intent(inout), | optional | :: | table |
Optional compile_commands table |
|
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
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 |
||
| type(compile_command_table_t), | intent(inout), | optional | :: | table |
Optional compile_commands table |
|
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
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 |
||
| type(compile_command_table_t), | intent(inout), | optional | :: | table |
Optional compile_commands table |
|
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
Compile an object with the compiler for its language
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
| integer, | intent(in) | :: | lang |
Source language: LANG_FORTRAN, LANG_C or LANG_CXX |
||
| 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 |
||
| type(compile_command_table_t), | intent(inout), | optional | :: | table |
Optional compile_commands table |
|
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
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 |
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 |
Dump dependency to toml table
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(archiver_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 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=compiler_enum), | intent(in) | :: | id | |||
| character(len=:), | intent(out), | allocatable | :: | flags |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | f_compiler | |||
| character(len=:), | intent(out), | allocatable | :: | c_compiler |
Get C++ Compiler.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | f_compiler | |||
| character(len=:), | intent(out), | allocatable | :: | cxx_compiler |
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 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=compiler_enum), | intent(in) | :: | id | |||
| character(len=:), | intent(out), | allocatable | :: | flags |
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 |
||
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
Link a shared library
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(compiler_t), | intent(in) | :: | self |
Instance of the compiler object |
||
| character(len=*), | intent(in) | :: | output |
Output file of shared library object |
||
| character(len=*), | intent(in) | :: | args |
Arguments for the compiler |
||
| character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
| integer, | intent(out) | :: | stat |
Status flag |
||
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
Read dependency from toml table (no checks made at this stage)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(archiver_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 |
Create an archive
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(archiver_t), | intent(in) | :: | self |
Instance of the archiver object |
||
| character(len=*), | intent(in) | :: | output |
Name of the archive to generate |
||
| type(string_t), | intent(in) | :: | args(:) |
Object files to include into the archive |
||
| character(len=*), | intent(in) | :: | log_file |
Compiler output log file |
||
| integer, | intent(out) | :: | stat |
Status flag |
||
| logical, | intent(in), | optional | :: | dry_run |
Optional mocking |
Create new archiver instance
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(archiver_t), | intent(out) | :: | self |
New instance of the archiver |
||
| character(len=*), | intent(in) | :: | ar |
User provided archiver command |
||
| logical, | intent(in) | :: | echo |
Echo compiler command |
||
| logical, | intent(in) | :: | verbose |
Verbose mode: dump compiler output |
Create new compiler instance
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(compiler_t), | intent(out) | :: | self |
New instance of the compiler |
||
| character(len=*), | intent(in) | :: | fc |
Fortran compiler name or path |
||
| character(len=*), | intent(in) | :: | cc |
C compiler name or path |
||
| character(len=*), | intent(in) | :: | cxx |
C++ Compiler name or path |
||
| logical, | intent(in) | :: | echo |
Echo compiler command |
||
| logical, | intent(in) | :: | verbose |
Verbose mode: dump compiler output |
Run a tool by argv spawn, which is safe from several OpenMP threads. When its arguments could not be split, run the shell command instead, one at a time.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | command |
Shell command |
||
| type(string_t), | intent(in), | allocatable | :: | argv(:) |
Arguments for run_argv |
|
| logical, | intent(in) | :: | tokenized |
Whether argv is complete |
||
| logical, | intent(in) | :: | echo |
Echo and verbosity settings of the tool |
||
| logical, | intent(in) | :: | verbose |
Echo and verbosity settings of the tool |
||
| character(len=*), | intent(in) | :: | log_file |
Tool output log file |
||
| integer, | intent(out) | :: | stat |
Status flag |
Modify the flag_cpp_preprocessor on the basis of the compiler.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=compiler_enum), | intent(in) | :: | id | |||
| character(len=:), | intent(inout), | allocatable | :: | flags |
Split a command fragment into argv tokens with the OS-native lexer and append them to argv. fortran-shlex is not reentrant, so the split runs in a critical region. Both lexers remove the quoting as a shell does, so -DMSG=‘“hi”’ gives -DMSG=”hi”. join_spaced applies to the POSIX lexer.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_t), | intent(inout), | allocatable | :: | argv(:) | ||
| character(len=*), | intent(in) | :: | str | |||
| logical, | intent(in) | :: | join_spaced | |||
| logical, | intent(inout) | :: | ok |
Tokenize a string into an array of compiler flags
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | flags | |||
| type(string_t), | intent(out), | allocatable | :: | flags_array(:) |
Build prog [-c input] args -o output both as a shell command and as an argv list,
splitting prog and args with the OS-native lexer. tokenized is .false. when a part
cannot be split: only the shell command can run then.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | prog |
Program, possibly followed by its own flags |
||
| character(len=*), | intent(in) | :: | args |
Arguments for the program |
||
| character(len=*), | intent(in) | :: | output |
Output file, passed with -o |
||
| character(len=:), | intent(out), | allocatable | :: | command |
Shell command |
|
| type(string_t), | intent(out), | allocatable | :: | argv(:) |
Arguments for run_argv |
|
| logical, | intent(out) | :: | tokenized |
Whether every part could be split |
||
| character(len=*), | intent(in), | optional | :: | input |
Optional source file, passed with -c |
Check if compiler name is a valid compiler name
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | compiler_name |
Name of a compiler |
||
| logical, | intent(out) | :: | is_valid |
Boolean value of whether compiler_name is valid or not |
Response files allow to read command line options from files. Whitespace is used to separate the arguments, we will use newlines as separator to create readable response files which can be inspected in case of errors.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | name | |||
| type(string_t), | intent(in) | :: | argv(:) |