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

"LangevinIntegrator is not a member of OpenMM" error on make PythonInstall #28

Open
SCMusson opened this issue Mar 23, 2022 · 2 comments

Comments

@SCMusson
Copy link

I have come across an error that is really perplexing me.

I have tried to create a custom integrator. It compiles, and tests are all successful. But when I come to make the python wrappers i run into issues with this error code:

ExamplePluginWrapper.cpp: In function ‘void* _p_OpenMM__LangevinIntegratorTo_p_OpenMM__Integrator(void*, int*)’:
ExamplePluginWrapper.cpp:10474:55: error: ‘LangevinIntegrator’ is not a member of ‘OpenMM’
     return (void *)((OpenMM::Integrator *)  ((OpenMM::LangevinIntegrator *) x));
                                                       ^~~~~~~~~~~~~~~~~~
ExamplePluginWrapper.cpp:10474:55: note: suggested alternative: ‘DrudeLangevinIntegrator’
     return (void *)((OpenMM::Integrator *)  ((OpenMM::LangevinIntegrator *) x));
                                                       ^~~~~~~~~~~~~~~~~~
                                                       DrudeLangevinIntegrator
ExamplePluginWrapper.cpp:10474:75: error: expected primary-expression before ‘)’ token
     return (void *)((OpenMM::Integrator *)  ((OpenMM::LangevinIntegrator *) x));
                                                                           ^
ExamplePluginWrapper.cpp:10474:77: error: expected ‘)’ before ‘x’
     return (void *)((OpenMM::Integrator *)  ((OpenMM::LangevinIntegrator *) x));
                                                                             ^
ExamplePluginWrapper.cpp:10474:80: error: expected ‘)’ before ‘;’ token
     return (void *)((OpenMM::Integrator *)  ((OpenMM::LangevinIntegrator *) x));
                                                                                ^

I haven't touched OpenMM::LangevinIntegrator and it doesn't have a problem with anything else

@SCMusson
Copy link
Author

To be clear, my exampleplugin.i file has these imports:

#include "MyIntegrator.h"
#include "OpenMM.h"
#include "OpenMMAmoeba.h"
#include "OpenMMDrude.h"
#include "openmm/RPMDIntegrator.h"
#include "openmm/RPMDMonteCarloBarostat.h"

If I remove the "#include "OpenMMDrude.h" I get the same error with "DrudeNoseHooverIntegration" is not a member of "OpenMM" so I assume that it is a matter of including the correct file.

I have tried "#inculde "openmm/LangevinIntegrator.h", "#include "openmm/Integrator.h" without success

@SCMusson
Copy link
Author

I made the most disturbing hacky fix for this. I removed all mentions of LangevinIntegrator from a copy of OpenMMSwigHeaders.i called myOpenMMSwigHeaders.i and imported this instead of OpenMMSwigHeaders.i.
I hate this solution and hate myself for not having the energy to debug this further. If anyone can suggest a real solution please let me know.

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

No branches or pull requests

1 participant