Procedures

ProcedureLocationProcedure TypeDescription
add_dependency fpm_targets Subroutine

Add pointer to dependeny in target%dependencies

add_executable_sources fpm_sources Subroutine

Add to sources using the executable and test entries in the manifest and applies any executable-specific overrides such as executable%name. Adds all sources (including modules) from each executable%source_dir

add_sources_from_dir fpm_sources Subroutine

Add to sources by looking for source files in directory

add_table fpm_toml Interface

add_table: fpm interface

add_target fpm_targets Subroutine

Allocate a new target and append to target list

ar_is_same fpm_compiler Function

Check that two archiver_t objects are equal All checks passed!

bad_name_error fpm_error Function
basename fpm_filesystem Function

Extract filename from path with/without suffix

build_model fpm Subroutine

Constructs a valid fpm model from command line settings and the toml manifest. Add this dependency’s manifest macros

Read more…
build_package fpm_backend Subroutine

Top-level routine to build package described by model

build_progress_t fpm_backend_output Interface

Constructor for build_progress_t

canon_path fpm_filesystem Function

Canonicalize path for comparison * Handles path string redundancies * Does not test existence of path

Read more…
change_directory fpm_os Subroutine
check_and_read_pkg_data fpm_dependency Subroutine
check_compiler fpm_compiler Function
check_keys fpm_toml Subroutine

Check if table contains only keys that are part of the list. If a key is found that is not part of the list, an error is allocated.

check_modules_for_duplicates fpm Subroutine
checkout fpm_git Subroutine
cmd_build fpm Subroutine

Dump model to file

cmd_clean fpm Subroutine

Delete the build directory including or excluding dependencies.

cmd_export fpm_cmd_export Subroutine

Entry point for the export subcommand Read in manifest Export manifest Export dependency tree

Read more…
cmd_install fpm_cmd_install Subroutine

Entry point for the fpm-install subcommand

cmd_new fpm_cmd_new Subroutine

TOP DIRECTORY NAME PROCESSING see if requested new directory already exists and process appropriately temporarily change to new directory as a test. NB: System dependent

cmd_publish fpm_cmd_publish Subroutine

The publish command first builds the root package to obtain all the relevant information such as the package version. It then creates a tarball of the package and uploads it to the registry. Checks before uploading the package.

cmd_run fpm Subroutine
cmd_update fpm_cmd_update Subroutine

Entry point for the update subcommand

compile_c fpm_compiler Subroutine

Compile a C object

compile_cpp fpm_compiler Subroutine

Compile a CPP object

compile_fortran fpm_compiler Subroutine

Compile a Fortran object

compiler_dump fpm_compiler Subroutine

Dump dependency to toml table

compiler_is_same fpm_compiler Function

Check that two compiler_t objects are equal All checks passed!

compiler_load fpm_compiler Subroutine

Read dependency from toml table (no checks made at this stage)

compiler_name fpm_compiler Function

Return a compiler name string

convert_to_absolute_path fpm_os Subroutine

Converts a path to an absolute, canonical path.

debug fpm_compiler Interface

Create debug printout

debug_archiver fpm_compiler Function

String representation of an archiver object

debug_compiler fpm_compiler Function

String representation of a compiler object

default_example fpm_manifest Subroutine

Populate test in case we find the default example/ directory

default_executable fpm_manifest Subroutine

Populate executable in case we find the default app directory

default_library fpm_manifest Subroutine

Populate library in case we find the default src directory

default_test fpm_manifest Subroutine

Populate test in case we find the default test/ directory

delete_file fpm_filesystem Subroutine

delete a file by filename

dependency_destroy fpm_manifest_dependency Subroutine

Clean memory

descriptor_name fpm_git Function

Code git descriptor to a string

destroy_dependency_node fpm_dependency Subroutine

Destructor

dilate fpm_strings Function

Sample program:

Read more…
dirname fpm_filesystem Function

