macos 如何在 Mac OS X 10.6 上安装 f77
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5470841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install f77 on Mac OS X 10.6
提问by Joe SHI
Can anyone tell me how to install f77on Mac OS X 10.6? I am quite new to f77.
谁能告诉我如何在 Mac OS X 10.6 上安装f77?我对 f77 很陌生。
Thank you very much
非常感谢你
回答by Jonathan Dursi
So the compiler you're looking for is gfortran, part of the gcc suite. Gfortran will compile old f77 code, but it will also compile more modern (Fortran90, 95, 2003, and some 2008 support) versions of the same language; if you're going to start working on someone's old f77 code I strongly suggest you learn about what more modern versions of fortran look like. Things have improved greatly. You may see options to install g77, which was the previous generation of gnu fortran compilers -- don't do it. It's 5 years old and hasn't been supported for 4 years.
所以你正在寻找的编译器是 gfortran,它是 gcc 套件的一部分。Gfortran 将编译旧的 f77 代码,但它也会编译相同语言的更现代(Fortran90、95、2003 和某些 2008 支持)版本;如果您打算开始处理某人的旧 f77 代码,我强烈建议您了解更现代的 fortran 版本是什么样的。情况有了很大的改善。您可能会看到安装 g77 的选项,这是上一代 gnu fortran 编译器——不要这样做。5年了,4年没有支持了。
As to installing gfortran, you have several options:
至于安装 gfortran,您有几种选择:
MacPortsis one great source for linux software on your mac; it builds things for your machine, so installing can take some time. Once you've installed the macports binaries, you can type "sudo port install gcc46 +gfortran" to install the newest gcc and gfortran compilers.
Binaries are available at the HPC for Mac OS Xwebsite. I think these are modestly older binaries for 4.5. I haven't tried the gfortran binaries there, but that website is usually reliable.
The gcc wiki points still elsewherefor 4.5 binaries for Mac OS X.
MacPorts是 Mac 上 linux 软件的一个重要来源;它为您的机器构建东西,因此安装可能需要一些时间。安装 macports 二进制文件后,您可以键入“sudo port install gcc46 +gfortran”来安装最新的 gcc 和 gfortran 编译器。
二进制文件可在HPC for Mac OS X网站上获得。我认为这些是 4.5 的适度较旧的二进制文件。我没有在那里尝试过 gfortran 二进制文件,但该网站通常是可靠的。
回答by zbeekman
Intel also provides their compiler to OS X and linux users for free under a very specific non-commercial license. If you are going to be using Fortran in a way that is compliant with their licensing terms you can install it from them. They have a pretty good support forum for their OS X/Linux compiler including install directions.
英特尔还根据非常具体的非商业许可免费向 OS X 和 linux 用户提供他们的编译器。如果您打算以符合其许可条款的方式使用 Fortran,您可以从他们那里安装它。他们的 OS X/Linux 编译器有一个非常好的支持论坛,包括安装说明。