[gmx-developers] creating a new analysis tool usign template.c and make
Gerrit Groenhof
G.Groenhof at chem.rug.nl
Thu Nov 13 11:07:20 CET 2003
Hi Senthil
> I have been trying to create some new analysis tools. At first, I was
> just modifying existing analysis tools in the src/tools/ directory. So
> compiling it was not difficult. I would just "make g_tool.c" in the
> src/tools directory and then "make install". That would create a new
> executable with the modifications. So I never really had to mess around
> with the make files.
>
> Now, I want to create a new analysis tool from scratch. I want to start
> from the template file provided in template.c
> I did a ./configure in the gmx home directory with
> prefix==/home/senthilk/mytools and exec-prefix==/home/senthilk/mytools.
> (I want the template.c executable to be placed in ~/mytools/bin). Now, I
> go to the $GMX/share/template directory and want to compile (make?) the
> template.c . Typing "make" or "make template" does not seem to do
> anything. The response is "nothign to be done for all". I realize that
> I am supposed to edit the makefiles in the current directory to include
> the template.c files . Template.mak seems to have that. Anyways, I am
> totally confused about this whole "make" business.
>
> Could somebody please explain the bare minimum steps needed to compile
> template.c and create an executable? What are the steps I need to do and
> what are the files I need to edit? I can probably pick up from there.
You add the template.c to Makefile.am in the tools subdir. Then use
automake or use the ./bootstrap script in the gmx dir to create the
Makefile.in. The automake/autoheader searches for dependencies and so
on of the template.c file to create this Makefile.in. Then use
configure to create the Makefile with the make flags suitable for your
computer system.
Good luck!
Gerrit
More information about the gromacs.org_gmx-developers
mailing list