Colvars: Error: keyword "customfunction" is not supported

GROMACS version: 2024.1
GROMACS modification: Yes/No

I’m new posting in the forum, but a long time GROMACS user. I have been working with the colvars module as implemented in GROMACS 2024.1 and am having problems with the “customFunction” command that allows for creating your own collective variables.

Below is an example of a very simple colvars.config script that fails with “Error: keyword “customfunction” is not supported, or not recognized in this context.”

colvar {
    name custom
    customFunction { x^2 }
    distance {
        name x
        group1 { atomNumbers 1 }
        group2 { atomNumbers 2 }
    }
}

Any thoughts on how to fix this issue? I don’t mind tweaking the source code if that is needed.

Marty

Hi Marty!

Thanks for the feedback. You are getting this error message because customFunction requires the Lepton library, which we haven’t been able to include in the GROMACS 2024 release.

Since you mention tweaking the source code, I assume that you may be able to build GROMACS from source code. To this end you can download a version of the GROMACS main branch from this link, or directly as a Zip file.

Compared to the GROMACS main branch, that branch contains:

  • A copy of the latest development version of the Colvars library
  • A copy of the Lepton library to define custom functions

The CMake procedure to building and using it is the same as the standard GROMACS.

Hope that helps,
Giacomo

That worked perfectly, thanks so much for the help!

Best regards,
Marty