Differences

This shows you the differences between two versions of the page.

Link to this comparison view

en:soft_programmation_en_fortran_au_centre_de_calcul [2016/12/16 10:16] (current)
Line 1: Line 1:
 +Last modified: Nov 07, 2016 by Toukourou\\
 +\\
 +
 +====== SOFT: Using Fortran at CC ======
 +
 +\\
 +\\
 +
 +=====  Fortran 77  =====
 +
 +The users has at their disposal the different versions of Fortran compilers. ​
 +====  Compiler g77 (GNU)  ====
 +
 +g77 this compiler is delivered with the Linux system. It has been developped by [[http://​www.gnu.org|GNU]] . In order to copile one has to use the command **g77** (or **f77** ). To know the compiler options do:
 +<​code>​
 +> man g77
 +</​code>​
 +To compile the program //test.f// and to build the file //test.o// :
 +<​code>​
 +> g77 -O -c test.f
 +</​code>​
 +If your program is using the ( [[:​en:​la_cernlib_au_centre_de_calcul|CERNLIB]] ), you should use the command **cernlib** in order to define the librairies. Here is an example how to do this:
 +<​code>​
 +> g77 -O -o test  test.f ​ `cernlib` -lm
 +> ./test
 +</​code>​
 +**Attention:​** you should use the backquotes! ​
 +====  Compiler pgf77 (Portland Group) ​ ====
 +
 +The CC has some number of licences (via FlexLM) for the Fortran 77 supplied by [[:​en:​compilateurs_pgi_au_centre_de_calcul|PGI]] (Portland Group). In lorder to compile your program you should first initialise the variables by the command **pgi_env** (pgi_env32 in 32-bit compatibility mode). To see the compiler options use:
 +<​code>​
 +> pgi_env
 +> man pgf77
 +</​code>​
 +The complet documentation is available [[:​en:​compilateurs_pgi_au_centre_de_calcul|here]] .\\
 +\\
 +Un example how to compile:
 +<​code>​
 +> pgi_env
 +> pgf77 -O -c test.f
 +</​code>​
 +If you are using the ( [[:​en:​la_cernlib_au_centre_de_calcul|CERNLIB]] ), you should add the **libg2c.a** which is supplied with **g77** .
 +<​code>​
 +> pgi_env
 +> set g2c = '​-lg2c'​
 +> pgf77 -O -o test  test.f ​  ​`cernlib` ​ -lm ${g2c}
 +> ./test
 +</​code>​
 +
 +====  Compiler ifort (INTEL) ​ ====
 +
 +The CC has some number of licences (via FlexLM) Fortran 77 supplied by [[:​en:​compilateurs_intel_au_centre_de_calcul|INTEL]] . One should initialise the variables by the command **ifort_env** . To see the compiler options:
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> man ifort
 +</​code>​
 +The full documentation is available [[:​en:​compilateurs_intel_au_centre_de_calcul|here]] .\\
 +\\
 +Example how to compile:
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> ifort -O -c test.f
 +</​code>​
 +If you are using the ( [[:​en:​la_cernlib_au_centre_de_calcul|CERNLIB]] ), you should add the library **libg2c.a** .
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> set g2c = '​-lg2c'​
 +> ifort -O -o test  -nofor_main ​ test.f ​ `cernlib` ​ -lm  ${g2c}
 +> ./test
 +</​code>​
 +You can use also the debuggers: **pgdbg** et **pgprof** .
 +=====  Fortran 90  =====
 +
 +
 +====  Compiler pgf90 (Portland Group) ​ ====
 +
 +The CC has some number of licences (via FlexLM) for Fortran 90 supplied by [[:​en:​compilateurs_pgi_au_centre_de_calcul|PGI]] (Portland Group). You should initialise the compiler by the command **pgi_env** . To see the options use:
 +<​code>​
 +> pgi_env
 +> man pgf90
 +</​code>​
 +The full documentation is [[:​en:​compilateurs_pgi_au_centre_de_calcul|here]] .\\
 +\\
 +Example:
 +<​code>​
 +> pgi_env
 +> pgf90 -O -c test.f90
 +</​code>​
 +
 +====  Compiler ifort (INTEL) ​ ====
 +
 +The CC has some number of licences (via FlexLM) for pour Fortran 90 supplied by [[:​en:​compilateurs_intel_au_centre_de_calcul|INTEL]] . You should initialise the variables by the command **ifort_env** . To see the options:
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> man ifort
 +</​code>​
 +The full documentation is available [[:​en:​compilateurs_intel_au_centre_de_calcul|here]] .\\
 +\\
 +Example:
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> ifort -O -c test.f90
 +</​code>​
 +=====  Fortran 95  =====
 +
 +
 +====  Compiler g95 (GNU)  ====
 +
 +g95 has been developped by **[[http://​www.gnu.org|GNU]] . Use the command [[http://​www.g95.org|g95]]** for the compilation.\\
 +\\
 +This compiler is installed in /​usr/​local/​g95.
 +^                  ^Linux SL4 32 bits^Linux SL4 64 bits^Linux SL3^
 +|/​usr/​local/​bin/​g95|0.91 ​            ​|0.91 ​            ​|? ​       |
 +
 +
 +====  Compiler f95 (NAG)  ====
 +
 +The CC has some number of licences for Fortran 95 supplied by **NAG** . one should initialise the compiler by the command **f95_env** . To see the options of **[[:​compilateur_f95_de_nag_au_centre_de_calcul|f95]]** , use:
 +<​code>​
 +> f95_env
 +> man f95
 +</​code>​
 +This compiler is installed in /​usr/​local/​nagware/​f95.
 +^                          ^Linux SL4 32 bits^Linux SL4 64 bits^Linux SL3^
 +|/​usr/​local/​nagware/​f95/​bin|5.1 ​             |5.1              |5.1      |
 +
 +
 +====  Compiler pghpf (Portland Group) ​ ====
 +
 +The CC has some number of licences for Fortran 95 (et HPF) supplied by [[:​en:​compilateurs_pgi_au_centre_de_calcul|PGI]] (Portland Group). You should initialise the compiler by the commande **pgi_env** . To see the compiler options use:
 +<​code>​
 +> pgi_env
 +> man pghpf
 +</​code>​
 +The full documentation is available [[:​en:​compilateurs_pgi_au_centre_de_calcul|here]] .\\
 +\\
 +Example:
 +<​code>​
 +> pgi_env
 +> pghpf -O -c test.hpf
 +</​code>​
 +
 +====  Compiler ifort (INTEL) ​ ====
 +
 +The CC has some number of licences (via FlexLM) for Fortran 95 supplied by [[:​en:​compilateurs_intel_au_centre_de_calcul|INTEL]] . You should initialise the variables by the command **ifort_env** . To see the compiler options:
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> man ifort
 +</​code>​
 +The full documentation is available [[:​en:​compilateurs_intel_au_centre_de_calcul|here]] .\\
 +\\
 +Example
 +<​code>​
 +> ifort_env <​arch>​
 +arch = ia32 ou intel64
 +> ifort -O -c test.f90
 +</​code>​
 +=====  How to create the static library from the files .o  =====
 +
 +<​code>​
 +> ar –rv libmylib.a prog1.o prog2.o …
 +</​code>​
 +–r : add and replace object files in the library\\
 +-v : verbose option
 +
  
  • en/soft_programmation_en_fortran_au_centre_de_calcul.txt
  • Last modified: 2016/12/16 10:16
  • (external edit)