Aleksandar Donev wrote:
> No problem if the code is Fortran only and perfectly standard
> conforming. Problems occur when interfacing with C things
The porting is mostly going well, with simple changes...at least one
compiler compiled well...
As an illustration of the kind of problem I am running into: I need to
have derived types which interoperate between Fortran and C. These are
in F2003 (BIND(C) types), but for now I must hack them, and what I
usually do is put SEQUENCE in them and hope both gcc and the Fortran
compiler allign them the same. But for this simple type:
TYPE :: Point_2D
SEQUENCE
INTEGER (KIND=C_INT) :: screen = 0
REAL (KIND=C_FLOAT) :: x = 1.0, y = - 1.0
INTEGER (KIND=C_ADDRESS) :: next = C_NULL_PTR
END TYPE Point_2D
gcc (with -march=opteron and no other relevant flags) seems to make this
24-bytes in size, putting the next pointer at byte 16, while Intel
Fortran EMT64 (with -tpp7 and no other relevant flags) makes this 20
bits and puts the pointer at byte 12 rather than aligning at 16. I am
sure there are flags to change this.
Is there a good set of switches to use to make sure Fortran compilers
pad and align derived types the same as gcc---I think some ABI
specifies this?
Thanks,
Aleks
--
__________________________________
Aleksandar Donev
Complex Materials Theory Group (http://cherrypit.princeton.edu/)
Princeton Materials Institute &
Program in Applied and Computational Mathematics
@ Princeton University
Address:
419 Bowen Hall, 70 Prospect Avenue
Princeton University
Princeton, NJ 08540-5211
E-mail: [log in to unmask]
WWW: http://atom.princeton.edu/donev
Phone: (609) 258-2775
Fax: (609) 258-6878
__________________________________
|