gcc-fortran缺少组件libmpfr

问题描述 投票:0回答:1

我已经在arch linux上安装了gcc-fortran

[当尝试使用gfortran helloWorld.f90编译hello world程序时,此文件就是其中的]

 Program Hello
      Print *, "Hello World!"
      End Program Hello

我得到:

/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/f951: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory

这是gcc缺少的组件吗?我猜libmpfr丢失了吗?我看到已安装gcc-libs。

linux gcc fortran gfortran archlinux
1个回答
0
投票

这是gcc缺少的组件吗?

GCC requires一些未由GCC托管的主机库。问题通常是在通过运行./contrib/download_prerequisites配置GCC之前未添加这些库。

此脚本将在GCC源代码树中下载适当版本的GMP,MPC,MPFR,并在它们中进行树内构建,然后再正确构建编译器,并且还将通过GCC安装触发安装这些主机库。

但是,如果在安装MPFR之后使用./contrib/download_prerequisites等进行配置,则该lib存在于build

机器上,但不一定存在于host机器上,即应该运行的机器要编译的编译器。因此,在使用--with-mpfr=--with-mpfr=等时,必须格外小心,以确保在运行编译器之前这些依赖关系已得到解决。
© www.soinside.com 2019 - 2024. All rights reserved.