pgfortran hanging during compilation

Hi,

pgfortran 19.10 hangs on one particular source file while compiling a large Fortran 2003 codebase (https://github.com/fabm-model/fabm). As compilation works fine with several other compilers (Intel, gfortran, Cray) I suspect a compiler bug. I’ve previously found ways to work around such bugs by making slight changes in the code. However, to do so, I would need to know on which of the 3300 lines in the offending file the compiler is choking. Therefore: can pgfortran be made to show what part of the code it is currently processing, for instance with a specific command line option?

Jorn

Hi Jorn,

Therefore: can pgfortran be made to show what part of the code it is currently processing, for instance with a specific command line option?

No, at least not in a released version of the compiler. Nor would it be very useful for you since we’d still need one of our compiler engineers to take a look as to where and why it’s hanging.

I cloned the git repo but it doesn’t seem that the cmake is configured to use PGI (or at least it wasn’t clear to me on how to configure it). Can you provide instructions on how to reproduce the problem so I can investigate?

Thanks,
Mat

Hi Mat,

Thanks for the quick reply and I appreciate you going as far as cloning the code! To reproduce my exact problem:

git clone git@github.com:fabm-model/fabm.git
cd fabm
git checkout 1.0rc1
mkdir …/build-fabm
cd …/build-fabm
cmake …/fabm -DFABM_HOST=nemo -DCMAKE_Fortran_COMPILER=pgfortran
make

In the above, -DCMAKE_Fortran_COMPILER=pgfortran is used to tell cmake to use pgfortran. The branch (1.0rc1) and the -DFABM_HOST=nemo may not be essential to reproduce my issue, but they were what I was using.

in my case, it then hangs on compiling fabm_types.F90.

Thanks

Jorn

Thanks Jorn.

I was able to reproduce the issue here so added a problem report, TPR #28053. Unfortunately I don’t have a work around for you. I tried to pair down the code to see where the compiler was getting stuck, but the source is a bit to complex so no luck.

-Mat

I’ve now been able to work around this bug (for reference: the problem was triggered by the fatal_error call in variable_set_remove). The original problem can still be reproduced with the original code:

git checkout 16691f5

Jorn

The original problem should be resolved with PGI 20.4