metacg

MetaCG offers an annotated whole program call-graph tool for Clang/LLVM.

https://github.com/tudasc/metacg

Science Score: 62.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    9 of 13 committers (69.2%) from academic institutions
  • Institutional organization owner
    Organization tudasc has institutional domain (www.sc.informatik.tu-darmstadt.de)
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.3%) to scientific vocabulary

Keywords

call-graph clang llvm whole-program-analysis

Keywords from Contributors

instrumentation profiler score-p
Last synced: 6 months ago · JSON representation ·

Repository

MetaCG offers an annotated whole program call-graph tool for Clang/LLVM.

Basic Info
  • Host: GitHub
  • Owner: tudasc
  • License: bsd-3-clause
  • Language: C++
  • Default Branch: devel
  • Homepage:
  • Size: 10.4 MB
Statistics
  • Stars: 48
  • Watchers: 5
  • Forks: 10
  • Open Issues: 12
  • Releases: 0
Topics
call-graph clang llvm whole-program-analysis
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Contributing License Citation Authors

README.md

License

MetaCG

MetaCG provides a common whole-program call-graph representation to exchange information between different tools built on top of LLVM/Clang. It uses the JSON file format and separates structure from information, i.e., caller/callee relation and meta information.

The MetaCG graph library is the fundamental component, together with, e.g., I/O facilities. The repository also contains an experimental Clang-based tool for call-graph construction at the source-code level. As an example tool, the repository contains the PGIS analysis tool, which is used as the analysis backend in PIRA. PGIS has been deprecated and may be removed in a future version.

The current default file format is MetaCG format version 4. More info on the different formats can be found in the graph README.

The MetaCG project includes pymetacg, a set of bindings that allows to parse MetaCG files from Python. Refer to the pymetacg README for more information how to build and use pymetacg.

Requirements and Building

MetaCG consists of the graph library, a CG construction tool, and an example analysis tool. The graph library is always built, while the CGCollector and the PGIS tool can be disabled at configure time.

We test MetaCG internally using GCC 11 for Clang/LLVM 13, 14, 15, 16, 17 and 18. Other version combinations may work.

Build Requirements (for graph lib) - nlohmann/json library github - spdlog github

Additional Build Requirements (for full build) - Clang/LLVM version 10 (and above) - Cube 4.5 scalasca.org - Extra-P 3.0 .tar.gz - cxxopts github - PyQt5 - matplotlib

Building

Graph Library Only

The default is to build only the graph library. The build requirements are downloaded at configure time. While CMake looks for nlohmann-json version 3.12., MetaCG should work starting from version 3.9.2. For spdlog, we rely on version 1.15.3 -- other versions may work. If you do not want to download at configure time, please use the respective CMake options listed below.

```{.sh}

To build the MetaCG library w/o PGIS or CGCollector

$> cmake -S . -B build -G Ninja -DCMAKEINSTALLPREFIX=/where/to/install $> cmake --build build --parallel $> cmake --install build ```

Build Graph Library and Tools (CGCollector, PGIS, ...)

You can configure MetaCG to also build CGCollector, PGIS and other tools based on the graphlib (cgconvert, cgformat, cgmerge2). This requires additional dependencies. Clang/LLVM (in a supported version) are assumed to be available on the system. Extra-P and Cube library can be built using the build_submodules.sh script provided in the repository, though the script is not tested outside of our CI system. It builds and installs the dependencies into ./extern.

{.sh} $> ./build_submodules.sh

Thereafter, the package can be configured and built from the top-level CMake. Change the CMAKE_INSTALL_PREFIX to where you want your MetaCG installation to live.

```{.sh}

To build the MetaCG library w/ PGIS and CGCollector

$> extinstalldir=./extern/install $> cmake -S . -B build \ -DCMAKEINSTALLPREFIX=/where/to/install \ -DCUBEDIR="$extinstalldir/cubelib" \ -DEXTRAPINCLUDE="$extinstalldir/extrap/include" \ -DEXTRAPLIB="$extinstalldir/extrap/lib" \ -DMETACGBUILDCGCOLLECTOR=ON \ -DMETACGBUILDPGIS=ON \ -DMETACGBUILDGRAPHTOOLS=ON $> cmake --build build --parallel

Installation installs CGCollector, CGMerge, CGValidate, PGIS

$> cmake --install build ```

General CMake Options

