openmm / openmm-plumed

OpenMM plugin to interface with PLUMED
55 stars 23 forks source link

Installation problem: Make error #11

Closed aghanbar closed 6 years ago

aghanbar commented 6 years ago

Hi, When I try to build the plugin, I get these:

[ 31%] Built target OpenMMPlumed
[ 31%] Linking CXX executable TestSerializePlumedForce
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `testSerialization()':
TestSerializePlumedForce.cpp:(.text+0x1f5): undefined reference to `OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `void OpenMM::XmlSerializer::serialize<PlumedPlugin::PlumedForce>(PlumedPlugin::PlumedForce const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::ostream&)':
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x72): undefined reference to `OpenMM::SerializationNode::setName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0xe1): undefined reference to `OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x121): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x17d): undefined reference to `OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo]+0x1c3): undefined reference to `OpenMM::SerializationNode::setStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, OpenMM::ContextImpl&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
collect2: error: ld returned 1 exit status
serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/build.make:95: recipe for target 'serialization/tests/TestSerializePlumedForce' failed
make[2]: *** [serialization/tests/TestSerializePlumedForce] Error 1
CMakeFiles/Makefile2:122: recipe for target 'serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all' failed
make[1]: *** [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

This is the screen shot of the configure settings:

screenshot at 2017-12-27 22 06 33

Any idea what I'm doing wrong?

peastman commented 6 years ago

I think I know what's happening. GCC 5.1 introduced a new ABI that broke compatibility with any function that uses a std::string or std::list. The OpenMM libraries are compiled with the old ABI, so you need to tell GCC to use that as well. You can do that by telling CMake to include an extra command line argument. I think the argument you want is -D_GLIBCXX_USE_CXX11_ABI=0, though I haven't actually tested it. Add that to CMAKE_CXX_FLAGS. For details on this issue, see https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html.

aghanbar commented 6 years ago

Thanks! I confirm the solution works.