Procedures

ProcedureLocationProcedure TypeDescription
add_dependencyfpm_targetsSubroutine

Add pointer to dependeny in target%dependencies

add_executable_sourcesfpm_sourcesSubroutine

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_dirfpm_sourcesSubroutine

Add to sources by looking for source files in directory

add_targetfpm_targetsSubroutine

Allocate a new target and append to target list

bad_name_errorfpm_errorFunction
basenamefpm_filesystemFunction

Extract filename from path with/without suffix

build_modelfpmSubroutine

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

Read more…
build_packagefpm_backendSubroutine

Top-level routine to build package described by model

build_progress_tfpm_backend_outputInterface

Constructor for build_progress_t

canon_pathfpm_filesystemFunction

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

Read more…
change_directoryfpm_osSubroutine
check_and_read_pkg_datafpm_dependencySubroutine
check_compilerfpm_compilerFunction
check_keysfpm_tomlSubroutine

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_duplicatesfpmSubroutine
checkoutfpm_gitSubroutine
cmd_buildfpmSubroutine
cmd_cleanfpmSubroutine

Delete the build directory including or excluding dependencies.

cmd_installfpm_cmd_installSubroutine

Entry point for the fpm-install subcommand

cmd_newfpm_cmd_newSubroutine

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_publishfpm_cmd_publishSubroutine

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_runfpmSubroutine
cmd_updatefpm_cmd_updateSubroutine

Entry point for the update subcommand

compile_cfpm_compilerSubroutine

Compile a C object

compile_cppfpm_compilerSubroutine

Compile a CPP object

compile_fortranfpm_compilerSubroutine

Compile a Fortran object

compiler_namefpm_compilerFunction

Return a compiler name string

convert_to_absolute_pathfpm_osSubroutine

Converts a path to an absolute, canonical path.

debugfpm_compilerInterface

Create debug printout

debug_archiverfpm_compilerFunction

String representation of an archiver object

debug_compilerfpm_compilerFunction

String representation of a compiler object

default_examplefpm_manifestSubroutine

Populate test in case we find the default example/ directory

default_executablefpm_manifestSubroutine

Populate executable in case we find the default app directory

default_libraryfpm_manifestSubroutine

Populate library in case we find the default src directory

default_testfpm_manifestSubroutine

Populate test in case we find the default test/ directory

delete_filefpm_filesystemSubroutine

delete a file by filename

dilatefpm_stringsFunction

Sample program:

Read more…
dirnamefpm_filesystemFunction

Extract dirname from path

enumerate_librariesfpm_compilerFunction

Enumerate libraries, based on compiler and platform

execute_and_read_outputfpm_filesystemSubroutine

Execute command line and return output as a string.

existsfpm_filesystemFunction

test if pathname already exists

f_stringfpm_stringsFunction

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

fatal_errorfpm_errorSubroutine

Generic fatal runtime error

file_not_found_errorfpm_errorSubroutine

Error created when a file is missing or not found

file_parse_errorfpm_errorSubroutine

Error created when file parsing fails

fileclosefpm_filesystemSubroutine

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

fileopenfpm_filesystemSubroutine

procedure to open filename as a sequential “text” file

filewritefpm_filesystemSubroutine

procedure to write filedata to file filename

filter_executable_targetsfpm_targetsSubroutine
filter_library_targetsfpm_targetsSubroutine
filter_modulesfpm_targetsSubroutine
find_profilefpm_manifest_profileSubroutine

Look for profile with given configuration in array profiles

fnv_1afpm_stringsInterface
fpm_stopfpm_errorSubroutine
fpm_versionfpm_releaseFunction

Return the current fpm version from fpm_version_ID as a version type

get_absolute_pathfpm_osSubroutine

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

get_absolute_path_by_cdfpm_osSubroutine

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

Read more…
get_command_arguments_quotedfpm_environmentFunction
get_command_line_settingsfpm_command_lineSubroutine

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

get_compiler_idfpm_compilerFunction
get_current_directoryfpm_osSubroutine
get_debug_compile_flagsfpm_compilerSubroutine
get_default_c_compilerfpm_compilerSubroutine
get_default_cxx_compilerfpm_compilerSubroutine

Get C++ Compiler.

get_default_flagsfpm_compilerFunction
get_default_profilesfpm_manifest_profileFunction

Construct an array of built-in profiles

get_dos_pathfpm_filesystemFunction

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_envfpm_environmentFunction

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_suffixfpm_sourcesFunction

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

