Mac 上的 Fortran 总线错误

发布于 2024-08-16 00:29:28 字数 272 浏览 2 评论 0原文

以下 Fortran 代码在我的 Mac 上给我一个总线错误,但当我在 Linux 机器上运行它时没有错误:

  PROGRAM TINY
  WRITE(UNIT=*, FMT=*) 'Hello, world!'
  END

我的理解是,当程序尝试访问不可能的内存时会发生总线错误,但我不明白这样的尝试在哪里已经在这个程序中进行了。我的 MacBook 有 GCC 4.4.0,我的 Linux 机器有 GCC 4.3.2。关于为什么会出现此错误的任何想法?

The following Fortran code is giving me a bus error on my Mac but no errors when I run it on my Linux machine:

  PROGRAM TINY
  WRITE(UNIT=*, FMT=*) 'Hello, world!'
  END

My understanding is that a bus error occurs when the program attempts to access impossible memory but I do not understand where such an attempt has been made in this program. My MacBook has GCC 4.4.0 and my Linux machine has GCC 4.3.2. Any ideas as to why this error occurs?

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

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

发布评论

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

评论(2

感情洁癖 2024-08-23 00:29:28

完全没有想法,只是想让你知道我在 Mac Pro 上编译和运行该程序没有任何问题。我用 G95 编译(GCC 4.0.4 (g95 0.91!) Dec 11 2008)。和你一样,我认为总线错误通常是尝试寻址不存在的内存。

No ideas at all, just thought I'd let you know that I have no problems compiling and running the program on my Mac Pro. I compiled with G95 (GCC 4.0.4 (g95 0.91!) Dec 11 2008). Like you, I think a bus error is usually an attempt to address memory which doesn't exist.

可爱暴击 2024-08-23 00:29:28

该程序在我的 Mac 上运行 gfortran 4.4.2 运行良好。您的 MacBook 上是否运行其他 Fortran 程序,或者它们都存在此问题?

The program runs fine on my Mac with gfortran 4.4.2. Do other Fortran programs run on your MacBook, or do they all have this problem?

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