[gmx-developers] Check for gromacs library using autotools
ruehle at mpip-mainz.mpg.de
Mon Jun 30 17:54:25 CEST 2008
thanks for your help, while experimenting with the checks I had another
If you check for a gromacs header gromacs/xxx.h, you assume that you
specify -I$GMXPATH/include. However, if I use it like that in a program,
it produces an error cause in typedefs.h, all the gromacs specific files
are include using #include <xxx.h>, so one has to specify
-I$GMXPATH/include/gromacs instead of -I$GMXPATH/include. In the other
gromacs headers, the includes are done with #include "xxx.h", so only
typedefs.h causes these problems.
Maybe I'm doing something wrong, but since all the gromacs headers are
always installed in subdirectory $prefix/include/gromacs, wouldn't it be
more convenient to use "" or is there a reason to use <> for the
includes in typedefs.h? Also using direclty -I.../gromacs might lead to
problems since the gromacs headers have quite common names (e.g. vec.h,
...) what might lead to conflicts.
Erik Lindahl wrote:
> Hi Victor,
> Unfortunately not pre-packaged, but what you could do is:
> 1) Check if libgmx is present with
> AC_CHECK_LIB(libgmx,GromacsVersion,,AC_MSG_ERROR([Gromacs library not
> 2) Search for the headers, e.g.
> 3) According to the autotools modus operandi you should check
> functionality rather than versions, but if you absolutely need it you could
> write a small test script that includes the header copyrite.h and
> executes GromacsVersion() to return the version as a string. That won't
> for cross-compiles, though - then you'd have to use "strings" to extract
> strings from the binary and grep for "VERSION".
> On Jun 19, 2008, at 5:03 PM, Victor Rühle wrote:
>> since I use the libgmx in one of my projects, I'm wondering weather
>> anyone already has a m4 script to check weather/which version of
>> gromacs is installed.
>> Thanks for your help,
>> gmx-developers mailing list
>> gmx-developers at gromacs.org
>> Please don't post (un)subscribe requests to the list. Use the www
>> interface or send it to gmx-developers-request at gromacs.org.
> Erik Lindahl <lindahl at cbr.su.se> Backup: <erik.lindahl at gmail.com>
> Associate Professor, Computational Structural Biology
> Center for Biomembrane Research, Dept. Biochemistry & Biophysics
> Stockholm University, SE-106 91 Stockholm, Sweden
> Tel: +46(0)8164675 Mobile: +46(0)704218767 Fax: mail a PDF instead
> gmx-developers mailing list
> gmx-developers at gromacs.org
> Please don't post (un)subscribe requests to the list. Use the
> www interface or send it to gmx-developers-request at gromacs.org.
> This email was Anti Virus checked by Astaro Security Gateway.
More information about the gromacs.org_gmx-developers