|
|
(i) Download the linux binary from http://gcc.gnu.org/wiki/GFortranBinaries 32/64bit accroding to requirements.
(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 /).
(iii) tar -zxvf $path_to_download/gfortran-linux.tar.gz This will create 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.
(iii) $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
(iv) 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
(v) You will need to set LD_LIBRARY_FLAG or compile with -static.
(vi) 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. I just went through this process, with $mypath set to /tmp and it worked just fine.
转自http://gcc.gnu.org/wiki/GFortranBinaries32Linux
希望对有需要的人有所帮助 |
|