歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 在Linux中安裝GFortran

在Linux中安裝GFortran

日期:2017/2/28 16:25:25   编辑:Linux教程

Somebody has deleted these instructions. Please accept our apologies. The entry below is a temporary measure but should get you up and running:

某人己經刪掉了這些使用說明。請接受我們的道歉。下面的輸入是暫時性的方法但可以使你進行的很順利:

(i) Download the linux binary from http://gcc.gnu.org/wiki/GFortranBinaries 32/64bit accroding to

requirements.

1、下載linux二進制文件,從這裡根據要求下載32/64位。

(ii) cd to the directory where you wish to install gfortran; let us say $mypath, which might conveniently be /home or /home/myname or /etc (or even /).

2、cd(譯者注:Linux命令更改目錄)到你希望安裝gfortran的目錄去,我們假設是 $mypath,這個通常可能是 /home 或者 /home/myname 或者 /etc(甚至是根目錄/).

(iii) tar -zxvf $path_to_download/gfortran-linux.tar.gz (if the file you downloaded ends with .tar.gz) or tar -jxvf $path_to_download/gfortran-linux.tar.bz2 (if the file ends with .tar.bz2)

3、tar –zxvf $path_to_download/gfortran-linux.tar.gz(假如你下載的文件以.tar.gz結尾)或者 tar –jxvf $path_to_download/gfortran-linux.tar.bz2(假如文件以.tar.bz2結尾)。(譯者注:path_to_download 是你下載文件的目錄)

(iv) The previous step has created a directory irun, under $mypath that contains gfortran-4.2 and gcc-4.2 plus associated libraries. This will not interfere with any other compiler. www.linuxidc.com

4、之前的步驟產生了一個irun目錄,在$mypath下包含著gfortran-4.2和gcc-4.2關聯庫。這不會和任何其他編譯器沖突。

(v) $mypath/irun/bin/gfortran --version will tests that all is well. You should see GNU Fortran 95 (GCC) 4.2.0 20060602 (experimental) Copyright (C) 2006 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law. You may redistribute copies of GNU Fortran under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING

5、$mypath/irun/bin/gfortran –version 將會檢測所有是否正常。你應該看到GNU Fortran 95(GCC)4.2.0 20060602(experimental)Copyright(C)2006 Free Software Foundation,Inc.

GNU Fortran 沒有質量保證,在一定程度上被法律許可。你可以在GUN一般公開許可的條款下,再分發GUN Fortran 的副本。關於這些事情的更多信息,查看名字為COPYING的文件。

(vi) I have to confess that on my solo user system, I use $mypath "", so that the invocation is /irun/bin/gfortran You might find it cleaner to use /etc

6、我必須坦言在我的但用戶系統中,我用$mypath””,所以調用是 /irun/bin/gfortran 。你會發現用/etc很清楚。

(vii) You will need to set LD_LIBRARY_FLAG or compile with -static.

7、你需要設置 LD_LIBRARY_FLAG 或者編譯用 –static

(viii) Assuming that you are using bash, find your .bash_profile and add the line,

export LD_LIBRARY_PATH$mypath/irun/lib alternatively, invoke bash at the command line and enter this previous line.

You should have an operational gfortran by now.

8、加入你使用bash,找到.bash_profile 並加入一行,export LD_LIBRARY_PATH$mypath/irun/lib

或者在命令行下調用bash,輸入之前的那一行。

到此為止,你有了一個可以運行的gfortran了。

Copyright © Linux教程網 All Rights Reserved