Fortran 2003 的编译器验证套件?

发布于 2024-09-28 14:48:23 字数 55 浏览 2 评论 0原文

是否有一个测试套件可以检查 Fortran 编译器是否完全实现 Fortran 2003 标准?

Is there a test suite out there that checks whether a Fortran compiler fully implements the Fortran 2003 standard?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情栀口红 2024-10-05 14:48:23

简短回答:否

对于 Fortran 95,有 Spackman & 的 SHAPE95 测试套件。 Hendrickson, Inc. 但是,它从未声称是完整的测试套件,也不是官方权威的。当然,这同样适用于 NIST F77 测试套件,与 SHAPE95 不同,它是免费提供的。其次,据我所知,F2003 的 SHAPE95 尚未更新。

那么该怎么办呢?好吧,几年前在 clf 上有过一些关于同样事情的讨论:

Bart Vandewoestyne wrote:
> On 2007-12-14, Richard Maine  wrote:
>> It seems reasonably complete to me. But you can't just use a checklist
>> like that for standard compliance. It is a very nice summary, and I find
>> it quite useful, but I'm sorry, the full standard doesn't compress down
>> to one page like that. Sorry, but it ain't gonna happen. If anyone
>> claims to have such a one-page or so checklist of the things that would
>> make a compiler fully f2003 compliant, then they are wrong.

>> But it is a good summary.

> I completely agree with you, Richard.  But then what are the
> criteria for 'full F2003 compliance'?  If a compiler-writer
> claims that he has a 'full F2003 compliant compiler', then what are
> the criteria that he uses to support his statement?

Ultimately, good faith and his reputation.  It's a hard standard to
read (or to write books about, as Richard can tell you) and there is no
official test or validation program.  Real vendors won't claim
to support it unless they really think they do.  And, they'll do
their best to fix any omissions or errors.  There is an interpretation
process that will get J3 to give an official answer to a specific
question.  For the past many years, essentially all of the interp
questions have come from compiler writers who are trying to understand
the standard.

It's not a great situation.  The best advice is to get several
compilers and try your code on several of them--with full error
checking and standards conformance options turned on.

Dick Hendrickson

FWIW,上面的“Richard Maine”角色是 F2003 标准的编辑,而“Dick Hendrickson”也曾在 IIRC 的标准委员会任职,是的,他是SHAPE95 背后的人之一。 IOW,他们知道自己在说什么。

最后,gfortran 编译器附带了一个相当大的测试套件,它与编译器的其余部分一样可以免费使用。我看到一些专有编译器供应商的评论说他们也使用了它。但是,再次强调,gfortran 测试套件并不声称是完整的测试套件;事实上,大部分测试用例之前都暴露了编译器中的错误。

Short answer: No

For Fortran 95, there is the SHAPE95 test suite by Spackman & Hendrickson, Inc. But, it never claimed to be a full testsuite, nor was it officially authoritative. Of course, the same applies to the NIST F77 testsuite which, as opposed to SHAPE95, is freely available. Secondly, AFAIK SHAPE95 hasn't been updated for F2003.

So what to do? Well, some discussion about the same thing on c.l.f a few years ago:

Bart Vandewoestyne wrote:
> On 2007-12-14, Richard Maine  wrote:
>> It seems reasonably complete to me. But you can't just use a checklist
>> like that for standard compliance. It is a very nice summary, and I find
>> it quite useful, but I'm sorry, the full standard doesn't compress down
>> to one page like that. Sorry, but it ain't gonna happen. If anyone
>> claims to have such a one-page or so checklist of the things that would
>> make a compiler fully f2003 compliant, then they are wrong.

>> But it is a good summary.

> I completely agree with you, Richard.  But then what are the
> criteria for 'full F2003 compliance'?  If a compiler-writer
> claims that he has a 'full F2003 compliant compiler', then what are
> the criteria that he uses to support his statement?

Ultimately, good faith and his reputation.  It's a hard standard to
read (or to write books about, as Richard can tell you) and there is no
official test or validation program.  Real vendors won't claim
to support it unless they really think they do.  And, they'll do
their best to fix any omissions or errors.  There is an interpretation
process that will get J3 to give an official answer to a specific
question.  For the past many years, essentially all of the interp
questions have come from compiler writers who are trying to understand
the standard.

It's not a great situation.  The best advice is to get several
compilers and try your code on several of them--with full error
checking and standards conformance options turned on.

Dick Hendrickson

FWIW, the "Richard Maine" character above was the editor of the F2003 standard, and "Dick Hendrickson" has IIRC also served on the standards committee, and yes, he's one of the guys behind SHAPE95. IOW, they know what they're talking about.

Finally, the gfortran compiler comes with a fairly large testsuite, which is freely available just like the rest of the compiler. I've seen some remarks from proprietary compiler vendors that they have also used it. But, again, the gfortran testsuite doesn't claim to be a full testsuite; in fact, it's mostly test cases that have previously exposed bugs in the compiler.

与酒说心事 2024-10-05 14:48:23

我不知道有这样的测试套件。如果我担心它,我看这里阅读此内容

I don't know of such a test suite. If I'm concerned about it I look here or read this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文