{"id":19973267,"url":"https://github.com/zeromq/f77_zmq","last_synced_at":"2025-05-04T02:31:55.418Z","repository":{"id":23094527,"uuid":"26448539","full_name":"zeromq/f77_zmq","owner":"zeromq","description":"Fortran binding for ZeroMQ","archived":false,"fork":false,"pushed_at":"2022-10-31T16:47:13.000Z","size":100,"stargazers_count":13,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-08T23:17:01.171Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zeromq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-10T18:07:07.000Z","updated_at":"2021-12-18T19:06:25.000Z","dependencies_parsed_at":"2023-01-13T22:44:43.893Z","dependency_job_id":null,"html_url":"https://github.com/zeromq/f77_zmq","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ff77_zmq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ff77_zmq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ff77_zmq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zeromq%2Ff77_zmq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zeromq","download_url":"https://codeload.github.com/zeromq/f77_zmq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224379916,"owners_count":17301525,"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":[],"created_at":"2024-11-13T03:10:50.110Z","updated_at":"2024-11-13T03:10:50.746Z","avatar_url":"https://github.com/zeromq.png","language":"C","funding_links":[],"categories":["Codes"],"sub_categories":["Message Passing"],"readme":"# F77\\_ZMQ\n\n[![Build Status](https://travis-ci.org/scemama/f77_zmq.svg?branch=master)](https://travis-ci.org/scemama/f77_zmq)\n\nA Fortran 77 binding library for [ZeroMQ](http://zeromq.org)\n\nThis binding works with [ZeroMQ 4.3.1](https://github.com/zeromq/zeromq4-3).\n\n## Usage\n\nCopy the `f77_zmq.h` or `f77_zmq_free.h` and `libf77zmq.so` or `libf77zmq.a` files into\nyour project. The `f77_zmq.h` is for fixed format and `f77_zmq_free.h` is for free format.\n\nIn your Fortran source files, include the `f77_zmq.h` or `f77_zmq_free.h` file.\nThis will define all the `ZMQ_*` constants.\nAll the pointers (to sockets, messages, polling items, etc) are defined as `integer(ZMQ_PTR)`\nin order to handle 32-bit or 64-bit pointers.\n\nIn your Makefile, compile as follows:\n\n```\n$(FC) -o $(TARGET) $(OBJ) -lzmq -lf77zmq \n```\n\nor\n\n```\n$(FC) -o $(TARGET) $(OBJ) -lzmq libf77zmq.a\n```\n\nBe sure that `libzmq.so.5` is present in your `LD_LIBRARY_PATH` before executing the program.\n\n\n\n## Installation instructions\n\n\nPython3 is required to create the `f77_zmq.h` and `f77_zmq_free.h` files.\n\nIf `zmq.h` is not in yout `CPATH`, set the `ZMQ_H` environment variable to the absolute path\nof `zmq.h`, and run `make`.\nThe default compiler is `gcc`.\n\nFor example:\n\n```\n$ export ZMQ_H=/usr/include/zmq.h\n$ make\n```\n\n\n## Differences with the C API\n\nIn Fortran77 structs don't exist: they have been introduced with Fortran90.\nTo maintain F77 compatibility, the structs are created using C functions\nand their pointers are passed to the Fortran. This implies the addition\nof a few functions.\n\n### Additional Message-related functions\n\n* `integer(ZMQ_PTR) f77_zmq_msg_new()` : Allocates a `zmq_msg_t` and returns the pointer\n\n* `integer f77_zmq_msg_destroy(msg)` : Deallocates the `zmq_msg_t`. Return value is `0`.\n\n  + `integer(ZMQ_PTR) msg` : message \n\n* `integer(ZMQ_PTR) f77_zmq_msg_data_new(size, buffer, size_buffer)` : Allocates a data\n  buffer for messages, and copies the buffer into the data segment. If `size_buffer` is `0`,\n  the data segement is uninitialized. The return value is a pointer to the data segment.\n\n  + `integer size` : Size of the data segment to allocate\n  + `buffer` : Buffer to copy. Fortran array or string.\n  + `integer size_buffer` : Number of bytes to copy from the buffer\n\n* `integer f77_zmq_msg_destroy_data(data)` : Deallocates a data segment. Return value is `0`.\n\n  + `integer(ZMQ_PTR) data` : pointer to the data segment to deallocate.\n\n* `integer f77_zmq_msg_copy_from_data(msg, buffer)` : Copies the data segment of a message \n  into a buffer.\n\n  + `integer(ZMQ_PTR) msg` : message\n  + `buffer` : fortran array of string\n\n* `integer f77_zmq_msg_copy_to_data(msg, buffer, size)` : Copies the data segment of a message \n  into a buffer.\n\n  + `integer(ZMQ_PTR) msg` : message\n  + `buffer` : fortran array of string\n  + `integer size` : Number of bytes to copy\n\n\n### Additional Polling-related functions\n\n* `integer(ZMQ_PTR) f77_zmq_pollitem_new()` : Allocates a `zmq_pollitem_t` and returns the pointer\n\n* `integer f77_zmq_pollitem_destroy(item)` : Deallocates the `zmq_pollitem_t`. Return value is `0`.\n\n  + `integer(ZMQ_PTR) item` : poll item struct\n\n### Improvements\n\nThis interface is quite old. Now, Fortran has introduced the `iso_c_bindings`\nmodule which allows to call C functions in a standard and portable way.  This\ninterface should be rewritten using `iso_c_bindings` to be more portable.  I\ndon't have time to do it myself, but if somebody wants to start this project I\nwill be happy to help.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Ff77_zmq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzeromq%2Ff77_zmq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzeromq%2Ff77_zmq/lists"}