[gmx-developers] energy calculation

Erik Lindahl lindahl at stanford.edu
Sat Mar 9 07:51:23 CET 2002


Vibin R wrote:

>Dear Sir,
>
> Sorry to bother you again. I tried to include the file innerc.c with 
>calc_energy.c in the directory gmxlib. But there seems to be certain
>routines in innerc.c that are not there in the library (the gmxlib
>directory). What exactly is meant by the gromacs library and how to link
>the wrapper with that library. 
>
>Sincerely
>Vibin
>
Hi,

First build gromacs in the normal way and install it. If you don't 
change the default installation prefix, it will be installed to 
/usr/local/gromacs, and you can find the gromacs libraries in 
/usr/local/gromacs/<arch>/lib.

If you have written code in the file mycode.c (which uses the energy 
function in calc_energy.c), you should include calc_energy.c when you 
compile your code, and link with the gromacs library. This is done by 
(1) telling the compiler/linker to search the directory where the 
library is located (using the -L flag) and (2) by telling it to include 
that library (with the -l flag).

cc mycode.c calc_energy.c -L/usr/local/gromacs/<arch>lib -lgmxlib

(You might also have to include -lmdlib if there are unresolved 
functions). If it is complaining about not finding a definition for the 
mcinl1100 function you can copy and #include the file inner.h from 
/usr/local/gromacs/src/gmxlib.

Sorry if this is complicated, but it's not really supported yet - from 
version 4.0 this should be MUCH simpler, and it will be carefully 
documented.


Cheers,

Erik






More information about the gromacs.org_gmx-developers mailing list