HPC SDK 20.11 PGI Compile Fortran Issue

I have downloaded and installed HPC SDK 20.11. I am trying to use nvfortran (or pgf90/pgfortran) but I get an error “nvfortran: command not found”. Do I need to install the fortran compilers separate?

Did you add the compiler’s bin directory to your PATH environment variable?

The nvfortran driver should be found in “<install_dir>/Linux_x86_64/20.11/compilers/bin/” (or Linux_aarch64 for ARM, Linux_ppc64le for Power).

Thank you! I was able to successfully add the bin directory to my PATH. Nvfortran now runs.

Hi,

The program seems to work, but when I try to compile my code, I get a series of errors. I am typing:
“nvfortran -o myfile myfile.for” and get the following errors:

NVFORTRAN-S-0021-Label field of continuation line is not blank
NVFORTRAN-S-0087-Non-constant expression where constant expression required
NVFORTRAN-S-0034-Syntax error at or near ::
NVFORTRAN-S-0044-Multiple declaration for symbol number_of_fatigue_cycles
NVFORTRAN-F-0008-Error limit exceeded
NVFORTRAN/x86-64 Linux 20.11-0: compilation aborted

Is this a problem with the code or with how I installed the compiler?

Your code.

NVFORTRAN-S-0021-Label field of continuation line is not blank

The typical cause of this error is when the source includes pre-processor directives. If your code does include directives, try compiling with “-Mpreprocess” to enable pre-processing, or rename the file as “myfile.FOR”. Uppercase file suffix imply pre-processing by default.

Also, a “for” suffix implies fixed format. If you’re using free format, add the flag “-Mfree”.

See: HPC Compilers User's Guide Version 23.11 for ARM, OpenPower, x86

Changing the suffix to “.FOR” fixed almost all of the errors. The only one left is:

NVFORTRAN-S-0087-Non-constant expression where constant expression required

I believe that this is a fixed format. Would this be the cause of the error above?

This code was created on a computer that has a PGI Fortran/C license before the change to NVIDIA was made. I am now trying to run the code on another laptop that has the updated HPC SDK package.

Best guess is that you have a constant parameter being set to a variable. Are any of the macros being used to set a parameter? Something like:

integer, parameter :: len = SET_LEN

Where “SET_LEN” is a macro? If so, you may need to add the define flag on the compilation like “-DSET_LEN=100”. Otherwise, “SET_LEN” would be implicitly declared as a variable.