openmm / openmm-plumed

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

installation error for OpenMM 7.2 #13

Closed weiHelloWorld closed 6 years ago

weiHelloWorld commented 6 years ago

Hi Peter,

I am trying to install openmm-plumed with OpenMM 7.2, but I got following errror:

Building CXX object platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o
In file included from /home/fisiksnju/.openmm72/include/openmm/cuda/CudaPlatform.h:32:0,
                 from /home/fisiksnju/.openmm72/include/openmm/cuda/CudaContext.h:44,
                 from /home/fisiksnju/.temp_softwares/openmm-plumed/platforms/cuda/src/CudaPlumedKernels.h:37,
                 from /home/fisiksnju/.temp_softwares/openmm-plumed/platforms/cuda/src/CudaPlumedKernelFactory.cpp:35:
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:76:23: error: ‘std::function’ has not been declared
     void execute(std::function<void (ThreadPool&, int)> task);
                       ^
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:76:31: error: expected ‘,’ or ‘...’ before ‘<’ token
     void execute(std::function<void (ThreadPool&, int)> task);
                               ^
/home/fisiksnju/.openmm72/include/openmm/internal/ThreadPool.h:99:5: error: ‘function’ in namespace ‘std’ does not name a type
     std::function<void (ThreadPool& pool, int)> currentFunction;
     ^
make[2]: *** [platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o] Error 1
make[1]: *** [platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/all] Error 2
make: *** [all] Error 2

This error does not appear in OpenMM 7.0 as I just tested it, do you have any clue what the problem is?

I just check CMakeCache.txt, seems that it is using CUDA_HOST_COMPILER:FILEPATH=/usr/bin/gcc-4.8 as compiler, would that be an issue here?

Updated: yes, for gcc version older than 6.0, I need to explicitly turn on -std=c++11 switch in CMake, that solved the problem.

Thanks!

peastman commented 6 years ago

I'm reopening this, since we need to fix this correctly once OpenMM 7.2 is released (hopefully next week). The correct fix is to add the line

SET (CMAKE_CXX_STANDARD 11)

to CMakeLists.txt.

peastman commented 6 years ago

This is now fixed.