The free-to-use Nvidia HPC SDK compiler executables are:
Existing toolchains such as CMake and Meson can immediately use HPC SDK by setting environment variables:
CC=pgcc CXX=pgc++ FC=pgfortran
first ensuring the HPC SDK bin/ directory is on PATH.
Nvidia HPC binaries can offer speed improvements over GNU GCC / GFortran, but Intel oneAPI binaries can be significantly faster than Nvidia-compiled binaries for CPU-only workloads. Unless one specifically needs the GPU features of Nvidia HPC SDK consider GNU or Intel oneAPI that have more modern Fortran features.
Nvidia HPC compilers are currently available for Linux, with language standard support:
- Fortran 2003, with some Fortran 2008 including
- Download and install Nvidia HPC SDK:
- sudo is not required, but the install must be on symbolic-link-aware drive (not ExFAT)
- Add the Nvidia “bin” directory to your “~/.bashrc” PATH environment variable.
- Open a new terminal to use Nvidia compilers.
Currently, CMake can recognize Nvidia compilers as “PGI” since Nvidia HPC SDK takes over for deprecated PGI compilers.
Set compiler-specific options in
CMakeLists.txt for various Fortran compilers like:
project(myproj Fortran) if(CMAKE_Fortran_COMPILER_ID STREQUAL PGI) add_compile_options(-Mdclchk) endif()
Until CMake is updated to recognize Nvidia HPC as a distinct compiler suite, select the Nvidia compilers at CMake configure step:
FC=pgfortran CC=pgcc CXX=pgc++ cmake -B build