catalyst
catalyst copied to clipboard
Display Catalyst Version in `quantum-opt --version` Output
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.cppto include the Catalyst version. - Use the
llvm::cl::AddExtraVersionPrinterfunction, 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.