Extract dirname from path

dump_to_toml fpm_git Subroutine

Dump dependency to toml table

dump_to_toml fpm_compiler Subroutine

Dump dependency to toml table

Read more…
enumerate_libraries fpm_compiler Function

Enumerate libraries, based on compiler and platform

execute_and_read_output fpm_filesystem Subroutine

Execute command line and return output as a string.

exists fpm_filesystem Function

test if pathname already exists

f_string fpm_strings Function

return Fortran character variable when given a C-like array of single characters terminated with a C_NULL_CHAR character

fatal_error fpm_error Subroutine

Generic fatal runtime error

file_not_found_error fpm_error Subroutine

Error created when a file is missing or not found

file_parse_error fpm_error Subroutine

Error created when file parsing fails

file_scope_dump fpm_manifest_profile Subroutine

Dump to toml table

file_scope_load fpm_manifest_profile Subroutine

Read from toml table (no checks made at this stage)

file_scope_same fpm_manifest_profile Function

All checks passed!

fileclose fpm_filesystem Subroutine

simple close of a LUN. On error show message and stop (by default)

fileopen fpm_filesystem Subroutine

procedure to open filename as a sequential “text” file

filewrite fpm_filesystem Subroutine

procedure to write filedata to file filename

filter_executable_targets fpm_targets Subroutine
filter_library_targets fpm_targets Subroutine
filter_modules fpm_targets Subroutine
find_profile fpm_manifest_profile Subroutine

Look for profile with given configuration in array profiles

fnv_1a fpm_strings Interface
fpm_stop fpm_error Subroutine
fpm_version fpm_release Function

Return the current fpm version from fpm_version_ID as a version type

get_absolute_path fpm_os Subroutine

Determine the canonical, absolute path for the given path. Expands home folder (~) on both Unix and Windows.

get_absolute_path_by_cd fpm_os Subroutine

Alternative to get_absolute_path that uses chdir/_chdir to determine the absolute path.

Read more…
get_command_arguments_quoted fpm_environment Function
get_command_line_settings fpm_command_line Subroutine

! canon_path is not converting “.”, etc. & ‘ unknown help topic “’//trim(unnamed(i)).’not found in:’,manual]

get_compiler_id fpm_compiler Function
get_current_directory fpm_os Subroutine
get_debug_compile_flags fpm_compiler Subroutine
get_default_c_compiler fpm_compiler Subroutine
get_default_cxx_compiler fpm_compiler Subroutine

Get C++ Compiler.

get_default_flags fpm_compiler Function
get_default_profiles fpm_manifest_profile Function

Construct an array of built-in profiles

get_dos_path fpm_filesystem Function

Ensure a windows path is converted to an 8.3 DOS path if it contains spaces No need to convert if there are no spaces

Read more…
get_env fpm_environment Function

get named environment variable value. It it is blank or not set return the optional default value !print , NAME, ” is not defined in the environment. Strange…” !print , “This processor doesn’t support environment variables. Boooh!”

get_exe_name_with_suffix fpm_sources Function

Build an executable name with suffix. Safe routine that always returns an allocated string

get_feature_flag fpm_compiler Function
get_flags fpm_manifest_profile Subroutine

Look for flags, c-flags, link-time-flags key-val pairs and files table in a given table and create new profiles

get_global_settings fpm_settings Subroutine

Obtain global settings from the global config file.

get_home fpm_filesystem Subroutine

Get the HOME directory on Unix and the %USERPROFILE% directory on Windows.

get_id fpm_compiler Function
get_include_flag fpm_compiler Function
get_list fpm_toml Subroutine
get_local_prefix fpm_filesystem Function

Determine the path prefix to the local folder. Used for installation, registry etc.

get_macros fpm_compiler Function

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.

Read more…
get_main_flags fpm_compiler Subroutine

Get special flags for the main linker

