Fortran is one of the earliest computer senior languages. It has been around 40 years, which has experienced Fortran 66, Fortran 77, Fortran 90 and Fortran 95. Fortran 200x is still in the process of draft. In the field of scientific computing, Fortran has a strong vitality, such as HPF (High Performance Fortran) in large scientific calculations.
The mainstream Fortran 90/95 compiler has PGI Fortran, HP Fortran Compiler, which evolved from Fortran PowerStation and Intel Fortran Compiler.
This article mainly introduces two software installations under Linux, which Intel Fortran Compiler 8.0 and F Compiler. The reason for choosing them is that the former is a free Non-Commercial version provided by Intel; the latter is the implementation of a subset of Fortran 90/95, and it is very easy to learn.
Intel Fortran Compiler 8.0
Intel Fortran Compiler This compiler has excellent performance. Its release has two kinds of Windows and Linux. Both all available Non-Commercial version, but not provide technical support. The entire installation process is described below.
1. Download the Non-Commercial version of the Fortran compiler, there are two ways. First, log in to http://www.intel.com/software/products/global/eval.htm, select the second Non-Commercial UNSUPPORTED VERSION version under Intel (R) Fortran Compiler for Linux *, click Go. Second, log in directly http://www.intel.com/software/products/compilers/flin/noncom.htm. The entire download process takes a few steps. First click on the "Continue" button to enter the next page; have a questionnaire, fill it after filling the next page; page 3 is the software protocol page, after reading the "Accept" button to go to the next page; The fourth page is the registration page, where the e-mail field must be filled, then click the "Submit" button to enter the next page; this is the last page, the explanation is successful, Intel will send a user to the user Mail contains an attachment to a protocol.
The rest of the job is to charge the message and then download the software according to the address provided in the message. The software downloaded here is l_fc_p_8.0.034.tar.gz, approximately 84MB. In addition, users need to put the attachments in the email, under the same directory of the software that just downloaded, the file name here is l_for_70909049.lic. Everyone's file name may be different, it is an agreement file.
Next, the following installation work is performed, assuming that the two files in front are stored in the / usr / src / intel directory, which is also the author's work directory.
2. Unzip the installation file, the command is as follows:
#TAR XzVF L_FC_P_8.0.034.tar.gz
3. Install and specify the protocol. The compiler is installed in the / opt / intel_fc_80 directory, and the protocol is in the Licenses folder in this directory. Finally, you have to specify the location of the licenses. The specific command is as follows:
#mkdir -p / opt / intel_fc_80 / licenses
#cp /usr/src/intel/*.lic / opt / intel_fc_80 / licenses
# export intel_license_file = OPT / Intel_fc_80 / licensees
4. The installer, the command is as follows: #CD /USR/SRC/INTEL/L_FC_P_8.0.034
#. / install.sh
If you will see the following tips:
The Following Intel (R) Products and Related Products Arealled.
Intel (R) Fortran Compiler for 32-Bit Applications, Version 8.0
Linux Application Debugger for 32-Bit Applications, Version 7.3.1
Which of the folload network you like to instalall?
1. Intel (r) Fortran Compiler for 32-Bit Applications, Version 8.0
2. Linux Application Debugger for 32-Bit Applications, Version 7.3.1
X. EXIT
First select "1", install Intel Fortran Compiler, the default is installed, the default directory is / OPT / Intel_FC_80.
After the installation compiler is complete, continue to install Linux Application Debugger for 32-bit Application, Version 7.3.1, select "2", which is installed by default in / opt / intel_idb_73. Finally, "X" exits the installer.
5. Installation Finish can delete the installation file. The command is as follows:
#CD / USR / SRC
#RM -RF Intel
6. Sign in with a general user, change the .bash_profile file under the root of the user after logging in, add the following line in the last line:
. /opt/intel_fc_80/bin/ifortvars.sh
Note that there is a space after the point number in the above statement. Then log in or perform the following command:
$ SOURCE .BASH_PROFILE
Thus all installation and configuration are completed, you can simply test it. Edit a simple source file first.f90, the content is as follows:
Program first
Print *, "Hello World!"
Print *, sin (123.4)
End Program First
Then compile, the compile command is different from the previous version of Intel Fortran Compiler. It used to use the IFC command, starting from this version, will use the following command:
#ifort first.f90 -o first
Or run the following command:
#. / first
The show is shown below:
Hello World!
-0.7693915
The above shows that everything is normal, which can be used normally. Specific use of "Ifort" can be used for detailed help with "ifort -help". There is a detailed use of documentation in / opt / intel_fc_80 / doc.
F compiler
The F compiler is Fortran Company / Nagware F Compiler. It is an implementation of a subset of Fortran 90/95, supports some new concepts of Fortran 95 and HPF. For Fortran 77 programmers, f can call the Fortran 77 program directly, support and encourage object-oriented programming. Details about F can be viewed at http://www.fortran.com/f.
Install F is very simple, F has three releases of Windows, Linux, and Solaris. These three need to be GCC to work, so we must first ensure that the GCC environment is installed.
First download the installation file. Here is the Linux version, the download address is ftp://ftp.swcp.com/pub/walt/f, the file is f_linux_031017.tar.gz, about 2MB. The file is downloaded to the / usr / src directory after the file is ready to install. The following work requires root user privileges. Unzip files, enter the directory of the decompressed file, install compilation execution file, library file, and manual, the specific command is as follows: #tar xzvf f_linux_031017.tar.gz
# cd f_031017
# cp bin / * / usr / local / bin
# mkdir / usr / local / lib / f
# cp -d -p lib / * / usr / local / lib / f
#mkdir / usr / local / man / man1
#CP doc / *. 1 / usr / local / man / man1
After the installation is complete, enter the Examples directory for testing, the command is as follows:
#CD EXAMPLES
#F sieve.f95 -o sieve
If successful, a target execution file SIEVE will generate, perform the following command, as follows:
#. / sieve
There Are 25 Prime Numbers Less Than 100
2 3 5 7 11
13 17 19 23 29
31 37 41 43 47
......
The above shows that the instructions have been installed and can be used correctly. In addition, there are many examples of users in an Examples directory to view. There are other related documents, including F, compile options, and more.