WRF compiling with PGI community

Hi! I’ve been trying for several days to compile all needed libraries for WRF, and, after that, WRF itself.

So far I’ve been able to compile NETCDF (old all-in-one version 4.1.2), libpng, zlib and jasper (all needed by WRF and WRF preprocessor).

So far, it seems that libraries are doing OK, as tests provided by WRF for libraries work flawlessly just by changing the compiler of them (it comes with gcc/gfortran by default) to pgcc and pgfortran, the ones I’ve used with PGI compiler.

The problem comes when I try to compile WRF for real case. It fails, not creating .exe files.

I attach the log.
Link to the log.compile file -> https://drive.google.com/file/d/15df3kIbOl29Tyj44wefxmNQSgM2w1N8o/view?usp=sharing

Any help would be well received. I’m totally new to compilers, flags and touching this level of things, but I’m trying to learn from these errors.


PD: I’ve tried to compile new NETCDF versions (the ones that are separated into C, CXX, Fortran and the one that just says “netcdf-4.7.x”), but I’ve failed all the time. Perhaps the cause is using so old netcdf, but is strange as tests are passed before trying to compile WRF.

Hi Enea23,

This is a known compiler issue (TPR#27672) which first appeared in our 19.7 compilers. (See: Compilation error in WRF 4.1.2). Unfortunately we don’t have it fixed yet.

The workarounds are to either go back to using the PGI 19.5 release, or compile with our non-LLVM based compilers by setting your PATH to include “$PGI/linux86-64-nollvm/19.10/bin” and rebuild. You’ll need to rebuild NetCDF as well or use the pre-built version we ship, “$PGI/linux86-64-nollvm/2019/netcdf/netcdf-4.6.2/openmpi-3.1.3/lib”.

Apologizes for the inconvenience.


I’ve tried with non-LLVM compilers and everything is working now!


You should be able to use the LLVM compilers again with 20.1