我相信我的问题类似于这篇文章:Linux:尽管安装了gfortran却找不到lgfortran。但是,由于建议的答案并不能解决我的问题,对于像我这样绝望的Linux新手来说,除了再次询问,似乎别无选择。
这是问题所在。我安装了GNU fortran编译器4.8.4,可以在终端中找到它
$ which gfortran-4.8
/usr/bin/gfortran-4.8
和
$ locate gfortran
/usr/bin/gfortran-4.7
/usr/bin/gfortran-4.8
/usr/bin/x86_64-linux-gnu-gfortran-4.7
/usr/bin/x86_64-linux-gnu-gfortran-4.8
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.a
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.so
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortran.spec
/usr/lib/gcc/x86_64-linux-gnu/4.7/libgfortranbegin.a
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.a
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.so
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortran.spec
/usr/lib/gcc/x86_64-linux-gnu/4.8/libgfortranbegin.a
/usr/lib/x86_64-linux-gnu/libgfortran.so.3
/usr/lib/x86_64-linux-gnu/libgfortran.so.3.0.0
/usr/share/doc/gfortran-4.7
/usr/share/doc/gfortran-4.8
/usr/share/doc/libgfortran-4.7-dev
/usr/share/doc/libgfortran-4.8-dev
/usr/share/doc/libgfortran3
/usr/share/man/man1/gfortran-4.7.1.gz
/usr/share/man/man1/gfortran-4.8.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gfortran-4.7.1.gz
/usr/share/man/man1/x86_64-linux-gnu-gfortran-4.8.1.gz
/var/cache/apt/archives/gfortran-4.7_4.7.3-12ubuntu1_amd64.deb
/var/cache/apt/archives/gfortran-4.8_4.8.4-2ubuntu1~14.04_amd64.deb
/var/cache/apt/archives/libgfortran-4.7-dev_4.7.3-12ubuntu1_amd64.deb
/var/cache/apt/archives/libgfortran-4.8-dev_4.8.4-2ubuntu1~14.04_amd64.deb
/var/cache/apt/archives/libgfortran3_4.8.4-2ubuntu1~14.04_amd64.deb
/var/lib/dpkg/info/gfortran-4.7.list
/var/lib/dpkg/info/gfortran-4.7.md5sums
/var/lib/dpkg/info/gfortran-4.8.list
/var/lib/dpkg/info/gfortran-4.8.md5sums
/var/lib/dpkg/info/libgfortran-4.7-dev:amd64.list
/var/lib/dpkg/info/libgfortran-4.7-dev:amd64.md5sums
/var/lib/dpkg/info/libgfortran-4.8-dev:amd64.list
/var/lib/dpkg/info/libgfortran-4.8-dev:amd64.md5sums
/var/lib/dpkg/info/libgfortran3:amd64.list
/var/lib/dpkg/info/libgfortran3:amd64.md5sums
/var/lib/dpkg/info/libgfortran3:amd64.postinst
/var/lib/dpkg/info/libgfortran3:amd64.postrm
/var/lib/dpkg/info/libgfortran3:amd64.shlibs
/var/lib/dpkg/info/libgfortran3:amd64.symbols
所以gfortran似乎已经安装了,尽管我不明白为什么在删除它后4.7版本仍然存在。
在设置Code:Blocks的全局编译器设置时,当我选择GNU Fortran编译器及其工具链可执行文件时,我尝试将安装目录设置为
/usr
/usr/bin
和
/usr/lib/gcc/x86_64-linux-gnu/4.8/
如前一篇文章中所建议的,代码:块告诉我
could not auto-detect installation path of "GNU Fortran Compiler".....
图像中显示了编译器配置的更多详细信息(感谢Mike的建议)。
这是我计算机上编译器的完整列表:
您的发布显示您同时拥有gfortran-4.7
和gfortran-4.8
安装在/usr/bin
。
拥有多个GCC Fortran编译器(或多个C或C ++编译器)是完全有效且司空见惯的。Code :: Blocks允许您配置尽可能多的Fortran编译器,只要为其指定不同的名称。如果您只想将其中一个配置为“ GNU Fortran编译器”,而忽略其他,则也可以。
But in any case, Code::Blocks must be able to unambiguously identify the installed compiler that you are calling "GNU Fortran Compiler". You have specified the Compiler's installation directory as /usr/bin
and have left the Program files compiler name as gfortran
.
There is no such compiler as /usr/bin/gfortran
in your system, and there is no program called gfortran
anywhere in your PATH
. You have /usr/bin/gfortran-4.7
and /usr/bin/gfortran-4.8
. As you have installed both of them, Code::Blocks assumes you want both of them. It can't tell which one of them you want to configure as "GNU Fortran Compiler".
So:-
/usr/bin
gfortran
对gfortran-4.8
,如果你想“GNU C ++编译器”的意思gfortran-4.8
。本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句