代码:虽然安装了块,但无法检测到gfortran

啄木鸟王

我相信我的问题类似于这篇文章: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.7gfortran-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:-

  • Set Compiler's installation directory = /usr/bin
  • 程序文件,更改所有出现的gfortrangfortran-4.8,如果你想“GNU C ++编译器”的意思gfortran-4.8
  • 好了

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

检测到USB记忆棒,但无法安装

虽然我已经安装了GSL库,但g ++无法编译我的代码

BIOS检测到HDD但无法启动

Visual Studio代码无法检测到已安装的git

安装了laravel但无法查看项目

安装了PyOWM但无法识别?

Windows 8.1:Vagrant无法检测到VirtualBox!确保正确安装了VirtualBox

我从源代码安装了 Node-12,但无法获取 nodejs --version

Resharper未检测到安装了Visual Studio 2015

可以检测到外部硬盘,但无法访问

检测到硬盘但无法从中读取任何内容

检测到OpenCv QR码,但无法解码

在13.10上,检测到wifi,但无法连接

HDD在BIOS中检测到但无法引导

从源安装了Boost.Numpy但无法正常工作

安装了plex媒体服务器,但无法启动

在OSX上安装了GNU grep,但无法使用

我安装了熊猫但无法正常工作

可以检测到wifi,但无法检测到我的wifi

Windows 7安装无法检测到硬盘

无法从HTML代码中检测到webelement

ModuleNotFoundError 虽然安装了 Python 模块 PyBluez

如何根据升级代码检测是否安装了应用

实现继承 - 虽然我的代码中的类似方法工作正常,但无法使方法正常工作

即使安装了系统映像,带有Visual Studio的Xamarin也无法检测到模拟器的CPU / ABI系统映像

自制pyenv ...尽管我已经安装了Python 3.8.3,但无法安装

在USB上安装了Ubuntu 15.1(完全安装),但无法启动

在检测到是否安装了chrome扩展程序时出现错误

theano g ++未检测到,但是我已经成功安装了g ++