get_feature_flagfpm_compilerFunction
get_flagsfpm_manifest_profileSubroutine

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

get_global_settingsfpm_settingsSubroutine

Obtain global settings from the global config file.

get_homefpm_filesystemSubroutine

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

get_idfpm_compilerFunction
get_include_flagfpm_compilerFunction
get_listfpm_tomlSubroutine
get_local_prefixfpm_filesystemFunction

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

get_macrosfpm_compilerFunction

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_flagsfpm_compilerSubroutine

Get special flags for the main linker

get_module_flagfpm_compilerFunction
get_os_typefpm_environmentFunction

Determine the OS type

Read more…
get_package_datafpm_manifestSubroutine

Obtain package meta data from a configuation file

get_registry_settingsfpm_settingsSubroutine

Read registry settings from the global config file.

get_release_compile_flagsfpm_compilerSubroutine
get_temp_filenamefpm_filesystemFunction

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_working_dirmainSubroutine

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

getlinefpm_filesystemSubroutine

subroutine getline(unit,line,iostat,iomsg)

Read more…
git_archivefpm_gitSubroutine

Archive a folder using git archive.

git_matches_manifestfpm_gitFunction

Check that a cached dependency matches a manifest request

Read more…
git_revisionfpm_gitSubroutine
git_target_branchfpm_gitFunction

Target a branch in the git repository

git_target_defaultfpm_gitFunction

Default target

git_target_eqfpm_gitFunction

Check that two git targets are equal

git_target_revisionfpm_gitFunction

Target a specific git revision

git_target_tagfpm_gitFunction

Target a git tag

globfpm_stringsFunction

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

Read more…
handle_errormainSubroutine
has_manifestmainFunction
has_valid_custom_prefixfpm_stringsFunction

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_prefixfpm_stringsFunction

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…
infofpm_gitSubroutine

Show information on git target

infofpm_manifest_profileSubroutine

Write information on instance

info_profilefpm_manifest_profileFunction

Print a representation of profile_config_t

is_absolute_pathfpm_filesystemFunction

Returns .true. if provided path is absolute.

Read more…
is_dirfpm_filesystemFunction

test if a name matches an existing directory path

is_fortran_namefpm_stringsFunction
is_gnufpm_compilerFunction
is_hidden_filefpm_filesystemFunction

test if a file is hidden

is_intelfpm_compilerFunction
is_meta_packagefpm_manifest_metapackagesFunction

Check local schema for allowed entries

Read more…
is_unknownfpm_compilerFunction
is_valid_module_namefpm_stringsFunction

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_prefixfpm_stringsFunction

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)

joinfpm_stringsFunction

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_pathfpm_filesystemFunction

Construct path by joining strings with os file separator

len_trimfpm_stringsInterface
linkfpm_compilerSubroutine

Link an executable

list_filesfpm_filesystemSubroutine

Get file & directory names in directory dir using iso_c_binding.

Read more…
lowerfpm_stringsFunction

Changes a string to lowercase over optional specified column range

make_archivefpm_compilerSubroutine

Create an archive

Read more…
manifest_has_changedfpm_manifest_dependencyFunction

Check if two dependency configurations are different

Read more…
match_os_typefpm_manifest_profileSubroutine

Match os_type enum to a lowercase string with name of OS

mkdirfpm_filesystemSubroutine

Create a directory. Create subdirectories as needed

module_prefix_templatefpm_stringsFunction
module_prefix_typefpm_stringsFunction
MPI_TYPE_NAMEfpm_metaFunction

Return a name for the MPI library

new_archiverfpm_compilerSubroutine

Create new archiver instance

new_build_configfpm_manifest_buildSubroutine

Construct a new build configuration from a TOML data structure

Read more…
new_compilerfpm_compilerSubroutine

Create new compiler instance

new_dependenciesfpm_manifest_dependencySubroutine

Construct new dependency array from a TOML data structure

Read more…
new_dependencyfpm_manifest_dependencySubroutine

Construct a new dependency configuration from a TOML data structure

Read more…
new_dependency_nodefpm_dependencySubroutine

Create a new dependency node from a configuration

new_dependency_treefpm_dependencySubroutine

Create a new dependency tree

new_examplefpm_manifest_exampleSubroutine

Construct a new example configuration from a TOML data structure

new_executablefpm_manifest_executableSubroutine

Construct a new executable configuration from a TOML data structure

new_fortran_configfpm_manifest_fortranSubroutine

Construct a new build configuration from a TOML data structure

