在不更新GCC的情况下更新gfortran

在不更新GCC的情况下更新gfortran

本文介绍了在不更新GCC的情况下更新gfortran的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在不更新Linux操作系统中的GCC的情况下更新

解决方案

好吧,既然 gfortran 是GCC的一部分, gfortran 可能有点棘手。但是,您可以从。

您可以将两个档案解压缩到一个文件夹中(例如, / usr / local / gfortran )并开始使用这个版本的GCC(包括 gfortran )以及GNU Linux系统提供的版本。设置一个简短的shell脚本来调整 PATH 和 LD_LIBRARY_PATH 以使用此本地版本可能会有帮助。 gfortran 网站和示例关于如何实现这一点。



从本质上讲,您需要这样做:

  export PATH =/ usr / local / gfortran / bin:$ PATH

  if [-z$ LD_LIBRARY_PATH];然后
LD_LIBRARY_PATH =/ usr / local / gfortran / lib

LD_LIBRARY_PATH =/ usr / local / gfortran / lib:$ LD_LIBRARY_PATH
fi
如果您将本地版本安装在 / usr / local /目录中,则导出LD_LIBRARY_PATH

gfortran 。

Is it possible to update gfortran without updating the GCC in a Linux operating system?

解决方案

Well, since gfortran is part of the GCC, just updating gfortran could be a little tricky. However, you can download the gfortran binaries, as well as the required gcc-infrastructure package from the official site.

You can unzip the two archives into a folder (e.g., /usr/local/gfortran) and start using this version of GCC (incl. gfortran) alongside the version provided by your GNU Linux system. It might be helpful to set up a short shell script to adjust the PATH and LD_LIBRARY_PATH to use this local version. The gfortran site provides further details and examples on how to achieve that.

In essence, you need to do something like this:

export PATH="/usr/local/gfortran/bin:$PATH"

and

if [ -z "$LD_LIBRARY_PATH" ]; then
    LD_LIBRARY_PATH="/usr/local/gfortran/lib"
else
    LD_LIBRARY_PATH="/usr/local/gfortran/lib:$LD_LIBRARY_PATH"
fi
export LD_LIBRARY_PATH

provided that you installed the local version in /usr/local/gfortran.

这篇关于在不更新GCC的情况下更新gfortran的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 14:22