Bug in wave.F if PGI16 not defined (5.4.4)

Problems running VASP: crashes, internal errors, "wrong" results.

Moderators: Global Moderator, Moderator

Locked
Message
Author
ehermes
Newbie
Newbie
Posts: 11
Joined: Tue May 14, 2013 5:45 pm
License Nr.: 5-1579

Bug in wave.F if PGI16 not defined (5.4.4)

#1 Post by ehermes » Mon Aug 14, 2017 7:04 pm

There appears to be a bug in the wave.F file that occurs when VASP is compiled without defining PGI16 (which I assume is meant only to be used with the Portland Group compilers version 16). Specifically, lines 209, 242, and 263 contain "#ifndef PGI16", whereas line 179 also contains this statement but it is commented out (!#ifndef PGI16). If PGI16 is not defined, then the arrays CPTWFP, CPROJ, and CR are defined to be contiguous pointer arrays, and if PGI16 is defined they are merely pointer arrays. Since the check on line 179 is commented out (along with the continuous pointer array declaration), CPTWFP and CPROJ are always declared to be regular (non-contiguous) pointer arrays regardless of whether PGI16 is defined. This results in a compiler error when using the Intel compilers version 13. Uncommenting lines 179-184 and 187 fixes the issue, and this seems to create a perfectly working executable.

merzuk.kaltak
Administrator
Administrator
Posts: 277
Joined: Mon Sep 24, 2018 9:39 am

Re: Bug in wave.F if PGI16 not defined (5.4.4)

#2 Post by merzuk.kaltak » Wed Sep 18, 2019 9:50 am

This problem is due to gfortran-8 and is an ongoing discussion as one can read here: https://www.mail-archive.com/gcc-bugs@g ... 54941.html

If one follows the discussion on this thread and checks other websites and codes for this "bug",
one sees that on the one hand, there are several codes that have the same problem.
On the other hand, there is already an "inofficial" patch for gfortran-8 at following website with no guarantee on our side: https://patches-gcc.linaro.org/patch/10355/
Since Intel, Cray, IBM and NAG Fortran compilers don't complain about contiguous pointers pointing on non-contiguous targets, gfortran might follow after specific GNU developers are convinced to go along with the mainstream opinion.

Please understand that we are hesitant to provide users with any fix as long as we are not sure that this is a compiler problem issue. In fact vasp-5.4.4 compiles successfully with the experimental gfortran-9.

In the meanwhile, we suggest to use older versions of gfortran (for instance 7 or 6) or switch to an other compiler.

Locked