openmm / openmm-plumed

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

Compiling with CUDA&OpenCL: 'Lepton' not declared in this scope #41

Closed jaimergp closed 3 years ago

jaimergp commented 3 years ago

I am trying to provide the conda recipes as suggested in #6. This is happening in this PR: https://github.com/conda-forge/staged-recipes/pull/13486

After the release of Plumed 2.7, the Reference platform can build correctly (see temporary CPU builds in the CI logs for Linux and MacOS).

However, OpenCL and CUDA are not as lucky. There's an issue with lepton and its scope in the OpenMM headers:

Scanning dependencies of target OpenMMPlumedCUDA
[ 73%] Building CXX object platforms/cuda/CMakeFiles/OpenMMPlumedCUDA.dir/src/CudaPlumedKernelFactory.cpp.o
In file included from ${PREFIX}/include/openmm/cuda/CudaExpressionUtilities.h:30:0,
                 from ${PREFIX}/include/openmm/cuda/CudaContext.h:45,
                 from ${WORK}/platforms/cuda/src/CudaPlumedKernels.h:37,
                 from ${WORK}/platforms/cuda/src/CudaPlumedKernelFactory.cpp:35:
${PREFIX}/include/openmm/common/ExpressionUtilities.h:61:63: error: 'Lepton' was not declared in this scope
     std::string createExpressions(const std::map<std::string, Lepton::ParsedExpression>& expressions, const std::map<std::string, std::string>& variables,

Any ideas? This is the build script.

peastman commented 3 years ago

Nothing obvious comes to mind. That file includes several lepton headers, so it ought to be defined:

https://github.com/openmm/openmm/blob/e23dc9272ab4eafd72f91aace1320a7f1177ba7b/platforms/common/include/openmm/common/ExpressionUtilities.h#L32-L34

jaimergp commented 3 years ago

I have done some more digging. Turns out plumed's conda package also distributes lepton headers, which causes some kind of path confusion... Renaming that directory fixes it, I think.

jaimergp commented 3 years ago

Yep, that's it. Closing!