[gmx-developers] Check for gromacs library using autotools
Victor Rühle
ruehle at mpip-mainz.mpg.de
Wed Jul 30 17:28:41 CEST 2008
Hi,
I posted this question some weeks ago but didn't get a reply (see
original post below). It's not a big issue, just a bit of an unhandy
thing when you compile your own code using the libgmx.
Thanks,
Victor
Victor Rühle wrote:
> Hi Erik,
>
> thanks for your help, while experimenting with the checks I had another
> problem:
>
> 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.
>
> Cheers,
> Victor
>
> 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
>> found])
>>
>> 2) Search for the headers, e.g.
>>
>> AC_CHECK_HEADERS([gromacs/copyrite.h])
>>
>> 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 work
>> for cross-compiles, though - then you'd have to use "strings" to
>> extract strings from the binary and grep for "VERSION".
>>
>> Cheers,
>>
>> Erik
>>
>> On Jun 19, 2008, at 5:03 PM, Victor Rühle wrote:
>>
>>> Hi,
>>>
>>> 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,
>>>
>>> Victor
>>> _______________________________________________
>>> gmx-developers mailing list
>>> gmx-developers at gromacs.org
>>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>>> 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
>> http://www.gromacs.org/mailman/listinfo/gmx-developers
>> 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.
>> http://www.astaro.com
>>
>
> _______________________________________________
> gmx-developers mailing list
> gmx-developers at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-developers
> 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.
> http://www.astaro.com
>
More information about the gromacs.org_gmx-developers
mailing list