Skip to content

jacobwilliams/popen-fortran

Repository files navigation

popen-fortran

Simple Fortran module for popen.

Language GitHub release Build Status

Example

The library provides a routine get_command_as_string which can be used like so:

program main

  use popen_module, only: get_command_as_string

  implicit none
  character(len=:),allocatable :: res

  res = get_command_as_string('ls -l')

  write(*,'(A)') res

end program main

Documentation

The latest API documentation can be found here. This was generated from the source code using FORD (i.e. by running ford ford.md).

Compiling

The library can be compiled with recent versions the Intel Fortran Compiler and GFortran (and presumably any other Fortran compiler that supports modern standards).

A fpm.toml file is provided for compiling popen-fortran with the Fortran Package Manager. For example, to build:

fpm build --profile release

To run the unit tests:

fpm test --profile release

To use popen-fortran within your fpm project, add the following to your fpm.toml file:

[dependencies]
popen-fortran = { git="https://github.com/jacobwilliams/popen-fortran.git" }

or, to use a specific version:

[dependencies]
popen-fortran = { git="https://github.com/jacobwilliams/popen-fortran.git", tag = "1.0.0"  }

See also