[gmx-developers] c++ in master

David van der Spoel spoel at xray.bmc.uu.se
Tue Jan 22 14:19:43 CET 2013


Hi,

we've developed some code for refinement based the master branch. This 
is being written in C++, following the GMX coding requirements as good 
as we comprehend them:
http://www.gromacs.org/index.php?title=Developer_Zone/Programming_Guide/Allowed_C%2b%2b_Features

What we would like to do is add our new class to the forcerec structure, 
such that it gets initiated and passed along with everything else. 
However having a class definition in forcerec.h necessitates that all 
files including forcerec.h are compiled by the C++ compiler (which is 
hard to do with cmake).

Rather than renaming *.c to *.cpp I built a C-wrapper around the C++ 
object, which defeats the purpose of C++ programming in a sense, but 
allows including the features we want with least disturbance.

So the question we need to start thinking about is:

When are we going to move .c to .cpp files?

Maybe this is not needed for functions that do not call any other 
gromacs functions (e.g. the kernels) but I guess it will be for 
virtually everything else.

-- 
David van der Spoel, Ph.D., Professor of Biology
Dept. of Cell & Molec. Biol., Uppsala University.
Box 596, 75124 Uppsala, Sweden. Phone:	+46184714205.
spoel at xray.bmc.uu.se    http://folding.bmc.uu.se



More information about the gromacs.org_gmx-developers mailing list