[gmx-users] Reordering of water molecules with Na+ ions coordinates in xtc file

leila karami karami.leila1 at gmail.com
Sat Jan 1 12:00:07 CET 2011


Dear Chris

I found gmx_trjconv.c file, It is in gromacs-4.0.7/src/tools.
since location of template directory is as follows:
gromacs-4.0.7/share/template,
I used cp gmx_trjconv.c ../../share/template/my_tool.c.
is it true?
I did those changes you said in my_tool.c file.
I created makefile without problem using sed "s/template/my_tool/g"
Makefile.x86_64-unknown-linux-gnu > Makefile.my_tool.
but when compile it, I encountered with following errors:

cc -O3 -fomit-frame-pointer -finline-functions -Wall -Wno-unused
-funroll-all-loops   -I/usr/include/libxml2 -I/usr/local/gromacs/include
-I/usr/local/gromacs/include/gromacs     -c -o my_tool.o my_tool.c
my_tool.c: In function ‘calc_pbc_cluster’:
my_tool.c:88: error: ‘bool’ undeclared (first use in this function)
my_tool.c:88: error: (Each undeclared identifier is reported only once
my_tool.c:88: error: for each function it appears in.)
my_tool.c:88: error: expected ‘;’ before ‘bChanged’
my_tool.c:94: error: ‘bMol’ undeclared (first use in this function)
my_tool.c:94: error: ‘bTmp’ undeclared (first use in this function)
my_tool.c:207: error: ‘bChanged’ undeclared (first use in this function)
my_tool.c: In function ‘put_residue_com_in_box’:
my_tool.c:316: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:339: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:357: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c: In function ‘do_trunc’:
my_tool.c:418: error: ‘bool’ undeclared (first use in this function)
my_tool.c:418: error: expected ‘;’ before ‘bStop’
my_tool.c:431: warning: assignment makes integer from pointer without a cast
my_tool.c:432: warning: passing argument 1 of ‘gmx_fio_getfp’ makes pointer
from integer without a cast
my_tool.c:435: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c:438: warning: passing argument 1 of ‘gmx_fio_ftell’ makes pointer
from integer without a cast
my_tool.c:439: error: ‘bStop’ undeclared (first use in this function)
my_tool.c:440: error: ‘bOK’ undeclared (first use in this function)
my_tool.c:440: warning: passing argument 1 of ‘fread_trnheader’ makes
pointer from integer without a cast
my_tool.c:441: warning: passing argument 1 of ‘fread_htrn’ makes pointer
from integer without a cast
my_tool.c:463: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c:475: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c: In function ‘gmx_trjconv’:
my_tool.c:622: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘bAppend’
my_tool.c:622: error: ‘bAppend’ undeclared (first use in this function)
my_tool.c:622: error: ‘bSeparate’ undeclared (first use in this function)
my_tool.c:622: error: ‘bVels’ undeclared (first use in this function)
my_tool.c:622: error: ‘bForce’ undeclared (first use in this function)
my_tool.c:623: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘bCenter’
my_tool.c:623: error: ‘bCenter’ undeclared (first use in this function)
my_tool.c:623: error: ‘bTer’ undeclared (first use in this function)
my_tool.c:715: error: ‘bool’ undeclared (first use in this function)
my_tool.c:715: error: expected ‘;’ before ‘bFit’
my_tool.c:717: error: expected ‘;’ before ‘bRmPBC’
my_tool.c:718: error: expected ‘;’ before ‘bCopy’
my_tool.c:719: error: expected ‘;’ before ‘bExec’
my_tool.c:720: error: expected ‘;’ before ‘bHaveFirstFrame’
my_tool.c:721: error: expected ‘;’ before ‘bSubTraj’
my_tool.c:722: error: expected ‘;’ before ‘bWriteFrame’
my_tool.c:727: error: expected ‘;’ before ‘bWarnCompact’
my_tool.c:745: warning: passing argument 9 of ‘parse_common_args’ from
incompatible pointer type
my_tool.c:745: error: too few arguments to function ‘parse_common_args’
my_tool.c:747: warning: assignment discards qualifiers from pointer target
type
my_tool.c:751: warning: assignment discards qualifiers from pointer target
type
my_tool.c:760: error: ‘bSetBox’ undeclared (first use in this function)
my_tool.c:761: error: ‘bSetTime’ undeclared (first use in this function)
my_tool.c:762: error: ‘bSetPrec’ undeclared (first use in this function)
my_tool.c:763: error: ‘bSetUR’ undeclared (first use in this function)
my_tool.c:764: error: ‘bExec’ undeclared (first use in this function)
my_tool.c:765: error: ‘bTimeStep’ undeclared (first use in this function)
my_tool.c:766: error: ‘bTDump’ undeclared (first use in this function)
my_tool.c:767: error: ‘bDropUnder’ undeclared (first use in this function)
my_tool.c:768: error: ‘bDropOver’ undeclared (first use in this function)
my_tool.c:769: error: ‘bTrans’ undeclared (first use in this function)
my_tool.c:770: error: ‘bSplit’ undeclared (first use in this function)
my_tool.c:773: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:774: error: ‘bFit’ undeclared (first use in this function)
my_tool.c:775: error: ‘bFitXY’ undeclared (first use in this function)
my_tool.c:776: error: ‘bReset’ undeclared (first use in this function)
my_tool.c:777: error: ‘bPFit’ undeclared (first use in this function)
my_tool.c:778: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:779: error: ‘bPBCWhole’ undeclared (first use in this function)
my_tool.c:780: error: ‘bPBCcomRes’ undeclared (first use in this function)
my_tool.c:781: error: ‘bPBCcomMol’ undeclared (first use in this function)
my_tool.c:782: error: ‘bPBCcomAtom’ undeclared (first use in this function)
my_tool.c:783: error: ‘bNoJump’ undeclared (first use in this function)
my_tool.c:784: error: ‘bCluster’ undeclared (first use in this function)
my_tool.c:785: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:786: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:794: error: ‘bRmPBC’ undeclared (first use in this function)
my_tool.c:806: warning: passing argument 1 of ‘pdb_use_ter’ makes integer
from pointer without a cast
my_tool.c:813: error: ‘bIndex’ undeclared (first use in this function)
my_tool.c:817: warning: assignment discards qualifiers from pointer target
type
my_tool.c:820: error: ‘bNeedPrec’ undeclared (first use in this function)
my_tool.c:836: error: ‘bSubTraj’ undeclared (first use in this function)
my_tool.c:863: error: ‘bTPS’ undeclared (first use in this function)
my_tool.c:923: warning: passing argument 1 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 2 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 3 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 4 of ‘read_first_frame’ makes
pointer from integer without a cast
my_tool.c:923: error: too few arguments to function ‘read_first_frame’
my_tool.c:926: warning: passing argument 1 of ‘close_trj’ makes pointer from
integer without a cast
my_tool.c:946: warning: implicit declaration of function ‘rm_pbc’
my_tool.c:969: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:970: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:970: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:974: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:974: warning: comparison between pointer and integer
my_tool.c:974: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:974: warning: pointer/integer type mismatch in conditional
expression
my_tool.c:974: warning: assignment makes integer from pointer without a cast
my_tool.c:989: error: ‘bHaveFirstFrame’ undeclared (first use in this
function)
my_tool.c:989: warning: passing argument 1 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 2 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 3 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 4 of ‘read_first_frame’ makes
pointer from integer without a cast
my_tool.c:989: error: too few arguments to function ‘read_first_frame’
my_tool.c:1010: warning: implicit declaration of function ‘fexist’
my_tool.c:1022: warning: assignment makes integer from pointer without a
cast
my_tool.c:1032: error: ‘bCopy’ undeclared (first use in this function)
my_tool.c:1051: warning: passing argument 1 of ‘gmx_fio_getfp’ makes pointer
from integer without a cast
my_tool.c:1059: error: ‘bDTset’ undeclared (first use in this function)
my_tool.c:1104: error: ‘bDumpFrame’ undeclared (first use in this function)
my_tool.c:1159: error: ‘bWriteFrame’ undeclared (first use in this function)
my_tool.c:1189: warning: implicit declaration of function ‘convert_time’
my_tool.c:1189: warning: implicit declaration of function ‘time_unit’
my_tool.c:1189: warning: format ‘%g’ expects type ‘double’, but argument 3
has type ‘int’
my_tool.c:1189: warning: format ‘%s’ expects type ‘char *’, but argument 4
has type ‘int’
my_tool.c:1192: error: ‘bDoIt’ undeclared (first use in this function)
my_tool.c:1200: warning: format ‘%8.3f’ expects type ‘double’, but argument
4 has type ‘int’
my_tool.c:1232: warning: assignment discards qualifiers from pointer target
type
my_tool.c:1233: error: ‘bWarnCompact’ undeclared (first use in this
function)
my_tool.c:1289: error: ‘bSplitHere’ undeclared (first use in this function)
my_tool.c:1300: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1301: warning: assignment makes integer from pointer without a
cast
my_tool.c:1308: warning: assignment makes integer from pointer without a
cast
my_tool.c:1315: warning: passing argument 1 of ‘write_trxframe’ makes
pointer from integer without a cast
my_tool.c:1315: error: too few arguments to function ‘write_trxframe’
my_tool.c:1320: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1329: warning: passing argument 1 of ‘write_trxframe’ makes
pointer from integer without a cast
my_tool.c:1329: error: too few arguments to function ‘write_trxframe’
my_tool.c:1354: error: too few arguments to function ‘write_pdbfile’
my_tool.c:1403: error: ‘bHaveNextFrame’ undeclared (first use in this
function)
my_tool.c:1403: warning: passing argument 1 of ‘read_next_frame’ makes
pointer from integer without a cast
my_tool.c:1403: warning: passing argument 2 of ‘read_next_frame’ from
incompatible pointer type
my_tool.c:1403: error: too few arguments to function ‘read_next_frame’
my_tool.c:1412: warning: passing argument 1 of ‘close_trj’ makes pointer
from integer without a cast
my_tool.c:1415: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1421: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1425: warning: passing argument 1 of ‘do_view’ from incompatible
pointer type
my_tool.c:1425: error: too few arguments to function ‘do_view’
make: *** [my_tool.o] Error 1
[root at leila template]# sed "s/template/my_tool/g"
Makefile.x86_64-unknown-linux-gnu > Makefile.my_tool
[root at leila template]# make -f Makefile.my_tool cc -O3 -fomit-frame-pointer
-finline-functions -Wall -Wno-unused -funroll-all-loops
-I/usr/include/libxml2 -I/usr/local/gromacs/include
-I/usr/local/gromacs/include/gromacs     -c -o my_tool.o my_tool.c
my_tool.c: In function ‘calc_pbc_cluster’:
my_tool.c:88: error: ‘bool’ undeclared (first use in this function)
my_tool.c:88: error: (Each undeclared identifier is reported only once
my_tool.c:88: error: for each function it appears in.)
my_tool.c:88: error: expected ‘;’ before ‘bChanged’
my_tool.c:94: error: ‘bMol’ undeclared (first use in this function)
my_tool.c:94: error: ‘bTmp’ undeclared (first use in this function)
my_tool.c:207: error: ‘bChanged’ undeclared (first use in this function)
my_tool.c: In function ‘put_residue_com_in_box’:
my_tool.c:316: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:339: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:357: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c: In function ‘do_trunc’:
my_tool.c:418: error: ‘bool’ undeclared (first use in this function)
my_tool.c:418: error: expected ‘;’ before ‘bStop’
my_tool.c:431: warning: assignment makes integer from pointer without a cast
my_tool.c:432: warning: passing argument 1 of ‘gmx_fio_getfp’ makes pointer
from integer without a cast
my_tool.c:435: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c:438: warning: passing argument 1 of ‘gmx_fio_ftell’ makes pointer
from integer without a cast
my_tool.c:439: error: ‘bStop’ undeclared (first use in this function)
my_tool.c:440: error: ‘bOK’ undeclared (first use in this function)
my_tool.c:440: warning: passing argument 1 of ‘fread_trnheader’ makes
pointer from integer without a cast
my_tool.c:441: warning: passing argument 1 of ‘fread_htrn’ makes pointer
from integer without a cast
my_tool.c:463: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c:475: warning: passing argument 1 of ‘close_trn’ makes pointer from
integer without a cast
my_tool.c: In function ‘gmx_trjconv’:
my_tool.c:622: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘bAppend’
my_tool.c:622: error: ‘bAppend’ undeclared (first use in this function)
my_tool.c:622: error: ‘bSeparate’ undeclared (first use in this function)
my_tool.c:622: error: ‘bVels’ undeclared (first use in this function)
my_tool.c:622: error: ‘bForce’ undeclared (first use in this function)
my_tool.c:623: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’
before ‘bCenter’
my_tool.c:623: error: ‘bCenter’ undeclared (first use in this function)
my_tool.c:623: error: ‘bTer’ undeclared (first use in this function)
my_tool.c:715: error: ‘bool’ undeclared (first use in this function)
my_tool.c:715: error: expected ‘;’ before ‘bFit’
my_tool.c:717: error: expected ‘;’ before ‘bRmPBC’
my_tool.c:718: error: expected ‘;’ before ‘bCopy’
my_tool.c:719: error: expected ‘;’ before ‘bExec’
my_tool.c:720: error: expected ‘;’ before ‘bHaveFirstFrame’
my_tool.c:721: error: expected ‘;’ before ‘bSubTraj’
my_tool.c:722: error: expected ‘;’ before ‘bWriteFrame’
my_tool.c:727: error: expected ‘;’ before ‘bWarnCompact’
my_tool.c:745: warning: passing argument 9 of ‘parse_common_args’ from
incompatible pointer type
my_tool.c:745: error: too few arguments to function ‘parse_common_args’
my_tool.c:747: warning: assignment discards qualifiers from pointer target
type
my_tool.c:751: warning: assignment discards qualifiers from pointer target
type
my_tool.c:760: error: ‘bSetBox’ undeclared (first use in this function)
my_tool.c:761: error: ‘bSetTime’ undeclared (first use in this function)
my_tool.c:762: error: ‘bSetPrec’ undeclared (first use in this function)
my_tool.c:763: error: ‘bSetUR’ undeclared (first use in this function)
my_tool.c:764: error: ‘bExec’ undeclared (first use in this function)
my_tool.c:765: error: ‘bTimeStep’ undeclared (first use in this function)
my_tool.c:766: error: ‘bTDump’ undeclared (first use in this function)
my_tool.c:767: error: ‘bDropUnder’ undeclared (first use in this function)
my_tool.c:768: error: ‘bDropOver’ undeclared (first use in this function)
my_tool.c:769: error: ‘bTrans’ undeclared (first use in this function)
my_tool.c:770: error: ‘bSplit’ undeclared (first use in this function)
my_tool.c:773: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:774: error: ‘bFit’ undeclared (first use in this function)
my_tool.c:775: error: ‘bFitXY’ undeclared (first use in this function)
my_tool.c:776: error: ‘bReset’ undeclared (first use in this function)
my_tool.c:777: error: ‘bPFit’ undeclared (first use in this function)
my_tool.c:778: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:779: error: ‘bPBCWhole’ undeclared (first use in this function)
my_tool.c:780: error: ‘bPBCcomRes’ undeclared (first use in this function)
my_tool.c:781: error: ‘bPBCcomMol’ undeclared (first use in this function)
my_tool.c:782: error: ‘bPBCcomAtom’ undeclared (first use in this function)
my_tool.c:783: error: ‘bNoJump’ undeclared (first use in this function)
my_tool.c:784: error: ‘bCluster’ undeclared (first use in this function)
my_tool.c:785: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:786: warning: passing argument 1 of ‘nenum’ from incompatible
pointer type
my_tool.c:794: error: ‘bRmPBC’ undeclared (first use in this function)
my_tool.c:806: warning: passing argument 1 of ‘pdb_use_ter’ makes integer
from pointer without a cast
my_tool.c:813: error: ‘bIndex’ undeclared (first use in this function)
my_tool.c:817: warning: assignment discards qualifiers from pointer target
type
my_tool.c:820: error: ‘bNeedPrec’ undeclared (first use in this function)
my_tool.c:836: error: ‘bSubTraj’ undeclared (first use in this function)
my_tool.c:863: error: ‘bTPS’ undeclared (first use in this function)
my_tool.c:923: warning: passing argument 1 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 2 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 3 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:923: warning: passing argument 4 of ‘read_first_frame’ makes
pointer from integer without a cast
my_tool.c:923: error: too few arguments to function ‘read_first_frame’
my_tool.c:926: warning: passing argument 1 of ‘close_trj’ makes pointer from
integer without a cast
my_tool.c:946: warning: implicit declaration of function ‘rm_pbc’
my_tool.c:969: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:970: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:970: error: ‘t_atoms’ has no member named ‘resname’
my_tool.c:974: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:974: warning: comparison between pointer and integer
my_tool.c:974: error: ‘t_atom’ has no member named ‘resnr’
my_tool.c:974: warning: pointer/integer type mismatch in conditional
expression
my_tool.c:974: warning: assignment makes integer from pointer without a cast
my_tool.c:989: error: ‘bHaveFirstFrame’ undeclared (first use in this
function)
my_tool.c:989: warning: passing argument 1 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 2 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 3 of ‘read_first_frame’ from
incompatible pointer type
my_tool.c:989: warning: passing argument 4 of ‘read_first_frame’ makes
pointer from integer without a cast
my_tool.c:989: error: too few arguments to function ‘read_first_frame’
my_tool.c:1010: warning: implicit declaration of function ‘fexist’
my_tool.c:1022: warning: assignment makes integer from pointer without a
cast
my_tool.c:1032: error: ‘bCopy’ undeclared (first use in this function)
my_tool.c:1051: warning: passing argument 1 of ‘gmx_fio_getfp’ makes pointer
from integer without a cast
my_tool.c:1059: error: ‘bDTset’ undeclared (first use in this function)
my_tool.c:1104: error: ‘bDumpFrame’ undeclared (first use in this function)
my_tool.c:1159: error: ‘bWriteFrame’ undeclared (first use in this function)
my_tool.c:1189: warning: implicit declaration of function ‘convert_time’
my_tool.c:1189: warning: implicit declaration of function ‘time_unit’
my_tool.c:1189: warning: format ‘%g’ expects type ‘double’, but argument 3
has type ‘int’
my_tool.c:1189: warning: format ‘%s’ expects type ‘char *’, but argument 4
has type ‘int’
my_tool.c:1192: error: ‘bDoIt’ undeclared (first use in this function)
my_tool.c:1200: warning: format ‘%8.3f’ expects type ‘double’, but argument
4 has type ‘int’
my_tool.c:1232: warning: assignment discards qualifiers from pointer target
type
my_tool.c:1233: error: ‘bWarnCompact’ undeclared (first use in this
function)
my_tool.c:1289: error: ‘bSplitHere’ undeclared (first use in this function)
my_tool.c:1300: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1301: warning: assignment makes integer from pointer without a
cast
my_tool.c:1308: warning: assignment makes integer from pointer without a
cast
my_tool.c:1315: warning: passing argument 1 of ‘write_trxframe’ makes
pointer from integer without a cast
my_tool.c:1315: error: too few arguments to function ‘write_trxframe’
my_tool.c:1320: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1329: warning: passing argument 1 of ‘write_trxframe’ makes
pointer from integer without a cast
my_tool.c:1329: error: too few arguments to function ‘write_trxframe’
my_tool.c:1354: error: too few arguments to function ‘write_pdbfile’
my_tool.c:1403: error: ‘bHaveNextFrame’ undeclared (first use in this
function)
my_tool.c:1403: warning: passing argument 1 of ‘read_next_frame’ makes
pointer from integer without a cast
my_tool.c:1403: warning: passing argument 2 of ‘read_next_frame’ from
incompatible pointer type
my_tool.c:1403: error: too few arguments to function ‘read_next_frame’
my_tool.c:1412: warning: passing argument 1 of ‘close_trj’ makes pointer
from integer without a cast
my_tool.c:1415: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1421: warning: passing argument 1 of ‘close_trx’ makes pointer
from integer without a cast
my_tool.c:1425: warning: passing argument 1 of ‘do_view’ from incompatible
pointer type
my_tool.c:1425: error: too few arguments to function ‘do_view’
make: *** [my_tool.o] Error 1

what is reason of these errors? how to fix it?

any help will highly appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://maillist.sys.kth.se/pipermail/gromacs.org_gmx-users/attachments/20110101/6a339d30/attachment.html>


More information about the gromacs.org_gmx-users mailing list