get_module_flag fpm_compiler Function
get_os_type fpm_environment Function

Determine the OS type

Read more…
get_package_data fpm_manifest Subroutine

Obtain package meta data from a configuation file

get_registry_settings fpm_settings Subroutine

Read registry settings from the global config file.

get_release_compile_flags fpm_compiler Subroutine
get_temp_filename fpm_filesystem Function

Get a unused temporary filename Calls posix ‘tempnam’ - not recommended, but we have no security concerns for this application and use here is temporary. Works with MinGW

get_value fpm_toml Interface

get_value: fpm interface

get_working_dir main Subroutine

Save access to working directory in settings, in case setting have not been allocated

getline fpm_filesystem Subroutine

subroutine getline(unit,line,iostat,iomsg)

Read more…
git_archive fpm_git Subroutine

Archive a folder using git archive.

git_is_same fpm_git Function

Check that two git targets are equal All checks passed!

git_matches_manifest fpm_git Function

Check that a cached dependency matches a manifest request

Read more…
git_revision fpm_git Subroutine
git_target_branch fpm_git Function

Target a branch in the git repository

git_target_default fpm_git Function

Default target

git_target_eq fpm_git Function

Check that two git targets are equal

git_target_revision fpm_git Function

Target a specific git revision

git_target_tag fpm_git Function

Target a git tag

glob fpm_strings Function

glob(3f) compares given STRING for match to PATTERN which may contain wildcard characters.

Read more…
handle_error main Subroutine
has_manifest main Function
has_valid_custom_prefix fpm_strings Function

Check that a module name is prefixed with a custom prefix: 1) It must be a valid FORTRAN name subset (<=63 chars, begin with letter, only alphanumeric allowed) 2) It must begin with the prefix 3) If longer, package name must be followed by default separator (“_”) plus at least one char

Read more…
has_valid_standard_prefix fpm_strings Function

Check that a module name is prefixed with the default package prefix: 1) It must be a valid FORTRAN name (<=63 chars, begin with letter, “_” is only allowed non-alphanumeric) 2) It must begin with the package name 3) If longer, package name must be followed by default separator plus at least one char

Read more…
info fpm_git Subroutine

Show information on git target

info fpm_manifest_profile Subroutine

Write information on instance

info_profile fpm_manifest_profile Function

Print a representation of profile_config_t

is_absolute_path fpm_filesystem Function

Returns .true. if provided path is absolute.

Read more…
is_dir fpm_filesystem Function

test if a name matches an existing directory path

is_fortran_name fpm_strings Function
is_gnu fpm_compiler Function
is_hidden_file fpm_filesystem Function

test if a file is hidden

is_intel fpm_compiler Function
is_meta_package fpm_manifest_metapackages Function

Check local schema for allowed entries

Read more…
is_unknown fpm_compiler Function
is_valid_module_name fpm_strings Function

Check that a module name fits the current naming rules: 1) It must be a valid FORTRAN name (<=63 chars, begin with letter, “_” is only allowed non-alphanumeric) 2) It must begin with the package name 3) If longer, package name must be followed by default separator plus at least one char

Read more…
is_valid_module_prefix fpm_strings Function

Check that a custom module prefix fits the current naming rules: 1) Only alphanumeric characters (no spaces, dashes, underscores or other characters) 2) Does not begin with a number (Fortran-compatible syntax)

join fpm_strings Function

JOIN(3f) appends the elements of a CHARACTER array into a single CHARACTER variable, with elements 1 to N joined from left to right. By default each element is trimmed of trailing spaces and the default separator is a null string.

Read more…
join_path fpm_filesystem Function

Construct path by joining strings with os file separator

len_trim fpm_strings Interface
link fpm_compiler Subroutine

Link an executable

list_files fpm_filesystem Subroutine

Get file & directory names in directory dir using iso_c_binding.

Read more…
load_from_toml fpm_git Subroutine

