From: Rob (
Date: Tue Jun 16 2009 - 03:27:28 CDT

Axel Kohlmeyer wrote:
> - if you use strtok(), you cannot flag your code as re-entrant.
> strtok() uses a global static storage. if there is an easy way
> to avoid it, i'd encourage you to do so. unfortunately, this is
> not always the case (since strtok is convenient, we may be forced
> to provide a portable and thread-safe work-alike for molfile).

OK; I'll look into this. I'll try to replace it by something else;
The "sscanf(string, " %d %d", &i, &k)" does not have this problem,
or does it?

By the way, the vasp plugins have the same problem here
(I used those to help me design the abinit plugin....).

> which compiler do you use for ABINIT?

> as far as i can tell, your code does not seem to be compatible
> with big-endian files and 64-bit record-length markers.

> if you compile ABINIT with gfortran, you should be able to emulate
> this via setting the GFORTRAN_CONVERT_UNIT environment variable
> or using the -fconvert compile option and using the
> -frecord-marker=<length> option, respectively.
I use gfortran indeed.

Should I then use "-fconvert=big-endian -frecord-marker=8" and then
design the plugin to be able to read those files?
Is it possible to find out directly from the binary file whether it's big/little
endian? (probably not....).

The gfortran manual says that the default length is 4, but it used to be 8
with older gfortran versions....