Updating gfortran without updating GCC

强颜欢笑 提交于 2019-12-24 12:15:58

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/36178094/updating-gfortran-without-updating-gcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!