Compilation failure for gromacs 2021.1 and 2021.2 with cmake 3.20.2


As part of Homebrew ( we are trying to build Gromacs 2021.2 with cmake 3.20.2 (gromacs 2021.2 by chenrui333 · Pull Request #76819 · Homebrew/homebrew-core · GitHub). We are seeing the following build failure:

-- Could not convert sample image, ImageMagick convert can not be used. A possible way to fix it can be found here:
-- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE pygments) (Required is at least version "1.6.1")
CMake Error at api/nblib/CMakeLists.txt:79 (add_dependencies):
  Cannot add target-level dependencies to non-existent target "tests".

We are seeing this same error with both gromacs 2021.1 and 2021.2, with both gcc 10.3.0 and gcc 11.1.0. The build for gromacs 2021.1 was previously working, but it was with an earlier version of cmake. So, we suspect that this is a cmake incompatibility issue.

We run cmake with the following arguments:


Has someone seen this error, or can provide any hint at how to fix it?

Hello, we are aware of this and have Allow to build and install nblib and gmxapi without GMX TESTS enabled (!1494) · Merge requests · GROMACS / GROMACS · GitLab that resolves the issue, but regretfully didn’t make it into the 2021.2 patch release.

Can you try the fix in the patch if it resolves your issue?