[gmx-users] correct processing of #define statements by grompp in gromacs 4.0.2 requires exactly one space after #define

Berk Hess gmx3 at hotmail.com
Tue Nov 25 23:34:24 CET 2008


Hi,

That  is an annoying bug.
I fixed it for 4.0.3.
If you want it fixed now, the diff is below.

Berk


RCS file: /home/gmx/cvs/gmx/src/kernel/gmxcpp.c,v
retrieving revision 1.9
diff -r1.9 gmxcpp.c
121,122c121,122
<   sscanf(define,"%s",name);
<   ptr = define + strlen(name);
---
>   sscanf(define,"%s%n",name,&i);
>   ptr = define + i;


> Date: Tue, 25 Nov 2008 16:32:57 -0500
> From: chris.neale at utoronto.ca
> To: gmx-users at gromacs.org
> Subject: [gmx-users] correct processing of #define statements by grompp in gromacs 4.0.2 requires exactly one space after #define
> 
> When two spaces are included the #define KEYWORD is incompletely removed 
> from the file.
> In case my conclusion about the exact nature of the error is incorrect, 
> here is more information.
> 
> I have a ffcharmbon.itp file that contains:
> 
> [ dihedraltypes ]
> #define  improper_NC2_X_X_C_  180.00000  83.68000  2
> 
> And an .itp file that contains:
> 
> [ dihedrals ]
>     1     2     5     8     1             improper_NC2_X_X_C_
> 
> where grompp -pp returns
> 
> [ dihedrals ]
>     1     2     5     8     1             _  180.00000  83.68000  2
> 
> and the floating '_' character causes the error message:
> 
> ERROR 1 [file my.itp, line 77]:
>   No default Proper Dih. types
> 
> I tried to fix this by removing the trailing underscore character from 
> my defined string in both files,
> but now I get a trailing 'C'
> 
> [ dihedrals ]
>     1     2     5     8     1             C  180.00000  83.68000  2
> 
> So it appears that the define statement is simply not being entirely 
> removed.
> 
> When I then replaced
> #define  improper_NC2_X_X_C_  180.00000  83.68000  2
> by
> #define improper_NC2_X_X_C_  180.00000  83.68000  2
> (only one space between '#define' and 'improper...')
> it works correctly.
> 
> Note that cpp handled this original define statement properly in gromacs 
> 3.3.1.
> 
> Chris.
> 
> 
> 
> 
> 
> _______________________________________________
> gmx-users mailing list    gmx-users at gromacs.org
> http://www.gromacs.org/mailman/listinfo/gmx-users
> Please search the archive at http://www.gromacs.org/search before posting!
> Please don't post (un)subscribe requests to the list. Use the 
> www interface or send it to gmx-users-request at gromacs.org.
> Can't post? Read http://www.gromacs.org/mailing_lists/users.php

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20081125/fc084026/attachment.html>


More information about the gromacs.org_gmx-users mailing list