Table des matières
Jean Zay: Using the NVIDIA/PGI compilation system for C/C++ and Fortran
The various NVIDIA and PGI compiler versions available on Jean Zay may be activated through the module command.
Example of loading:
$ module avail pgi nvidia-compilers --------------------- /gpfslocalsup/pub/module-rh/modulefiles --------------------- pgi/19.10 pgi/20.1 pgi/20.4 --------------------- /gpfslocalsup/pub/module-rh/modulefiles --------------------- nvidia-compilers/20.7 nvidia-compilers/21.7 nvidia-compilers/23.9 nvidia-compilers/20.9 nvidia-compilers/21.9 nvidia-compilers/23.11 nvidia-compilers/20.11 nvidia-compilers/22.5 nvidia-compilers/24.3 nvidia-compilers/21.3 nvidia-compilers/22.9 nvidia-compilers/21.5 nvidia-compilers/23.1 $ module load nvidia-compilers/24.3 $ module list Currently Loaded Modulefiles: 1) nvidia-compilers/24.3
Summary of the compilation commands for Fortran, C and C++:
- NVIDIA compilers:
| Language | Command | Extensions of the source files |
|---|---|---|
| C | nvc | .c, .i |
| C++ | nvc++ | .C, .cxx, c++, .cc, .cpp |
| Fortran | nvfortran | .f, .F, .FOR, .F90, .F95, .f90, .f95 |
| CUDA-Fortran | nvfortran | .cuf, .CUF |
- PGI compilers:
| Language | Command | Extensions of the source files |
|---|---|---|
| C | pgcc | .c, .i |
| C++ | pgc++ | .C, .cxx, c++, .cc, .cpp |
| Fortran | pgfortran, pgf77, pgf95 | .f, .F, .FOR, .F90, .F95, .f90, .f95 |
| CUDA-Fortran | pgfortran, pgf95 | .cuf, .CUF |
Examples of generating executable files
$ nvc prog.c -o prog $ nvc++ prog.cpp -o prog $ nvfortran prog.f90 -o prog
