Task #3279

Provide more advice for building client software

Added by Eric Irrgang 6 months ago. Updated 4 months ago.

build system
Target version:


The gromacs-toolchain${GMX_LIBS_SUFFIX}.cmake file installed by InstallLibInfo.cmake is not documented or mentioned in warning messages. For instance, gromacs-config.cmake defines gromacs_check_compiler() to help client code identify a compatible toolchain, but only gives the value of ${GROMACS_${LANG}_COMPILER}. The CMake toolchain file was introduced to help client software initialize CMake with appropriate compilers (or compiler wrappers), but GMXTOOLCHAINDIR and -DCMAKE_TOOLCHAIN_FILE do not appear in any documentation.

As part of resolving this issue, we may want to evaluate whether a CMake toolchain file is the correct and only solution. An alternative may be a packaged subset of CMake cache variables to be loaded with "-C".

Note that we may want to distinguish between an MPI compiler wrapper and the wrapped compiler, which the generated toolchain file does not currently do.

Related issues

Related to GROMACS - Task #2045: API design and language bindingsNew


#1 Updated by Erik Lindahl 4 months ago

  • Priority changed from Normal to Low

While I see how it could be useful, the problem is that it is yet another addition to our already quite complex build system configuration, which then everyone will have to learn and keep updating. We've already seen that in a couple of cases, such as the originally trivial extension to build our own FFTW version. In some cases we simply need to make the call that it's not worth investing ~100h from the development team to save mere minutes for users.

Thus, unless we have any volunteer wanting to do this, and who has a clear plan how it can be done with very little effort and close to no extra CMake code, my hunch would be to reject it :-)

#2 Updated by Eric Irrgang 4 months ago

  • Related to Task #2045: API design and language bindings added

#3 Updated by Eric Irrgang 4 months ago

I don't think this is about saving time for users, necessarily, but about choosing and documenting the normative mode of building client software and tracking the implementation of the agreed upon support infrastructure.

The main unsolved problem as of a couple of years ago was that it was hard to determine (after the fact) which compilers had been used to build GROMACS. gromacs_check_compiler() warns if you're doing it wrong, but an effective alternative was not presented.

We explored using a CMake toolchains file. The current issue points out that we should either improve the documentation and implementation or choose an alternative recommendation for achieving a compatible client build environment. I don't think this presents additional maintenance burden beyond testing that the recommended procedure for building client software is documented and correct.

Use case: build client software against a GROMACS installation.

Scenario: different default compilers, no toolchains file.
  • following the docs in the doxygen main page, gromacs_check_compiler() issues a warning, but it is not clear what to do differently.
Scenario: different default compilers, use toolchains file.
  • supposedly, this is now recommended and seems to work fine, but is not well documented or referenced in error messages.
  • additional export variables may be warranted to best support cases where one or both of GROMACS and the client software are built with MPI.

Also available in: Atom PDF