如何在 Ubuntu 14.04 上安装 GNU Fortran 77 编译器或 g77
How to install the GNU Fortran 77 compiler or g77 on Ubuntu 14.04
我有一个需要 g77 编译器的库。
网上找的方法不多;但都失败了。以下是我的两项努力的总结:
1) 我下载了软件包,解压了它,然后
$须藤./install.sh
Selecting previously unselected package gcc-3.4-base.
(Reading database ... 182226 files and directories currently installed.)
Preparing to unpack gcc-3.4-base_3.4.6-6ubuntu3_i386.deb ...
Unpacking gcc-3.4-base (3.4.6-6ubuntu3) ...
Selecting previously unselected package cpp-3.4.
Preparing to unpack cpp-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking cpp-3.4 (3.4.6-6ubuntu3) ...
Selecting previously unselected package gcc-3.4.
Preparing to unpack gcc-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking gcc-3.4 (3.4.6-6ubuntu3) ...
dpkg: warning: downgrading libg2c0 from 1:3.4.6-6ubuntu5 to 1:3.4.6-6ubuntu3
Preparing to unpack libg2c0_3.4.6-6ubuntu3_i386.deb ...
Unpacking libg2c0 (1:3.4.6-6ubuntu3) over (1:3.4.6-6ubuntu5) ...
Selecting previously unselected package libg2c0-dev.
Preparing to unpack libg2c0-dev_3.4.6-6ubuntu3_i386.deb ...
Unpacking libg2c0-dev (1:3.4.6-6ubuntu3) ...
Selecting previously unselected package g77-3.4.
Preparing to unpack g77-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking g77-3.4 (3.4.6-6ubuntu3) ...
Setting up gcc-3.4-base (3.4.6-6ubuntu3) ...
Setting up cpp-3.4 (3.4.6-6ubuntu3) ...
dpkg: dependency problems prevent configuration of gcc-3.4:
gcc-3.4 depends on binutils (>= 2.16.1-3).
dpkg: error processing package gcc-3.4 (--install):
dependency problems - leaving unconfigured
Setting up libg2c0 (1:3.4.6-6ubuntu3) ...
Setting up libg2c0-dev (1:3.4.6-6ubuntu3) ...
dpkg: dependency problems prevent configuration of g77-3.4:
g77-3.4 depends on gcc-3.4 (= 3.4.6-6ubuntu3); however:
Package gcc-3.4 is not configured yet.
dpkg: error processing package g77-3.4 (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.3) ...
Errors were encountered while processing:
gcc-3.4
g77-3.4
2) 我按照 (http://seanelvidge.com/2012/08/install-g77-on-ubuntu-9-04/#comment-549085) 中的描述更改了 sources.list 文件,然后在“sudo apt-get update” 运行 之后找不到 g77 很好。
$ sudo apt-get 安装 g77
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package g77 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
一些帮助将不胜感激。
我做了以下事情:
1) 从这里下载 64 位的 g77
http://www.ziddu.com/download/16792814/g77_x64_debian_and_ubuntu.tar.gz.html
2) 然后做了以下操作:
tar -xzvf g77_x64_debian_and_ubuntu.tar.gz
cd g77_x64_debian_and_ubuntu
chmod +x ./install.sh
./install.sh
(答案改编自 askubuntu)
OP linked 到我的博客 post 以安装不再有效的 g77。不过我 written a new one for versions of Ubuntu >=14.04
有关详细信息,请参阅我的 link 但基本概述是:
添加 Ubuntu 8.04 存储库。通过编辑 sources.list:
sudo gedit /etc/apt/sources.list
然后在该文件的底部添加:
deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe
deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe
deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy-updates universe
deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy-updates universe
然后 运行 更新并安装 g77:
sudo apt update
sudo apt install g77
你可能会走运,g77 可能会立即为你工作。您可能会收到一条错误消息,例如:
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
这意味着 ld 找不到库 (libgcc_s)。自己找到图书馆,检查 ld 正在寻找的地方,然后在那里放一个 link:
sudo find /usr/ -name libgcc_s.so
ld -lgcc_s --verbose
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so /usr/lib/x86_64-linux-gnu/
(您可能需要根据 find 和 ld 命令中的 return 修改 link 命令中的目标和 link)
现在你应该可以开始了。我会注释掉您最后添加到 sources.list 文件的行。有关完整详细信息,请查看 my webpage.
我有一个需要 g77 编译器的库。
网上找的方法不多;但都失败了。以下是我的两项努力的总结:
1) 我下载了软件包,解压了它,然后 $须藤./install.sh
Selecting previously unselected package gcc-3.4-base.
(Reading database ... 182226 files and directories currently installed.)
Preparing to unpack gcc-3.4-base_3.4.6-6ubuntu3_i386.deb ...
Unpacking gcc-3.4-base (3.4.6-6ubuntu3) ...
Selecting previously unselected package cpp-3.4.
Preparing to unpack cpp-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking cpp-3.4 (3.4.6-6ubuntu3) ...
Selecting previously unselected package gcc-3.4.
Preparing to unpack gcc-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking gcc-3.4 (3.4.6-6ubuntu3) ...
dpkg: warning: downgrading libg2c0 from 1:3.4.6-6ubuntu5 to 1:3.4.6-6ubuntu3
Preparing to unpack libg2c0_3.4.6-6ubuntu3_i386.deb ...
Unpacking libg2c0 (1:3.4.6-6ubuntu3) over (1:3.4.6-6ubuntu5) ...
Selecting previously unselected package libg2c0-dev.
Preparing to unpack libg2c0-dev_3.4.6-6ubuntu3_i386.deb ...
Unpacking libg2c0-dev (1:3.4.6-6ubuntu3) ...
Selecting previously unselected package g77-3.4.
Preparing to unpack g77-3.4_3.4.6-6ubuntu3_i386.deb ...
Unpacking g77-3.4 (3.4.6-6ubuntu3) ...
Setting up gcc-3.4-base (3.4.6-6ubuntu3) ...
Setting up cpp-3.4 (3.4.6-6ubuntu3) ...
dpkg: dependency problems prevent configuration of gcc-3.4:
gcc-3.4 depends on binutils (>= 2.16.1-3).
dpkg: error processing package gcc-3.4 (--install):
dependency problems - leaving unconfigured
Setting up libg2c0 (1:3.4.6-6ubuntu3) ...
Setting up libg2c0-dev (1:3.4.6-6ubuntu3) ...
dpkg: dependency problems prevent configuration of g77-3.4:
g77-3.4 depends on gcc-3.4 (= 3.4.6-6ubuntu3); however:
Package gcc-3.4 is not configured yet.
dpkg: error processing package g77-3.4 (--install):
dependency problems - leaving unconfigured
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.3) ...
Errors were encountered while processing:
gcc-3.4
g77-3.4
2) 我按照 (http://seanelvidge.com/2012/08/install-g77-on-ubuntu-9-04/#comment-549085) 中的描述更改了 sources.list 文件,然后在“sudo apt-get update” 运行 之后找不到 g77 很好。
$ sudo apt-get 安装 g77
Reading package lists… Done
Building dependency tree
Reading state information… Done
Package g77 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
一些帮助将不胜感激。
我做了以下事情: 1) 从这里下载 64 位的 g77 http://www.ziddu.com/download/16792814/g77_x64_debian_and_ubuntu.tar.gz.html
2) 然后做了以下操作:
tar -xzvf g77_x64_debian_and_ubuntu.tar.gz
cd g77_x64_debian_and_ubuntu
chmod +x ./install.sh
./install.sh
(答案改编自 askubuntu)
OP linked 到我的博客 post 以安装不再有效的 g77。不过我 written a new one for versions of Ubuntu >=14.04
有关详细信息,请参阅我的 link 但基本概述是:
添加 Ubuntu 8.04 存储库。通过编辑 sources.list:
sudo gedit /etc/apt/sources.list
然后在该文件的底部添加:
deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe
deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy universe
deb [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy-updates universe
deb-src [trusted=yes] http://old-releases.ubuntu.com/ubuntu/ hardy-updates universe
然后 运行 更新并安装 g77:
sudo apt update
sudo apt install g77
你可能会走运,g77 可能会立即为你工作。您可能会收到一条错误消息,例如:
/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
这意味着 ld 找不到库 (libgcc_s)。自己找到图书馆,检查 ld 正在寻找的地方,然后在那里放一个 link:
sudo find /usr/ -name libgcc_s.so
ld -lgcc_s --verbose
sudo ln -s /usr/lib/gcc/x86_64-linux-gnu/4.8/libgcc_s.so /usr/lib/x86_64-linux-gnu/
(您可能需要根据 find 和 ld 命令中的 return 修改 link 命令中的目标和 link)
现在你应该可以开始了。我会注释掉您最后添加到 sources.list 文件的行。有关完整详细信息,请查看 my webpage.