These options are common for the MetaCG package.

  • Bool METACG_BUILD_CGCOLLECTOR: Whether to build call-graph construction tool
  • Bool METACG_BUILD_PGIS: Whether to build demo-analysis tool
  • Bool METACG_USE_EXTERNAL_JSON: Search for installed version of nlohmann-json

PGIS CMake Options

These options are required when building with METACG_BUILD_PGIS=ON.

  • Path CUBE_DIR: Path to the libcube installation
  • Path EXTRAP_LIB: Path to the Extra-P library directory
  • Path EXTRAP_INCLUDE: Path to the Extra-P include directory

Usage

Graph Library

Provides the basic data structures and its means to read and write the call graph with the metadata to a JSON file. To include MetaCG as library in your project, you can simply install, find the package and link the library. This pulls in all required dependencies and compile flags.

```

In your project's CMake

findpackage(MetaCG <VERSIONSTR> REQUIRED)

Assuming you have a target MainApp

targetlinklibrary(MainApp metacg::metacg) ```

CGCollector

Clang-based call-graph generation tool for MetaCG. It has the components CGCollector, CGMerge and CGValidate to construct the partial MCG per translation unit, merge the partial MCGs into the final whole-program MCG and validate edges against a full Score-P profile, respectively.

See its README for details.

PGIS (The PIRA Analyzer)

This tool is part of the PIRA toolchain. It is used as analysis engine and constructs instrumentation selections guided by both static and dynamic information from a target application.

See its README for details.

Owner

  • Name: Scientific Computing @ TU Darmstadt
  • Login: tudasc
  • Kind: organization
  • Location: Darmstadt, Germany

Research software developed at the Institute for Scientific Computing at TU Darmstadt

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite its initial paper."
authors:
  - family-names: Lehr
    given-names: Jan-Patrick
    orcid: https://orcid.org/0000-0002-6330-4816
  - family-names: Hück
    given-names: Alexander
    orcid: https://orcid.org/0000-0003-1931-773X
  - family-names: Fischler
    given-names: Yannic
    orcid: https://orcid.org/0000-0001-7664-3895
  - family-names: Bischof
    given-names: Christian
    orcid: https://orcid.org/0000-0003-2711-3032
title: "MetaCG: annotated call-graphs to facilitate whole-program analysis"
doi: 10.1145/3427764.3428320
version: 0.3.0

GitHub Events

Total
  • Create event: 7
  • Issues event: 4
  • Release event: 2
  • Watch event: 11
  • Delete event: 7
  • Issue comment event: 72
  • Push event: 94
  • Pull request review event: 214
  • Pull request review comment event: 222
  • Pull request event: 96
  • Fork event: 5
Last Year
  • Create event: 7
  • Issues event: 4
  • Release event: 2
  • Watch event: 11
  • Delete event: 7
  • Issue comment event: 72
  • Push event: 94
  • Pull request review event: 214
  • Pull request review comment event: 222
  • Pull request event: 96
  • Fork event: 5

Committers

Last synced: 10 months ago

All Time
  • Total Commits: 235
  • Total Committers: 13
  • Avg Commits per committer: 18.077
  • Development Distribution Score (DDS): 0.409
Past Year
  • Commits: 53
  • Committers: 7
  • Avg Commits per committer: 7.571
  • Development Distribution Score (DDS): 0.755
Top Committers
Name Email Commits
Jan Lehr j****r@g****m 139
Peter Arzt p****t@t****e 26
Rickert, Jonas j****t@s****e 19
Heldmann, Tim t****n@t****e 16
Kreutzer, Sebastian s****r@t****e 9
Fischler, Yannic y****r@t****e 7
Sebastian Kreutzer S****r@g****t 7
Heldmann, Tim t****n@s****e 6
Constantin Völter c****r@s****e 2
xR3b0rn h****n@h****e 1
Hindelang, Julian j****g@s****e 1
Karpenstein, Finn f****n@s****e 1
Regfare 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 3
  • Total pull requests: 15
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 1
  • Total pull request authors: 5
  • Average comments per issue: 2.0
  • Average comments per pull request: 2.2
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 15
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 1
  • Pull request authors: 5
  • Average comments per issue: 2.0
  • Average comments per pull request: 2.2
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sebastiankreutzer (4)
  • pearzt (2)
Pull Request Authors
  • pearzt (20)
  • jplehr (20)
  • sebastiankreutzer (18)
  • TimHeldmann (7)
  • silas-martens (5)
  • gomfol12 (2)
Top Labels
Issue Labels
enhancement (3) bug (1)
Pull Request Labels
enhancement (6) bug (2)