Re: [AMBER-Developers] mdgx API--how should I handle struct declarations in mdgx.h?

From: Gerald Monard <>
Date: Mon, 29 Apr 2013 21:13:02 +0200


On 04/27/2013 01:08 AM, wrote:
> Hello Devs,
> Now, I'm not exactly sure how to solve this. One option, perhaps, would
> be to have make "cat >>" all of the ???DS.h header files (where all my
> DataStructs are stored) and then cat the declarations of the functions I
> wish to expose into mdgx.h, creating that file at run time rather than
> have it reside in the AmberTools/src/mdgx/ directory as something that is
> purely manually edited. I would have to do some stuff to remove #include
> statements within the header files, but this approach may still be error
> prone. Can anyone else suggest a robust solution?

Why don't you use the C preprocessor? You could create a pre_mdgx.h file
that contains #include of all your *DS.h files, then you add in the
Makefile a rule to create the mdgx.h file:
mdgx.h: pre_mdgx.h
        cpp -E -C -P pre_mdgx.h -o mdgx.h

You can even add macros to control what you put in the mdgx.h file from
all the *DS.h files.


> Dave
> _______________________________________________
> AMBER-Developers mailing list

  Prof. Gerald MONARD
  Theoretical Chemistry and Biochemistry Group
  SRSMC, Université de Lorraine, CNRS
  Boulevard des Aiguillettes B.P. 70239
  F-54506 Vandoeuvre-les-Nancy, FRANCE
  e-mail :
  tel.   : +33 (0)383.684.381
  fax    : +33 (0)383.684.371
  web    :
AMBER-Developers mailing list
Received on Mon Apr 29 2013 - 12:30:03 PDT
Custom Search