Closed Zhou-Yang closed 6 years ago
You need to build against OpenMM 7.2 or later, since the signature of that function changed. You're building against 7.1.1.
changed to OpenMM 7.2.1
cmake .. \
cmake .. \
-DCMAKE_BUILD_TYPE=0 \
-DCMAKE_INSTALL_PREFIX=/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1 \
-DCUDA_HOST_COMPILER=/usr/bin/cc \
-DCUDA_SDK_ROOT_DIR=/home/zy/NVIDIA_CUDA-8.0_Samples \
-DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 \
-DCUDA_rt_LIBRARY=/usr/lib/x86_64-linux-gnu/librt.so \
-DOPENMM_DIR=/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1 \
-DPLUMED_BUILD_CUDA_LIB=1 \
-DPLUMED_INCLUDE_DIR=/home/zy/anaconda2/envs/py36/include/plumed \
-DPLUMED_LIBRARY_DIR=/home/zy/anaconda2/envs/py36/lib/plumed \
-DPYTHON_EXECUTABLE=/home/zy/anaconda2/envs/py36/bin/python
got:
[ 36%] Linking CXX executable TestSerializePlumedForce
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `testSerialization()':
TestSerializePlumedForce.cpp:(.text+0x1b6): undefined reference to `OpenMM::throwException(char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, s'
CMakeFiles/TestSerializePlumedForce.dir/TestSerializePlumedForce.cpp.o: In function `void OpenMM::XmlSerializer::serialize<PlumedPlugin::PlumedForce>(PlumedPlugin::Plu:
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_'
TestSerializePlumedForce.cpp:(.text._ZN6OpenMM13XmlSerializer9serializeIN12PlumedPlugin11PlumedForceEEEvPKT_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERSo[_'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::Platform::createKernel(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<cha'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::getStringProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationNode::setIntProperty(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<cha'
../../libOpenMMPlumed.so: undefined reference to `OpenMM::SerializationProxy::SerializationProxy(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocato'
collect2: error:ld return 1
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
You're running into the GCC ABI change: https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html. It looks like you're compiling the plugin with a different ABI choice than what OpenMM was compiled with. Did you compile OpenMM from source, or install it with conda?
I installed it with conda. ok it works after add "-D_GLIBCXX_USE_CXX11_ABI=0"
looks close to success...
[100%] Linking CXX executable TestCudaPlumedForce
/usr/bin/ld: warning: libcufft.so.9.0, needed by /home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so, not found (try using -rpath or -rpath-link)
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftGetVersion@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftPlan3d@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftExecD2Z@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftExecR2C@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftExecZ2D@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftDestroy@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftExecC2R@libcufft.so.9.0'
/home/zy/anaconda2/pkgs/openmm-7.2.1-py36_1/lib/plugins/libOpenMMCUDA.so: undefined reference to `cufftSetStream@libcufft.so.9.0'
collect2: error:ld return 1
platforms/cuda/tests/CMakeFiles/TestCudaPlumedForce.dir/build.make:98: recipe for target 'platforms/cuda/tests/TestCudaPlumedForce' failed
make[2]: *** [platforms/cuda/tests/TestCudaPlumedForce] Error 1
CMakeFiles/Makefile2:348: recipe for target 'platforms/cuda/tests/CMakeFiles/TestCudaPlumedForce.dir/all' failed
make[1]: *** [platforms/cuda/tests/CMakeFiles/TestCudaPlumedForce.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
so I will need libcufft.so.9.0 ?
Since you closed this, I assume you figured it out? libcufft is part of the CUDA SDK, which you need to have installed to compile the CUDA platform.
@Zhou-Yang I have run into the same error during compilation (conda install also). Where do you add the "-D_GLIBCXX_USE_CXX11_ABI=0" flag?
@peastman do you know if this flag should be added to cmake via "Add Entry" or to the makefile? Adding a 'bool' entry in the cmake gui of either -D_GLIBCXX_USE_CXX11_ABI
or GLIBCXX_USE_CXX11_ABI
hasn't progressed past this linking error.
For the Makefile option, I can't see a 'cxxflags' term anywhere. The relevant part of the Makefile looks like this:
# Target rules for targets named TestSerializePlumedForce
# Build rule for target.
TestSerializePlumedForce: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 TestSerializePlumedForce
.PHONY : TestSerializePlumedForce
# fast build rule for target.
TestSerializePlumedForce/fast:
$(MAKE) -f serialization/tests/CMakeFiles/TestSerializePlumedForce.dir/build.make serialization/te\
sts/CMakeFiles/TestSerializePlumedForce.dir/build
.PHONY : TestSerializePlumedForce/fast
In the CMake GUI you should append that flag to the end of CMAKE_CXX_FLAGS_RELEASE (assuming you have CMAKE_BUILD_TYPE set to "Release").
Thanks! I just saw this post @peastman, but seconds before figured it out by trial and error. For those in a similar situation, I fixed it in the file 'CMakeCache.txt', where there is a line:
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=0
the flag goes here like so:
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=-D_GLIBCXX_USE_CXX11_ABI=0
Hi, When I try to build this plugin, I got this:
and the cmake setting:![qq 20180424194708](https://user-images.githubusercontent.com/18484204/39204732-e96e4592-47f8-11e8-931e-761b0891d0d6.png)
Could you help look is there anything wrong?