- 记得最初的时候不知道在哪里下载的 gfortran 离线安装包,如果没记错的话应该是 4.8.* 版本的,但是后来就一直再也没找到这样的安装包。(今天 2016/7/22 找到了,在 这个页面 找到 Unofficial build of current development (GCC 5) source. Download the latest installer (dated 2014-06-29). 这句话,这个installer 就是了,唉简直太乱了。。。。。)
- 再后来使用 gfortran 都是 simply fortran(虽然其内核是 gcc 的 gfortran,但是根本不是免费的,当然了这个玩意它不是开源的)
- 于是今天萌生了使用 gcc (GNU Complier Collection)来亲自下载并安装 gfortran 的想法(其实很早以前就弄过,但是都已失败告终)。
在 GFortranBinaries 看到这句话 If in doubt, or if you don't know what Cygwin and MinGW are, the package for you is the MinGW ("native Windows") package! 我知道应该毫不犹豫的选择使用 MinGW。于是进入相关下载页面(sourceforge)进行下载,只有 86.5k,哈哈,别高兴太早,这只是一个在线安装工具。
下载完后执行即可,这样就可以为我们安装 MinGW Installation Manager 了(好痛苦有没有,目前你只是可以安装这个大管家,真正的东西还没上场呢),欣赏一下安装动画吧。

我们在 MinGW 的官网看它的 Documentation,进去 Getting Started 在这里面仔细阅读,还是发现有那么一点点用的,是的,他们的 Documentation 是我所见过的最恶心的,基本上不知道它在讲什么。这里面提到一点 尽量不要勾选 install for all users,不知道会有什么后果。
经过漫长的等待,我们的 GCC 大管家就安装好了,这时候才轮到我们的主角 gfortran 的安装。
其实挺简单的
我们只需要点选 红框内容就可以了,其他的会自动匹配上去的,不用过于担心。
之后又是稍微有点慢长的等待。
完了以后 终端上输入 gcc
哦不对应该啊是 gfortran
看有何反应。
gfortran --version
GNU Fortran (GCC) 4.9.3
Copyright (C) 2015 Free Software Foundation, Inc.

好,妥了。
请务必确认安装 libiconv-2.dll
否则在使用 gcc/gfortran 命令时候会提示此动态库缺失。
哦对了,补充一下,我们需要将 gcc 添加到 Path。这个何时执行随意了,我是在没安装的时候就加入了。
默认路径 C:\MinGW\bin
也就是到 bin
这一层就够了。
然而
这个MinGW好像已经三年没更新过了
难怪我的 gfortran 的版本是 4.9.3 的了,裙子的都是 5.2.0的.......
Mingw-w64 is an advancement of the original mingw.org project, created to support the GCC compiler on Windows systems. It has forked it in 2007 in order to provide support for 64 bits and new APIs. It has since then gained widespread use and distribution.
The development and community are very active and welcoming with new contributors every month and simple installers.
看来这个才是首选啊


哦,补充一下最前面的部分

最后,也是很关键的一个是不要忘了加入 Path 啊,否则将只能使用它自己提供的那个cmd窗口。
网友评论