[gmx-users] compiling gromacs on powerpc64

David spoel at xray.bmc.uu.se
Thu Aug 4 23:25:17 CEST 2005


On Thu, 2005-08-04 at 12:29 -0700, Martin Siegert wrote:

> 
> I (currently) doubt that this is a compiler problem:
> 
> * xlc -q64 compiles gromacs fine on AIX
> * gcc -m64 does not compile gromacs on powerpc either
> 
> Thus, if it is a compiler problem it would mean that both gcc and xlc
> are broken.
> 
> Instead, I suspect a bug in some system include file on the powerpc
> platform. I actually suspect that the problem is not with float/double
> but with int/long or size_t. The reason is the following: the incorrect
> topol.tpr file starts with
> 
> 00000000  00 00 00 00 00 00 00 00 56 45 52 53 49 4F 4E 20 ........VERSION
> 00000010  33 2E 32 2E 31 00 00 00 00 00 00 00 00 00 00 00 3.2.1...........
> 00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 
> Attempting to read this file with mdrun results in
> 
> Fatal error: Can not read file topol.tpr,
>              this file is from a Gromacs version which is older than 2.0
>              Make a new one with grompp or use a gro or pdb file, if possible
> 
> When I then use a binary editor and change the 4th and 8th byte so that
> the file starts the same as the correct version, i.e.,
> 
> 00000000  00 00 00 0E 00 00 00 0D 56 45 52 53 49 4F 4E 20 ........VERSION
> 00000010  33 2E 32 2E 31 00 00 00 00 00 00 00 00 00 00 00 3.2.1...........
> 00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> 
> then mdrun's error changes to
> 
> Fatal error: Unknown precision in file topol.tpr: real is 0 bytes instead of 4 or 8
> 
> Since I do not think that there are any floats or doubles written to
> topol.tpr BEFORE the "VERSION 3.2.1" string and the last error message
> does not really point to a float/double problem either, I suspect a
> problem with long to int conversion (long and int being the same on
> 32 bit, but long being 8 bytes on 64 bit). Another possibility would
> be a problem with the size_t declaration ...
> 
> Do you know which piece of the code actually writes these variables at the
> beginning of topol.tpr?
> 
> write_tpx_state calls either write_xml or do_tpx. I quickly get lost in the
> write_xml code. do_tpx calls do_string(GromacsVersion()); and then
> do_int(precision); thus the problem ought to be visible already within
> these two routines.
> do_string is equivalent to
> do_write((void *)(item),1,eioSTRING,(#item),__FILE__,__LINE__))
> The actual routine seems to be determined in fio_select(int fio)
> where it is set to (and here I get lost) do_xdr or do_binwrite.
> If this actually is do_binwrite then this would first write an integer
> namely the size of the string, in this case 14 = 0E. In this correct??

It is actually do_xdr for a tpr file. In tpxio.c, 1098 after writing out
the version string it writes out an integer which is either 4 or 8 and
which holds the precision. It could be a problem in the xdr libraries on
the IBM. I assume that all compilers use the same libraries. The crux
with using these libraries is that the data should be system-indepedent
(and usually is)... Talk to your IBM support people.

-- 
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,          75124 Uppsala, Sweden
phone:  46 18 471 4205          fax: 46 18 511 755
spoel at xray.bmc.uu.se    spoel at gromacs.org   http://xray.bmc.uu.se/~spoel
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++




More information about the gromacs.org_gmx-users mailing list