Package: llnl-shroud
Shroud: generate Fortran and Python wrappers for C and C++ libraries.Shroudis a tool for creating a Fortran or Python interface to a C
or C++ library.  It can also create a C API for a C++ library.The user creates a YAML file with the C/C++ declarations to be wrapped
along with some annotations to provide semantic information and code
generation options.Shroudproduces a wrapper for the library.
The generated code is highly-readable and intended to be similar to code
that would be hand-written to create the bindings.verbwrap or dress (a body) in a shroud for burial.cover or envelop so as to conceal from view.GoalsSimplify the creating of wrapper for a C++ library.Preserves the object-oriented style of C++ classes.Create an idiomatic wrapper API from the C++ API.Generate code which is easy to understand.No dependent runtime library.ExampleThe user creates a YAML file which includes declarations fromzoo.hpp.library: zoo
cxx_header: zoo.hpp

declarations:
- decl: class Animal
  declarations:
  - decl: Animal()
  - decl: void speak(const std::string &word)This creates a Fortran interface which can be used as:use zoo_mod
type(Animal) dog
dog = Animal()
dog%speak("woof")And from Pythonimport zoo
dog = zoo.Animal()
dog.speak("woof")DocumentationTo get started using Shroud, check out the full documentation:http://shroud.readthedocs.io/en/developPresentation at FortranCon2020https://www.youtube.com/watch?v=1mdI-M94vDcSlidesMailing Listshroud-users@groups.iohttps://groups.io/g/shroud-usersRequired Packagesyaml -https://pypi.python.org/pypi/PyYAMLC++ to C to FortranThe generated Fortran requires a Fortran 2003 compiler.C++ or C to PythonThe generated Python requires Python 2.7 or 3.4+.Python features:Uses NumPy for arrays. Also able to use Python lists if NumPy is overkill.Uses extension type for classes.Creates readable source.Getting startedShroud can be installed using pippip install llnl-shroudThis can be done in a virtual environment ascd my_project_folder
virtualenv my_project
source my_project/bin/activate
pip install llnl-shroudThis assumes the bash shell. Source activate.csh for csh.In addition, a file created byshivis available from the github release.
Shroud and PyYAML are bundled into a single executable which uses
the Python3 on your path.
Shiv requires Python 3.6+.wget https://github.com/LLNL/shroud/archive/shroud-0.13.0.pyzLicenseCopyright (c) 2017-2023, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory.SPDX-License-Identifier: (BSD-3-Clause)SeeLICENSEfor detailsUnlimited Open Source - BSD 3-clause DistributionLLNL-CODE-738041OCEC-17-143SPDX usageIndividual files contain SPDX tags instead of the full license text.
This enables machine processing of license information based on the SPDX
License Identifiers that are available here:https://spdx.org/licenses/Files that are licensed as BSD 3-Clause contain the following
text in the license header:SPDX-License-Identifier: (BSD-3-Clause)External PackagesShroud bundles some of its external dependencies in its repository.  These
packages are covered by various permissive licenses.  A summary listing
follows.  See the license included with each package for full details.PackageName: fruitPackageHomePage:https://sourceforge.net/projects/fortranxunit/PackageLicenseDeclared: BSD-3-Clause