Read dependency from toml table (no checks made at this stage)

Read more…
load_from_toml fpm_compiler Subroutine

Read dependency from toml table (no checks made at this stage)

lower fpm_strings Function

Changes a string to lowercase over optional specified column range

make_archive fpm_compiler Subroutine

Create an archive

Read more…
manifest_has_changed fpm_manifest_dependency Function

Check if two dependency configurations are different

Read more…
match_os_type fpm_manifest_profile Subroutine

Match os_type enum to a lowercase string with name of OS

mkdir fpm_filesystem Subroutine

Create a directory. Create subdirectories as needed

module_prefix_template fpm_strings Function
module_prefix_type fpm_strings Function
MPI_TYPE_NAME fpm_meta Function

Return a name for the MPI library

name_is_json fpm_toml Function

Choose between JSON or TOML based on a file name

new_archiver fpm_compiler Subroutine

Create new archiver instance

new_build_config fpm_manifest_build Subroutine

Construct a new build configuration from a TOML data structure

Read more…
new_compiler fpm_compiler Subroutine

Create new compiler instance

new_dependencies fpm_manifest_dependency Subroutine

Construct new dependency array from a TOML data structure

Read more…
new_dependency fpm_manifest_dependency Subroutine

Construct a new dependency configuration from a TOML data structure

Read more…
new_dependency_node fpm_dependency Subroutine

Create a new dependency node from a configuration

new_dependency_tree fpm_dependency Subroutine

Create a new dependency tree

new_example fpm_manifest_example Subroutine

Construct a new example configuration from a TOML data structure

new_executable fpm_manifest_executable Subroutine

Construct a new executable configuration from a TOML data structure

new_fortran_config fpm_manifest_fortran Subroutine

Construct a new build configuration from a TOML data structure

new_install_config fpm_manifest_install Subroutine

Create a new installation configuration from a TOML data structure

new_installer fpm_installer Subroutine

Create a new instance of an installer

new_library fpm_manifest_library Subroutine

Construct a new library configuration from a TOML data structure

new_meta_config fpm_manifest_metapackages Subroutine

Construct a new build configuration from a TOML data structure

Read more…
new_meta_request fpm_manifest_metapackages Subroutine

Construct a new metapackage request from the dependencies table

Read more…
new_package fpm_manifest_package Subroutine

Construct a new package configuration from a TOML data structure

new_preprocess_config fpm_manifest_preprocess Subroutine

Construct a new preprocess configuration from TOML data structure

new_preprocessors fpm_manifest_preprocess Subroutine

Construct new preprocess array from a TOML data structure.

new_profile fpm_manifest_profile Function

Construct a new profile configuration from a TOML data structure

new_profiles fpm_manifest_profile Subroutine

Construct new profiles array from a TOML data structure

new_test fpm_manifest_test Subroutine

Construct a new test configuration from a TOML data structure

new_version fpm_versioning Interface
notabs fpm_strings Subroutine

notabs(3f) - [fpm_strings:NONALPHA] expand tab characters (LICENSE:PD)

Read more…
number_of_rows fpm_filesystem Function

Determine number or rows in a file given a LUN

operator(.in.) fpm_strings Interface
operator(==) fpm_git Interface
operator(==) fpm_manifest_preprocess Interface
operator(==) fpm_strings Interface
os_delete_dir fpm_filesystem Subroutine

Delete directory using system OS remove directory commands

os_is_unix fpm_environment Function

Compare the output of get_os_type or the optional passed INTEGER value to the value for OS_WINDOWS and return .TRUE. if they match and .FALSE. otherwise

OS_NAME fpm_environment Function

Return string describing the OS type flag

os_type_name fpm_manifest_profile Function

Match lowercase string with name of OS to os_type enum

parent_dir fpm_filesystem Function

Extract dirname from path

parse_c_source fpm_source_parsing Function

Parsing of c, cpp source files

