Compiling standalone C/C++ analysis scripts for gromacs

I am interested in learning how to write custom C/C++ codes that can read trr and tpr file and perform some custom analysis.

I would like some help to get the process started as I am struggling with the fundamentals.

  1. How should I compile Gromacs: template.cpp ?
g++ -o a.out template.cpp -I${HOME}/softwares/gromacs-2023.3/src/
template.cpp:49:10: fatal error: gromacs/analysisdata/analysisdata.h: No such file or directory
   49 | #include "gromacs/analysisdata/analysisdata.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

The src folder contains gromacs/analysisdata but no analysis data.h

  1. Can we compile standalone cpp binaries as shown above (assuming errors gets resolved) or entire gromacs needs to be reinstalled that would include the new trajectory analysis?

  2. Regarding C wrappers specified in xtc file format. I tried to compile a C code with

include "gromacs/fileio/xtcio.h"

I get the following error.

In file included from foo3.c:3:
//srv/home/smahajan29/softwares/gromacs-2023.3/src/gromacs/fileio/xtcio.h:38:10: fatal error: filesystem: No such file or directory
   38 | #include <filesystem>
      |          ^~~~~~~~~~~~
compilation terminated.

I am working with gcc 11.3.0. I have loaded all the modules that are required for gromacs installation. So I am not sure why I am getting an error associated with filesystem. My installation directory /include/gromacs/ only contains mdrun and no folder named fileio.

It seems like I am blindly shooting arrows here! I would appreciate any help or resources that would help me to overcome this roadblock. Thank you in advance.