new_install_configfpm_manifest_installSubroutine

Create a new installation configuration from a TOML data structure

new_installerfpm_installerSubroutine

Create a new instance of an installer

new_libraryfpm_manifest_librarySubroutine

Construct a new library configuration from a TOML data structure

new_meta_configfpm_manifest_metapackagesSubroutine

Construct a new build configuration from a TOML data structure

Read more…
new_meta_requestfpm_manifest_metapackagesSubroutine

Construct a new metapackage request from the dependencies table

Read more…
new_packagefpm_manifest_packageSubroutine

Construct a new package configuration from a TOML data structure

new_preprocess_configfpm_manifest_preprocessSubroutine

Construct a new preprocess configuration from TOML data structure

new_preprocessorsfpm_manifest_preprocessSubroutine

Construct new preprocess array from a TOML data structure.

new_profilefpm_manifest_profileFunction

Construct a new profile configuration from a TOML data structure

new_profilesfpm_manifest_profileSubroutine

Construct new profiles array from a TOML data structure

new_testfpm_manifest_testSubroutine

Construct a new test configuration from a TOML data structure

new_versionfpm_versioningInterface
notabsfpm_stringsSubroutine

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

Read more…
number_of_rowsfpm_filesystemFunction

Determine number or rows in a file given a LUN

operator(.in.)fpm_stringsInterface
operator(==)fpm_gitInterface
operator(==)fpm_manifest_preprocessInterface
os_delete_dirfpm_filesystemSubroutine

Delete directory using system OS remove directory commands

os_is_unixfpm_environmentFunction

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

parent_dirfpm_filesystemFunction

Extract dirname from path

parse_c_sourcefpm_source_parsingFunction

Parsing of c, cpp source files

Read more…
parse_f_sourcefpm_source_parsingFunction

Parsing of free-form fortran source files

Read more…
parse_use_statementfpm_source_parsingSubroutine
read_linesfpm_filesystemFunction

read lines into an array of TYPE(STRING_T) variables

read_lines_expandedfpm_filesystemFunction

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

read_package_filefpm_tomlSubroutine

Process the configuration file to a TOML data structure

regex_version_from_textfpm_versioningFunction
remove_characters_in_setfpm_stringsSubroutine
remove_newline_charactersfpm_stringsSubroutine
replacefpm_stringsFunction

Returns string with characters in charset replaced with target_char.

resizefpm_stringsInterface
resizefpm_dependencyInterface

Overloaded reallocation interface

resolve_metapackagesfpm_metaInterface
resolve_module_dependenciesfpm_targetsSubroutine

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

Read more…
runfpm_filesystemSubroutine

Execute the specified system command. Optionally

Read more…
schedule_targetsfpm_backendSubroutine

Construct a build schedule from the sorted targets.

Read more…
separatorfpm_environmentFunction

sample usage

Read more…
set_cpp_preprocessor_flagsfpm_compilerSubroutine

Modify the flag_cpp_preprocessor on the basis of the compiler.

show_modelfpm_modelSubroutine
sort_targetfpm_backendSubroutine

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

Read more…
splitfpm_stringsSubroutine

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…
strfpm_stringsInterface
str_begins_with_strfpm_stringsFunction

test if a CHARACTER string begins with a specified prefix

str_ends_withfpm_stringsInterface
string_array_containsfpm_stringsFunction

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

string_catfpm_stringsFunction

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

string_tfpm_stringsInterface
syntax_errorfpm_errorSubroutine
targets_from_sourcesfpm_targetsSubroutine

High-level wrapper to generate build target information

to_fortran_namefpm_stringsFunction

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_compilersfpm_manifest_profileSubroutine

Traverse compiler tables

traverse_ossfpm_manifest_profileSubroutine

Traverse operating system tables to obtain profiles

traverse_oss_for_sizefpm_manifest_profileSubroutine

Traverse operating system tables to obtain number of profiles

unix_pathfpm_filesystemFunction

Replace file system separators for 1

validate_compiler_namefpm_manifest_profileSubroutine

Check if compiler name is a valid compiler name

validate_os_namefpm_manifest_profileSubroutine

Check if os_name is a valid name of a supported OS

validate_profile_tablefpm_manifest_profileSubroutine
warnwritefpm_filesystemSubroutine

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

whichfpm_filesystemFunction

function which(command) result(pathname)

Read more…
windows_pathfpm_filesystemFunction

Replace file system separators for windows

write_response_filefpm_compilerSubroutine

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.