Read more…
parse_descriptor fpm_git Function

Parse git descriptor identifier from a string

parse_f_source fpm_source_parsing Function

Parsing of free-form fortran source files

Read more…
parse_use_statement fpm_source_parsing Subroutine
profile_dump fpm_manifest_profile Subroutine

Dump to toml table

Read more…
profile_load fpm_manifest_profile Subroutine

Read from toml table (no checks made at this stage)

Read more…
profile_same fpm_manifest_profile Function

All checks passed!

read_lines fpm_filesystem Function

read lines into an array of TYPE(STRING_T) variables

read_lines_expanded fpm_filesystem Function

read lines into an array of TYPE(STRING_T) variables expanding tabs

read_package_file fpm_toml Subroutine

Process the configuration file to a TOML data structure

regex_version_from_text fpm_versioning Function
remove_characters_in_set fpm_strings Subroutine
remove_newline_characters fpm_strings Subroutine
replace fpm_strings Function

Returns string with characters in charset replaced with target_char.

resize fpm_dependency Interface

Overloaded reallocation interface

resize fpm_manifest_dependency Interface
resize fpm_strings Interface
resolve_metapackages fpm_meta Interface
resolve_module_dependencies fpm_targets Subroutine

Add dependencies to source-based targets (FPM_TARGET_OBJECT) based on any modules used by the corresponding source file.

Read more…
run fpm_filesystem Subroutine

Execute the specified system command. Optionally

Read more…
schedule_targets fpm_backend Subroutine

Construct a build schedule from the sorted targets.

Read more…
separator fpm_environment Function

sample usage

Read more…
set_cpp_preprocessor_flags fpm_compiler Subroutine

Modify the flag_cpp_preprocessor on the basis of the compiler.

set_list fpm_toml Subroutine

Set no key if array is not present

Read more…
set_string fpm_toml Interface
set_value fpm_toml Interface

set_value: fpm interface

show_model fpm_model Subroutine
sort_target fpm_backend Subroutine

Topologically sort a target for scheduling by recursing over its dependencies.

Read more…
split fpm_strings Subroutine

parse string on delimiter characters and store tokens into an allocatable array given a line of structure ” par1 par2 par3 … parn ” store each par(n) into a separate variable in array.

Read more…
str fpm_strings Interface
str_begins_with_str fpm_strings Function

test if a CHARACTER string begins with a specified prefix

str_ends_with fpm_strings Interface
string_array_contains fpm_strings Function

Check if array of TYPE(STRING_T) matches a particular CHARACTER string

string_cat fpm_strings Function

Concatenate an array of type(string_t) into a single CHARACTER variable

string_t fpm_strings Interface
syntax_error fpm_error Subroutine
targets_from_sources fpm_targets Subroutine

High-level wrapper to generate build target information

to_fortran_name fpm_strings Function

Returns string with special characters replaced with an underscore. For now, only a hyphen is treated as a special character, but this can be expanded to other characters if needed.

traverse_compilers fpm_manifest_profile Subroutine

Traverse compiler tables

traverse_oss fpm_manifest_profile Subroutine

Traverse operating system tables to obtain profiles

traverse_oss_for_size fpm_manifest_profile Subroutine

Traverse operating system tables to obtain number of profiles

unix_path fpm_filesystem Function

Replace file system separators for unix

upper fpm_strings Function
validate_compiler_name fpm_manifest_profile Subroutine

Check if compiler name is a valid compiler name

validate_os_name fpm_manifest_profile Subroutine

Check if os_name is a valid name of a supported OS

validate_profile_table fpm_manifest_profile Subroutine
warnwrite fpm_filesystem Subroutine

write trimmed character data to a file if it does not exist

which fpm_filesystem Function

function which(command) result(pathname)

Read more…
windows_path fpm_filesystem Function

Replace file system separators for windows

write_response_file fpm_compiler Subroutine

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.