Compilation error: Argument for c_loc should be pointer or target
Posted: Wed Apr 10, 2024 3:37 pm
I am trying to compile VASP 6.4.3 with ELPA support using gcc (GCC) 11.3.1. I get two errors during the compilation of scala.F:
According to the standar:2087 | CALL c_f_pointer(c_loc(A(1)),EP,[NP,NQ])
Error: Argument X at (1) to C_LOC shall have either the POINTER or the TARGET attribute
2088 | CALL c_f_pointer(c_loc(Z),EZ,[NP,NQ])
Error: Argument X at (1) to C_LOC shall have either the POINTER or the TARGET attribute
I solved the problem by adding the target attribute to matrices A and Z at src/scala.F lines 2236 and 2252.C_LOC(X) determines the C address of the argument.
X: Shall have either the POINTER or TARGET attribute. It shall not be a coindexed object. It shall either be a variable with interoperable type and kind type parameters, or be a scalar, nonpolymorphic variable with no length type parameters.