fortran-strings 1.1.1
Fortran library of functions for common string manipulations
|
fortran-strings is a Fortran library and module which contains functions for common string manipulations. The function ideas originate mainly from Python's built-in string functions. The functions are accessible by using strings
module in your Fortran code
use strings
The function names are prefixed with str_
. The following is a list of available functions:
All functions return a deferred-length, allocatable character scalar (character(len=:), allocatable
) with the exception of **str_count
** which returns an integer and **str_test
** which returns a logical.
Admittedly, my knowledge of automake, autotools, etc is not strong at this time. The makefile is preconfigured to compile with GNU Fortran (gfortran) $FC
and its appropriate compiler options $FFLAGS
. The default install path is set to /usr/local
via $PREFIX
. To change these make variables, simply edit the makefile or set these variables on the command line prior to the make commands.
This package provides a module file (**<prefix>/include/strings.mod
**) and both a shared object library (**<prefix>/lib/libfstrings.so
**) and a static library (**<prefix>/lib/libfstrings.a
**). To use this fortran-strings
in your Fortran program, you must use the USE
statement in your main program or procedure source and during compile, you must specify the library of your choice to the compiler/linker.
Example code:
Example compile and link to the static library using gfortran:
Note that this does not make the executable 100% static.
Example compile and link to the shared object library using gfortran:
Note that when compiling and linking to shared object libraries, the library path must be specified in the appropriate environment variable prior to invocation (Linux: LD_LIBRARY_PATH
; macOS: DYLD_LIBRARY_PATH
).