{"id":18438564,"url":"https://github.com/arbor-sim/contra","last_synced_at":"2025-04-14T13:17:12.697Z","repository":{"id":108457234,"uuid":"152769559","full_name":"arbor-sim/contra","owner":"arbor-sim","description":"Fork of RWTH Aachen VR group project for prototyping Arbor interop in risotto","archived":false,"fork":false,"pushed_at":"2018-10-12T17:42:11.000Z","size":460,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T13:17:06.477Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://devhub.vr.rwth-aachen.de/VR-Group/contra","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arbor-sim.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-12T15:15:05.000Z","updated_at":"2018-10-12T17:42:13.000Z","dependencies_parsed_at":"2023-03-11T05:31:14.632Z","dependency_job_id":null,"html_url":"https://github.com/arbor-sim/contra","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbor-sim%2Fcontra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbor-sim%2Fcontra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbor-sim%2Fcontra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arbor-sim%2Fcontra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arbor-sim","download_url":"https://codeload.github.com/arbor-sim/contra/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248886343,"owners_count":21177645,"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-06T06:20:25.494Z","updated_at":"2025-04-14T13:17:11.918Z","avatar_url":"https://github.com/arbor-sim.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# contra -- a lightweight transport library for conduit data\n\n[License](https://devhub.vr.rwth-aachen.de/VR-Group/contra/blob/master/LICENSE)\n\n[Latest Version](https://devhub.vr.rwth-aachen.de/VR-Group/contra)\n\n![Build Status](https://devhub.vr.rwth-aachen.de/VR-Group/contra/badges/master/build.svg)\n\n# Introduction\n\nContra is designed to transport conduit data between processes.\nFor doing so it offers different kinds of transport layers which can be used.\n\nContra has been cross-developed for both Windows and Unix systems.\n\n## Supported compilers:\n  - msvc (tested with msvc++14.1) \n  - gcc (tested with gcc 7.3.1)\n  - clang (tested with clang 9.1)\n  \nOther compilers versions might work as well. \n\n## The different transport layer libraries:\n  - File Transport\n     - This is the basic transport method which comes with contra mainly for testing purposes. \n\n  - Shared Memory Transport\n    - This library uses Boost.Interproces to enable IPC via shared memory.\n    - To build it set the CMake option \"WITH_SHARED_MEMORY\" to true.\n\n    ```\n    cmake -DWITH_SHARED_MEMORY=True\n    ```      \n  - ZeroMQ Transport\n      - A TCP based transport relying on ZeroMQ for the Network Communication.\n      - To build it set the CMake option \"WITH_ZEROMQ\" to true.\n\n      ```\n    cmake -DWITH_ZEROMQ=True\n      ```\n\n# How to install contra\n\n## REQUIREMENTS\n  - [Python](https://www.python.org/)\n  - [CMake](https://cmake.org/) (v.3.6.0 or higher)\n  - [Cpplint](https://github.com/google/styleguide/tree/gh-pages/cpplint)\n  - [Catch2](https://github.com/catchorg/Catch2)\n  - [Conduit](https://github.com/LLNL/conduit)\n  - [Cppcheck](https://sourceforge.net/projects/cppcheck/)\n  - [Boost.Python](https://www.boost.org/users/download/)\n  - When building with Shared Memory Transport you will also need [Boost.Interprocess](https://www.boost.org/users/download/)\n  - When building with ZeroMQ Transport you will also need [cppzmq](https://github.com/zeromq/cppzmq)\n\ncontra is installed with CMake.\nWe also recommend using [Conan](https://conan.io/) to simplify the installation process. If you decide to not use Conan please continue at \"Installing contra without conan\".\n\n## Installing contra using Conan\n\nWhen using conan the only requirements you need to provide by your own are Python, CMake and Conan.\nMake sure that you are using a consistent Python version for both Conan and Contra.\nOnce you have Python installed, open a Terminal and follow the steps below.\n\nUse pip to install pytest conan:\n```\npip install -U pytest\npip install conan\n```\nConfigure conan to use packages which are (stil) provided by the VR-Group:\n```\nconan remote add rwth-vr--bintray https://api.bintray.com/conan/rwth-vr/conan\nconan remote add bincrafters_public https://api.bintray.com/conan/bincrafters/public-conan\n```  \nOnce Conan is ready you can use CMake to configure and build contra:\n```  \ncmake\nmake\n```  \nAfterwards change to your build directory and execute\n```\nctest\n```\nto make sure contra has been properly installed.  \n\n## Installing contra without Conan\n\nAt first install Python and CMake.\nAll other dependencies can be installed in no particular order.\n\nAfter you have all that you need, run CMake and make sure that you provide all flags needed.\nCMake will automaticly check your path for needed requirements but if it can't find them, you have to provide their locations manually.\n\n#### CMake flags:\n\n```CMake\n-DPYTHON_LIBRARY=\"path/to/python/libray\"\n-DPYTHON_INCLUDE_DIR=\"path/to/python/include\"\n-DPYTHON_EXECUTABLE=\"path/to/python\"\n\n-DCPPLINT_COMMAND=\"path/to/cpplint.py\"\n-DCPPCHECK_COMMAND=\"path/to/cppcheck\"\n```\n\n## Using Contra\n\nContra is designed to use Relays as communication nodes.\nIn most cases you will have 2 relays Communicating which each other. For the ZeroMQ transport you can have multiple CLIENT relays though.\nA relay uses a Transport layer defined at construction e.g:\n```cpp\ncontra::Relay\u003ccontra::SharedMemoryTransport\u003e relay;\n```\n\n#### The constructor arguments for the different layers with examples:\n- File Transport:\n    - Filenename (String) The names of the two relays communicating have to match!\n\n```cpp\ncontra::Relay\u003ccontra::FileTransport\u003e relay(\"testfile.contra\");\n```\n- Shared Memory Transport:\n    - Memory name(String) (Default = \"contraShMemTransp\")The names of the two relays communicating have to match!\n\n```cpp\ncontra::Relay\u003ccontra::SharedMemoryTransport\u003e relay;\n```\n- ZeroMQ Transport:\n    - Type (SERVER/CLIENT)\n    - TCP Address (String)\n    - Optional flag to indicate if you want the relay to wait for a connection to be established before sending Data (boolean)\n\n```cpp\ncontra::Relay\u003ccontra::ZMQTransport\u003e relay(contra::Relay\u003ccontra::ZMQTransport\u003e(contra::ZMQTransport::Type::SERVER, \"tcp://*:5555\");\n```\n\n\n#### Sample sending relay:\n```cpp\n#include \u003cstring\u003e\n\n#include \"contra/boost-shmem/shared_memory_transport.hpp\"\n#include \"contra/relay.hpp\"\n\nint main() {\n  conduit::Node n;\n  n[\"foo/bar\"] = 3.14;\n  contra::Relay\u003ccontra::SharedMemoryTransport\u003e relay;\n  for (int i = 0; i \u003c 5; ++i) {\n    relay.Send(n);\n  }\n  return EXIT_SUCCESS;\n}\n```\n#### Sample recieving relay:\n```cpp\n#include \u003cstring\u003e\n#include \u003cthread\u003e\n#include \"contra/boost-shmem/shared_memory_transport.hpp\"\n#include \"contra/relay.hpp\"\n\nint main() {\n  contra::Relay\u003ccontra::SharedMemoryTransport\u003e relay;\n  std::vector\u003cconduit::Node\u003e data;\n  do {\n    data = relay.Receive();\n    std::this_thread::sleep_for(std::chrono::seconds(1));\n  } while (data.size() == 0);\n\n  std::cout \u003c\u003c data[0][\"foo/bar\"].to_double();\n\n  return EXIT_SUCCESS;\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farbor-sim%2Fcontra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farbor-sim%2Fcontra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farbor-sim%2Fcontra/lists"}