-
Notifications
You must be signed in to change notification settings - Fork 6
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
Python: undefined symbol: _ZN8NNPlugin18NeuralNetworkForceC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE #8
Comments
Those declarations are identical. And it's working fine for me, so I don't think it's a problem in the SWIG definition. Much more likely this is caused by an ABI inconsistency, for example one library being compiled with C++11 support and another one without it. What OpenMM version are you using, and did you build it from source or install it with conda? 7.2 did not use C++11, but 7.3 does. Also see https://github.com/peastman/openmm-plumed/issues/2, which was a similar problem with a different plugin. |
my openMM was installed with conda. During ccmake of the plugin I have had to specify -D_GLIBCXX_USE_CXX11_ABI=0 to make it compile. Thanks for taking a look! |
That sounds like the problem then. Notice the symbol it's looking for contains the substring |
Hi, I installed OpenMM 7.3 with conda and as I understand it was compiled with C++11. I am having the same issue with an unresolved reference I have been through all the issues regarding #16 and #2, the only way I managed to compile the latest plugin was setting Can you help me resolve this? Many thanks, Istvan |
The closest symbol in libOpenMMPlumed.so is _ZN12PlumedPlugin11PlumedForceC1ERKSs. |
OpenMM 7.3 is compiled for C++11. Are you sure you aren't actually trying to link against an older version? |
As far as I can tell, I am not linking against an older version. This is the first OpenMM on this computer and I started with the latest version of everything. My system is Ubuntu 18.04. This issue feels like a catch 22, I ended up installing OpenMM from source yesterday and now the Plumed plugin works flawlessly. :) Thanks, Istvan |
Ok. I was going to ask you to post the full log so I could see exactly where the error was happening and everything leading up to it. But if you already have it working, probably better not to mess with it! |
Peter, if it helps I'd be happy to reproduce the problem, just let me know what exactly you need. |
Can you post the complete error log, and exactly what you did to produce it? |
Will try to reproduce it and capture the output. |
I think I captured everything, tell me if you need anything else. I didn't log how I built plumed-2.50 itself, but that shouldn't matter, and as I said everything works well when I build OpenMM from source. (I remember also trying to build the plugin with anaconda2 installation of OpenMM, but the result was the same, although the actual symbol missing might have been different.) |
The file you posted is getting errors related to the Plumed plugin, not the neural network plugin. Was that from something else? It may well be the same problem though. There's some inconsistency between the symbols in the plugin library (
but I think your grep was too specific, because it didn't find the constructor we're looking for. Try searching for something more generic like |
Sorry, I did realize afterwards that this wasn't a plumed thread, I somehow got here via Google searching my missing symbol.
The Python module has only two symbols related to the Plugin and both of them are missing from the Plugin module. In any case, it works fine when I compile OpenMM from source, I am in business. -Thanks |
Ok, I think I sort of see what's happening. I don't think it's related to the use of C++11. It's actually related to the "dual ABI" introduced in GCC 5.1. See https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html for details. Basically, libstdc++ now includes two different implementations of The OpenMM conda packages are compiled to use the newer version. But apparently your compiler is defaulting to the older one when compiling the plugin, leading to the incompatibility. Instead of recompiling OpenMM, try specifying |
I already tried that. Whether not specifying any ABI or ABI=1 results in the same error message that I captured in the openmm-plumed-bulid-log.txt file. I can only compile the plugin when I set ABI=0. The compiler is the stock Ubuntu 18.04 gcc, I think it is version 7.3. From what you say it seems that I'll need a different compiler, maybe building gcc from scratch? |
No idea why that would happen. The conda packages are compiled with clang, but that shouldn't matter. Both compilers are capable of using either ABI. |
When I compile both OpenMM and the Plugin with the stock gcc the compatible functions are used by default. I guess, at this point that's my only option. It would be nice to have everything under the same anaconda umbrella, but it is working, so that's perfectly fine for now. -Thanks |
How did you solve the problem during the installation I get almost the same error! |
Hi, This has to do with the ABI settings of your libraries. It took a long time for me to make it work and I still am not sure what the final trick was. You have to get all the libraries use the same ABI and/or set the correct GLIBCXX_USE_CXX11_ABI setting. Alberto |
Hi, |
Compilation and "make PythonInstall" now works.
However when I try to issue "from openmmnn import *" in python I get:
I checked and found that in: https://github.com/pandegroup/openmm-nn/blob/master/openmmapi/src/NeuralNetworkForce.cpp the constructur seems defined as:
NeuralNetworkForce::NeuralNetworkForce(const std::string& file) : file(file), usePeriodic(false)
While in: https://github.com/pandegroup/openmm-nn/blob/master/openmmapi/include/NeuralNetworkForce.h it is given as:
NeuralNetworkForce(const std::string& file);
Could this be the cause?
Alberto
The text was updated successfully, but these errors were encountered: