The root directory of the GROMACS repository only contains CMakeLists.txt (the root file for the CMake build system), a few files supporting the build system, and a few standard informative files (README etc.). The INSTALL is generated for source packages from docs/install-guide/index.rst.
All other content is in the following top-level directories:
The following figure shows a high-level view of components of what gets built from the source code under src/ and how the code is organized. The build system is described in detail in Build system overview. With default options, the green and white components are built as part of the default target. If GMX_BUILD_MDRUN_ONLY is ON, then the blue and white components are built instead; libgromacs_mdrun is built from a subset of the code used for libgromacs. The gray parts are for testing, and are by default only built as part of the tests target, but if GMX_DEVELOPER_BUILD is ON, then these are included in the default build target. See Unit testing for details of the testing side.
All the source code (except for the analysis template) is under the src/ directory. Only a few files related to the build system are included at the root level. All actual code is in subdirectories:
When compiling, the include search path is set to src/. Some directories from under src/external/ may also be included, depending on the compilation options.
The libgromacs library is built from code under src/gromacs/. Again, the top-level directory contains build and installation rules for the library, and public API convenience headers. These convenience headers provide the main installed headers that other code can use. They do not contain any declarations, but only include a suitable set of headers from the subdirectories. They typically also contain high-level Doxygen documentation for the subdirectory with the same name: module.h corresponds to module/.
The code is organized into subdirectories. These subdirectories are denoted as modules throughout this documentation. Each module consists of a set of routines that do some well-defined task or a collection of tasks.
Installed headers are a subset of the headers under src/gromacs/. They are installed into a corresponding hierarchy under include/gromacs/ in the installation directory. Comments at the top of the header files contain a note about their visibility: public (installed), intra-library (can be used from inside the library), or intra-module/intra-file.
See Naming conventions for some common naming patterns for files that can help locating declarations.
Tests, and data required for them, are in a tests/ subdirectory under the module directory. See Unit testing for more details.
For historical reasons, there are directories src/gromacs/gmxana/, src/gromacs/gmxlib/, src/gromacs/mdlib/, and src/gromacs/gmxpreprocess/ that do not follow the above rules. The installed headers for these are in src/gromacs/legacyheaders/. The aim is to gradually get rid of these directories and move code into proper modules.
All documentation (including this developer guide) is produced from source files under docs/, except for some command-line help that is generated from the source code (by executing the compiled gmx binary). The build system provides various custom targets that build the documentation; see Build system overview for details.
Man pages for programs are generated by running the gmx executable after compiling it, and then using Sphinx on the reStructuredText files that gmx writes out.
The build rules for the man pages are in docs/CMakeLists.txt.
The organization of the developer guide is explained on the front page of the guide.
The Doxygen documentation is made of a few different parts. Use the list below as a guideline on where to look for a particular kind of content. Since the documentation has been written over a long period of time and the approach has evolved, not all the documentation yet follows these guidelines, but this is where we are aiming at.