qmcpack icon indicating copy to clipboard operation
qmcpack copied to clipboard

Migration planning for catch2 v3

Open prckent opened this issue 8 months ago • 0 comments

This issue exists to get comments and preferences for updating our now several-years old v2 catch2 to the modern v3 version. It is a compiled library and there have been various modest updates that make for a not completely trivial replacement. Clearly it is not an urgent update, but upgrading would allow us to benefit from e.g. years of bug fixes, potentially faster compile times, and improved functionality for floating point comparison.

https://github.com/catchorg/Catch2/blob/devel/docs/migrate-v2-to-v3.md

Brief experimentation with a system-wide catch2 installation indicates the migration would be a modest amount of work, but it would involve changes to lots of files. Hence this issue to get input before building a PR.

  1. While not ideal, I think we should still vendor a private copy of catch2 in external_codes/catch2. No user is likely have this installed, and I would prefer we not add another external dependency.

  2. Our local catch2 v2 is modified https://github.com/QMCPACK/qmcpack/blob/develop/external_codes/catch/Readme

2.1 Importantly the value of m_scale for Approx is modified internally. I think we should modify all our code to use the official unmodified release and standard APIs. This would require adding .scale(1.0) after most of the existing floating point comparisons.

2.2 We add a custom ComplexApprox and LogComplexApprox. These would need updating and placing in e.g. src/Utilities/for_testing, where @PDoakORNL already has some catch helpers.

  1. Initial port would use #include <catch2/catch_all.hpp>.

prckent avatar Mar 31 '25 11:03 prckent