{"id":18847801,"url":"https://github.com/interkosmos/fortran-unix","last_synced_at":"2025-04-14T08:09:46.062Z","repository":{"id":47393087,"uuid":"321436238","full_name":"interkosmos/fortran-unix","owner":"interkosmos","description":"Fortran 2008 interface bindings to selected POSIX and SysV procedures","archived":false,"fork":false,"pushed_at":"2025-03-31T21:19:55.000Z","size":153,"stargazers_count":32,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-14T08:09:40.736Z","etag":null,"topics":["fortran","fortran-2008","fortran-package-manager","fpm","freebsd","linux","posix","unix"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interkosmos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-14T18:23:20.000Z","updated_at":"2025-04-03T13:33:40.000Z","dependencies_parsed_at":"2023-09-21T19:20:18.738Z","dependency_job_id":"22bac269-33b8-49e5-acf0-3cd462756f8f","html_url":"https://github.com/interkosmos/fortran-unix","commit_stats":{"total_commits":74,"total_committers":2,"mean_commits":37.0,"dds":"0.013513513513513487","last_synced_commit":"35fba2122f44ee2b760d959677bbac8cb91587b7"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-unix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-unix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-unix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interkosmos%2Ffortran-unix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interkosmos","download_url":"https://codeload.github.com/interkosmos/fortran-unix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248843867,"owners_count":21170492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","fortran-2008","fortran-package-manager","fpm","freebsd","linux","posix","unix"],"created_at":"2024-11-08T03:09:43.048Z","updated_at":"2025-04-14T08:09:46.054Z","avatar_url":"https://github.com/interkosmos.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fortran-unix\n\n[![Build](https://github.com/interkosmos/fortran-unix/actions/workflows/build.yml/badge.svg)](https://github.com/interkosmos/fortran-unix/actions/workflows/build.yml)\n\nA work-in-progress collection of Fortran 2008 ISO C binding interfaces to\nselected POSIX and SysV types, functions, and routines on 64-bit Unix-like\noperating systems:\n\n* standard input/output,\n* file and directory access,\n* clocks and timers,\n* signals,\n* processes,\n* pipes,\n* serial port input/output,\n* terminal control,\n* POSIX threads,\n* POSIX mutexes and semaphores,\n* POSIX regular expressions,\n* BSD sockets,\n* UNIX System V message queues,\n* POSIX message queues.\n\nSimilar libraries for modern Fortran:\n\n* [M_process](https://github.com/urbanjost/M_process),\n* [M_system](https://github.com/urbanjost/M_system),\n* [forthreads](https://github.com/ohm314/forthreads),\n* [fortran-server](https://github.com/lukeasrodgers/fortran-server),\n* [fortranposix](https://sourceforge.net/projects/fortranposix/),\n* [fortyxima](https://bitbucket.org/aradi/fortyxima/),\n* [fsockets](https://github.com/trifling/fsocket),\n* [posix90](http://savannah.nongnu.org/projects/posix90/).\n\nCurrently, only Linux (glibc) and FreeBSD are supported. The library has been\ntested on:\n\n* FreeBSD 14 (GCC 14, LLVM 20),\n* Debian 12 (GCC 12, Intel oneAPI 2024).\n\nPreprocessor macros are used to achieve platform-independent interoperability.\nTherefore, your Fortran compiler has to support at least GNU preprocessor\nconditionals.\n\n## Build Instructions\n\nRun either GNU/BSD make or [FPM](https://github.com/fortran-lang/fpm) to build\nthe static library `libfortran-unix.a`. Link your Fortran application with\n`libfortran-unix.a`, and optionally with `-lpthread` to access POSIX threads, or\n`-lrt` to access POSIX message queues.\n\n### Make\n\nOn FreeBSD, run:\n\n```\n$ make freebsd\n```\n\nTo build with LLVM 20 instead:\n\n```\n$ make freebsd CC=clang20 FC=flang20\n```\n\nOn Linux (x86-64), run:\n\n```\n$ make linux\n```\n\nOn Linux (aarch64), run:\n\n```\n$ make linux_aarch64\n```\n\nTo build with Intel oneAPI, run:\n\n```\n$ make CC=icx FC=ifx PPFLAGS=\n```\n\nOptionally, install `libfortran-unix.a` and the associated module files\nsystem-wide:\n\n```\n$ make install PREFIX=/opt\n--- Installing libfortran-unix.a to /opt/lib/ ...\n--- Installing module files to /opt/include/libfortran-unix/ ...\n```\n\n### Fortran Package Manager\n\nUsing FPM, a preprocessor flag has to be passed to GNU Fortran. On FreeBSD:\n\n```\n$ fpm build --profile release --flag \"-D__FreeBSD__\"\n```\n\nOn Linux (x86-64):\n\n```\n$ fpm build --profile release --flag \"-D__linux__\"\n```\n\nOn Linux (aarch64):\n\n```\n$ fpm build --profile release --flag \"-D__linux__ -D__aarch64__\"\n```\n\n## Source Code Documentation\n\nThe source code documentation of the library has to be created with\n[FORD](https://github.com/Fortran-FOSS-Programmers/ford). Install the Python\npackage with:\n\n```\n$ python3 -m pip install -U ford\n```\n\nIn the source repository, either run:\n\n```\n$ make freebsd_doc\n```\n\nOr:\n\n```\n$ make linux_doc\n```\n\nThe HTML files will be written to directory `doc/`. Open `index.html` in a web\nbrowser.\n\n## Examples\n\nExamples are provided in directory `examples/`:\n\n* **dirent** prints the contents of a file system directory.\n* **fifo** creates a named pipe for IPC.\n* **fork** forks a process and uses anonymous pipes for IPC.\n* **irc** implements a basic IRC bot, based on BSD sockets.\n* **key** reads single key-strokes from standard input.\n* **mqueue** creates a POSIX message queue.\n* **msg** shows message passing with UNIX System V message queues.\n* **mutex** demonstrates threaded access to variable using a mutex.\n* **os** returns the name of the operating system (Linux, macOS, FreeBSD, ...).\n* **pid** outputs the process id.\n* **pipe** creates anonymous pipes for bidirectional IPC.\n* **pthread** runs a Fortran subroutine inside multiple POSIX threads.\n* **regex** calls POSIX regex functions.\n* **semaphore** tests POSIX semaphores.\n* **serial** shows some basic serial port input reading (requires *socat(1)* and *minicom(1)*).\n* **signal** catches SIGINT (`CTRL` + `C`).\n* **socket** creates a TCP/IP connection to a local netcat server (requires *nc(1)*).\n* **stat** reads and outputs status of a file.\n* **time** prints out the results of time functions.\n* **uname** prints OS information from `uname()`.\n* **uptime** outputs system uptime.\n\nTo compile the example programs, either run:\n\n```\n$ make freebsd_examples\n```\n\nOr:\n\n```\n$ make linux_examples\n```\n\n## Licence\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Ffortran-unix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterkosmos%2Ffortran-unix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterkosmos%2Ffortran-unix/lists"}