openmm / openmm-plumed

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

Compile error #36

Closed CryoSky closed 4 years ago

CryoSky commented 4 years ago

Hi, When I try to compile this package I met this problem. Could anyone knows which part of configuration is wrong? Is that caused by the CUDA library?

[ 27%] Building CXX object serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o Linking CXX executable TestSerializePlumedForce /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: in function testSerialization()': TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x3bc): undefined reference toOpenMM::SerializationNode::setName(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x405): undefined reference to OpenMM::SerializationNode::hasProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x430): undefined reference toOpenMM::SerializationProxy::getTypeName[abi:cxx11]() const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x468): 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&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0xb67): undefined reference toOpenMM::throwException(char const*, int, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0xffc): undefined reference to OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x149d): undefined reference toOpenMM::throwException(char const, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x1951): undefined reference to `OpenMM::throwException(char const, int, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: TestSerializePlumedForce.cpp:(.text._Z17testSerializationv+0x2245): undefined reference to OpenMM::SerializationProxy::getTypeName[abi:cxx11]() const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference toOpenMM::Platform::createKernel(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, OpenMM::ContextImpl&) const' /home/sj52/anaconda3/bin/../lzju.edu.cnib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getIntProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getChildNode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference toOpenMM::SerializationNode::setDoubleProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, double)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getStringProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getBoolProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference toOpenMM::SerializationNode::setIntProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::createChildNode(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to OpenMM::SerializationNode::getDoubleProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference toOpenMM::SerializationNode::setBoolProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: ../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld: /home/sj52/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.3.0/../../../../x86_64-conda_cos6-linux-gnu/bin/ld generated: undefined reference to `OpenMM::SerializationNode::setStringProperty(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' collect2: error: ld returned 1 exit status make[2]: [serialization/tests/TestSerializePlumedForce] Error 1 make[1]: [serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/all] Error 2 make: *** [all] Error 2

CryoSky commented 4 years ago

I have attached my compile commands for ccmake. Are there anything wrong? CMAKE_BUILD_TYPE
CMAKE_INSTALL_PREFIX /home/sj52/anaconda3/envs/openmm
CUDA_BUILD_CUBIN OFF
CUDA_BUILD_EMULATION OFF
CUDA_HOST_COMPILER /home/sj52/anaconda3/envs/openmm/bin/x86_64-conda_cos6-linux-gnu-cc CUDA_SDK_ROOT_DIR /usr/local/cuda
CUDA_SEPARABLE_COMPILATION OFF
CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda
CUDA_VERBOSE_BUILD OFF
OPENCL_INCLUDE_DIR /usr/local/cuda/include
OPENCL_LIBRARY /usr/local/cuda/lib64/libOpenCL.so
OPENMM_DIR /home/sj52/anaconda3/envs/openmm
PLUMED_BUILD_CUDA_LIB ON
PLUMED_BUILD_OPENCL_LIB ON
PLUMED_BUILD_PYTHON_WRAPPERS OFF
PLUMED_INCLUDE_DIR /home/sj52/Backup/plumed_254/include
PLUMED_LIBRARY_DIR /home/sj52/Backup/plumed_254/lib
PYTHON_EXECUTABLE /home/sj52/anaconda3/envs/openmm/bin/python
SWIG_EXECUTABLE /usr/bin/swig

peastman commented 4 years ago

This looks to me like an ABI inconsistency. Notice the missing symbols all include std::__cxx11. That's the marker for the C++11 ABI.

Did you install OpenMM with conda, or did you build it from source? If the latter, what compiler did you use?

CryoSky commented 4 years ago

Dear Peter, I install OpenMM with conda. Does that mean the C++ compiler set wrong?

peastman commented 4 years ago

See https://github.com/openmm/openmm-plumed/issues/24. It describes how to fix the problem.

CryoSky commented 4 years ago

See #24. It describes how to fix the problem.

Dear Peter, Apologies for the delay. Thank you very much for providing the link of the previous issue. I tried to add '-D_GLIBCXX_USE_CXX11_ABI=0' to the extra_compile_args line in setup.py but got the exactly same error when I type make install after I clean the temporary file from previous failed try. I use the Red Hat 7.0 system and compile with ccmake .. I keep all other compile commands in the ccmake GUI same.

Besides, I tried to type make PythonInstall but get "make: *** No rule to make target `PythonInstall'. Stop."

I found the dependencies of libOpenMMPlumed.so by type ldd libOpenMMPlumed.so.

linux-vdso.so.1 =>  (0x00007ffcafdba000)
libOpenMM.so => /home/sj52/anaconda3/envs/openmm/lib/libOpenMM.so (0x00007f4a36a4e000)
libstdc++.so.6 => /home/sj52/anaconda3/lib/libstdc++.so.6 (0x00007f4a3704b000)
libgcc_s.so.1 => /home/sj52/anaconda3/lib/libgcc_s.so.1 (0x00007f4a37037000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4a36680000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4a36478000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4a36274000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4a36058000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4a35d56000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4a36faa000)

Best,

CryoSky commented 4 years ago

Hi Peter, Thank you very much I think I solved this problem. The '-D_GLIBCXX_USE_CXX11_ABI=0' should be added in the advanced mode of ccmake GUI. I didn't find that at first.