Re: cray pointer declaration issue with gfortran
- From: GaryScott <garylscott@xxxxxxxxxxxxx>
- Date: Wed, 6 Aug 2008 13:57:11 -0700 (PDT)
On Aug 6, 2:41 pm, Tobias Burnus <bur...@xxxxxxxx> wrote:
On Aug 6, 11:44 am, ronan.vicque...@xxxxxxxxx wrote:
I tried to compile some source code on my mac with gfortran. It was
previously working on other platforms and compilers (xlf, ifort,
pathf90) but I am having trouble to make it work with gfortran. It
seems to be a cray pointer declaration issue but I cannot tell if I
made a mistake which had not been noticed by the other f90 compilers
or if it is a gfortran bug.
I don't know either, but as it is a vendor extension, the "standard"
is probably what most compiler do and thus it is a bug.
I therefore filled a bugreport at:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37039
(Don't expect that it will be fixed soonish [though it might be by
chance] - several gfortraner seems to be busy with the real life or
with Fortran 2003 features such as type extension (works) or type-
bound procedures (does not yet work). However, it might get fixed in
GCC 4.4's stage3 when only bug fixes are allowed. - Or it might be
even closed as not-a-bug.)
You could say I found my solution by using one of these corrections,
however I do not want to modify my sources since I would have to do a
lot of changes (this is only an example) and it was working with other
compilers.
If you do not want to change your code, you have only three options:
a) Use another compiler for the interim
b) Fix gfortran (or find someone who does so)
c) Be patient and hope someone fixes it soon.
I therefore would go either for option (a) or would modify the code in
question, flipping two lines in several procedures should be not too
much work, unless your project is really huge.
The real alternative is to use standard Fortran code - as others have
already suggested. Allocatable or pointer of Fortran 90 should be
enough and Fortran 90 compilers should nowadays exist everywhere;
there exist much more Fortran 90+ compilers than compilers supporting
Cray pointers. The only drawback is that is takes longer to convert
the program.
Moreover I read in many cray pointer tutorials that the
pointer declaration , the pointee declaration and the array
specification can be done in any order. As I had to change this order
for my program to work, I do not understand why my first example
failed to compile.
Has anyone an idea ?
Two options, choose one:
a) An omission also called bug
b) The Cray pointer implementation was based on a Cray-pointer
documentation/implementation which also did not allow this
As there is no official standard but Cray pointers are vendor
extensions, their syntax is not well defined and varies between
compilers.
The proper way would be to replace the Cray pointers by standard
Fortran code; depending on the code size, the supported Fortran
version of the other compilers,* and other constrains it might become
difficult and/or laborious to do so. (* some usage of cray pointers
can only be mimicked using Fortran 2003 features which only some,
newer compiler have.)
Tobias
We should probably not call them "Cray" pointers unless they behave
exactly as one (probably the most recent) implementation produced by
Cray. If they match an SGI implementation that differs, then they are
"SGI pointers". Intel calls them "integer pointers" (at least
sometimes). Maybe <compiler/vendor> pointers (<Intel> pointers)?? It
would be more clear which one is implemented.
.
- Follow-Ups:
- Re: cray pointer declaration issue with gfortran
- From: Dan Nagle
- Re: cray pointer declaration issue with gfortran
- References:
- cray pointer declaration issue with gfortran
- From: ronan . vicquelin
- Re: cray pointer declaration issue with gfortran
- From: Tobias Burnus
- cray pointer declaration issue with gfortran
- Prev by Date: Re: vector difference
- Next by Date: Re: cray pointer declaration issue with gfortran
- Previous by thread: Re: cray pointer declaration issue with gfortran
- Next by thread: Re: cray pointer declaration issue with gfortran
- Index(es):
Relevant Pages
|