catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Display Catalyst Version in `quantum-opt --version` Output

Open sengthai opened this issue 7 months ago • 0 comments
trafficstars

Current Behavior: Running the command:

quantum-opt --version

Currently, return:

LLVM (http://llvm.org/):
  LLVM version 19.0.0git
  Optimized build with assertions.

It only displays the LLVM version.

Expected Behavior: It should also display the Catalyst version alongside the LLVM version. For example:

For example:

Catalyst version 0.10.0
LLVM (http://llvm.org/):
  LLVM version 19.0.0git
  Optimized build with assertions.

Proposed Solution:

  • Update the version printer in mlir/tools/quantum-opt/quantum-opt.cpp to include the Catalyst version.
  • Use the llvm::cl::AddExtraVersionPrinter function, as documented here: AddExtraVersionPrinter

Notes:

  • The Catalyst version is defined in frontend/catalyst/_version.py.
  • The version string should be retrieved from there. If that’s not feasible in C++, an alternative such as pulling the version from the Git metadata or generating it at build time would be great.

sengthai avatar Mar 24 '25 17:03 sengthai