Skip to content

Latest commit

 

History

111 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fortran-curl

Language License CI

A collection of ISO C binding interfaces to libcurl ≥ 8.20.0 for Fortran 2008. The library has been tested with GCC 15 and LLVM 21. See COVERAGE for an overview of bound procedures.

For a user-friendly, high-level HTTP library based on these bindings, see http-client.

Build Instructions

Install libcurl with development headers. On FreeBSD, run:

# pkg install ftp/curl

On Debian, instead:

# apt-get install libcurl4 libcurl4-openssl-dev

Clone the repository, then run make to build and install the interfaces to /opt:

$ git clone --depth 1 https://github.com/interkosmos/fortran-curl
$ cd fortran-curl/
$ make
$ make install PREFIX=/opt

You can override the default compilers by passing the CC and FC arguments, for example:

$ make CC=icx FC=ifx

On Linux, you may have to change the prefix to /usr:

$ make PREFIX=/usr

Link your Fortran application against /opt/lib/libfortran-curl.a -lcurl.

Examples

Examples are provided in directory examples/:

  • dict queries a DICT server on TCP port 2628.
  • download fetches a remote file.
  • getinfo prints request-related information and response headers to console.
  • gopher prints the contents of a remote Gopher map file.
  • http makes an HTTP GET request.
  • imap examines the INBOX of an IMAP mailbox (SSL).
  • mqtt posts a message to an MQTT topic.
  • multi makes multiple HTTP requests at once.
  • post makes an HTTP POST request.
  • smtp sends an e-mail via SMTP (SSL).
  • url demonstrates the URL API.
  • version outputs cURL version information.

Build an example with:

$ make <name>

Build all by running make examples.

Fortran Package Manager

This project supports the Fortran Package Manager (FPM). To build the project with FPM, run:

$ fpm build --profile release

The example programs are available with the fpm run --example command.

You can add fortran-curl to your fpm.toml with:

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

Source-Code Documentation

Use FORD to generate the source-code documentation:

$ ford ford.md

The output files are written to doc/.

Contribute

For smaller changes:

  1. Fork this repository from GitHub.
  2. Create a branch off master.
  3. Commit your changes.
  4. Send a pull request.

For larger changes:

  1. Join the Discourse Group.
  2. Discuss your proposal on the Group.
  3. When consensus is reached, implement it as described above.

Licence

ISC

About

Fortran 2008 interface bindings to libcurl

Topics

Resources

Stars

36 stars

Watchers

3 watching

Forks

Releases

Used by

Contributors

Languages