Language Interoperability Tools
Advanced Computing Laboratory,
Latest version: 1.3.0 (July 13, 2005)
|
Introduction to Chasm
Chasm is a language transformation system created to improve Fortran
and C/C++ language interoperability. Chasm (with the aid of
associated tools) parses Fortran and C/C++ source code and automatically
generates bridging code that can be used to make calls to routines in the
foreign language. Chasm also supplies an array-descriptor library that
provides an interface between C and F90 assumed-shape arrays. This
allows arrays to be created in one language and then passed to and
used by the other (foreign) language.
Chasm tools work by parsing Fortran and C/C++ source files and generating an XML file. The XML file describes C++ classes, Fortran modules, user-defined types, functions, and function parameters. XSLT stylesheets are used to transform the XML file into bridging code that is used to call C++ and Fortran routines.
The latest release of Chasm (version 1.3.0) features XSLT stylesheets for the assisted development of CCA/Babel components from legacy code. This XSLT code (see the chasm/xform directory and search for files beginning with "cca") is contributed to show the generality of the Chasm language transformation system. An example of the generated code can be seen by running make in the chasm/example/cca-tutorial directory.
The array-descriptor library is a low-level C library used to manipulate Fortran array descriptors (dope vectors). It is the only way one can pass F90 assumed-shape arrays and array sections between C and Fortran. This library is primarily aimed at interoperability tool developers, rather than end users. An example of how this library can be used may be found in the project's contrib/NumPy/ directory. This example demonstrates how to use F90 arrays with the Python Numeric library.
Of particular interest to some may be the tool to generate xml files, describing interface-level information, from Fortran and C++ sources. This tool may be found in the project's src/xmlgen/ directory. This tool is required (and is included with The Program Database Toolkit,   needed by Chasm for C/C++ processing. For Fortran processing, try the gfortran2xml project.
The API documentation is produced by DOxygen in two formats:
Links to related projects:
- The Program Database Toolkit   [required by Chasm for C/C++ language parsing]
- The gfortran2xml project [required for Fortran parsing]
- Common Component Architecture
- Babel   [a language interoperability project based on an Interface Definition Language (IDL)]