Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Unknown command-line option -include" with cbook.add_mdp_includes() #276

Open
a-ws-m opened this issue Jun 12, 2024 · 1 comment
Open
Labels

Comments

@a-ws-m
Copy link

a-ws-m commented Jun 12, 2024

When I use gromacs.setup.energy_minimize() or gromacs.setup.MD(), I get the following error:

Program:     gmx grompp, version 2023.1
Source file: src/gromacs/commandline/cmdlineparser.cpp (line 271)
Function:    void gmx::CommandLineParser::parse(int*, char**)

Error in user input:
Invalid command-line options
    Unknown command-line option -include

For more information and tips for troubleshooting, please check the GROMACS
website at http://www.gromacs.org/Documentation/Errors

If I remove the contents of gromacs.cbook.add_mdp_includes(), the code works fine. Presumably it's necessary for some use cases, but I think the arguments need to be added to the MDP file, rather than on the command line.

@orbeckst
Copy link
Member

The include = -I. -I.. line is always added so it's always present as an mdp_kwarg. However, any mdp_kwargs that have not been used are assumed to be options for gmx grompp

unprocessed = cbook.edit_mdp(mdp_template, new_mdp=mdp, **kwargs)
check_mdpargs(unprocessed)

It's very ugly hack but about 15 years ago I couldn't think of anything better and obviously haven't thought about it since then.

So if you get gmx grompp -include ... (which you could verify by writing a log file with

gromacs.start_logging()

before your code starts) then I think the reason is that whatever you are using as a template for the MDP file does not contain a line

include = ...

Thus, the gw code above does not find a line in the mdp file to edit with the include, the include key is not removed from the kwargs dict, and check_mdpargs() finds stuff that it then repurposes as commandline options.

I'd try adding a include line to your MDP file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants