cp2k compling failed with "declared with mismatched bound ?XX? [-Werror=vla-parameter]"

14 views
Skip to first unread message

netscape

unread,
Oct 19, 2021, 11:07:57 AM10/19/21
to cp2k
Dear cp2k users, 

 I have sucessfully installed all requirments for the cp2k code (version 8.2.0) with gcc-11.2.0, openbals and openmpi. 
./install_cp2k_toolchain.sh --math-mode=openblas --with-openmpi=install

However, when I am trying to compile the cp2k code with " make -j 16 ARCH=local VERSION="ssmp sdbg psmp pdbg" ", I encounter a big trouble. The error messages are something like below. I have googled around for a while and could not find any solution. Would you please help me out? Thank you in advance. 

/data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.c:193:18: error: argument 24 of type ‘const double[n2][n1]’ declared with mismatched bound ‘n2’ [-Werror=vla-parameter]
  193 |     const double pab[n2][n1], double *grid) {
      |     ~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.c:19:
/data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.h:55:18: note: previously declared as ‘const double[n2][n1]’ with bound ‘n2’
   55 |     const double pab[n2][n1], double *grid);
      |     ~~~~~~~~~~~~~^~~~~~~~~~~
/data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.c:193:18: error: argument 24 of type ‘const double[n2][n1]’ declared with mismatched bound ‘n1’ [-Werror=vla-parameter]
  193 |     const double pab[n2][n1], double *grid) {
      |     ~~~~~~~~~~~~~^~~~~~~~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.c:19:
/data/zhang/soft/cp2k-8.2.0/src/grid/ref/grid_ref_collocate.h:55:18: note: previously declared as ‘const double[n2][n1]’ with bound ‘n1’
   55 |     const double pab[n2][n1], double *grid);
      |     ~~~~~~~~~~~~~^~~~~~~~~~~
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/utils.c:364:55: error: argument 2 of type ‘_Bool[3]’ with mismatched bound [-Werror=array-parameter=]
  364 | void verify_orthogonality(const double dh[3][3], bool orthogonal[3]) {
      |                                                       ^
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/utils.c:25:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/utils.h:111:63: note: previously declared as ‘_Bool *’
  111 | extern void verify_orthogonality(const double dh[3][3], bool *orthogonal);
      |                                                               ^
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.c:76:57: error: argument 6 of type ‘_Bool *’ declared as a pointer [-Werror=array-parameter=]
   76 |     const int *const xmin, const int *const xmax, bool *plane,
      |                                                         ^
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.c:8:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.h:16:56: note: previously declared as an array ‘_Bool[3]’
   16 |     const int *const xmin, const int *const xmax, bool plane[3],
      |                                                        ^
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.c:256:61: error: argument 1 of type ‘const _Bool * restrict’ declared as a pointer [-Werror=array-parameter=]
  256 | void apply_non_orthorombic_corrections(const bool *restrict plane,
      |                                        ~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.c:8:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/non_orthorombic_corrections.h:24:58: note: previously declared as an array ‘const _Bool[3]’
   24 | extern void apply_non_orthorombic_corrections(const bool plane[3],
      |                                               ~~~~~~~~~~~^~~~~~~~
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:868:46: error: argument 24 of type ‘const double[n2][n1]’ declared with mismatched bound ‘n2’ [-Werror=vla-parameter]
  868 |     const int n1, const int n2, const double pab_[n2][n1],
      |                                 ~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:27:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.h:24:18: note: previously declared as ‘const double[n2][n1]’ with bound ‘n2’
   24 |     const double pab_[n2][n1], double *const grid);
      |     ~~~~~~~~~~~~~^~~~~~~~~~~~
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:868:46: error: argument 24 of type ‘const double[n2][n1]’ declared with mismatched bound ‘n1’ [-Werror=vla-parameter]
  868 |     const int n1, const int n2, const double pab_[n2][n1],
      |                                 ~~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:27:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.h:24:18: note: previously declared as ‘const double[n2][n1]’ with bound ‘n1’
   24 |     const double pab_[n2][n1], double *const grid);
      |     ~~~~~~~~~~~~~^~~~~~~~~~~~
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:1238:51: error: argument 5 of type ‘offload_buffer *[nlevels]’ declared with mismatched bound ‘nlevels’ [-Werror=vla-parameter]
 1238 |                                   offload_buffer *grids[nlevels]) {
      |                                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_collocate_dgemm.c:28:
/data/zhang/soft/cp2k-8.2.0/src/grid/cpu/grid_cpu_task_list.h:53:51: note: previously declared as ‘offload_buffer *[nlevels]’ with bound ‘nlevels’
   53 |                                   offload_buffer *grids[nlevels]);
      |                                   ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~

Best
Yongsheng
Reply all
Reply to author
Forward
0 new messages