[petsc-users] Build error: vecimpl.h:124:98: error: expected declaration specifiers or '...' before string constant

Zongze Yang yangzongze at gmail.com
Tue Apr 18 04:20:27 CDT 2023


Hi, I am building petsc using gcc at 9.5.0, and found the following error:

```
In file included from /usr/include/alloca.h:25,
                 from /usr/include/stdlib.h:497,
                 from
/home/lrtfm/opt/firedrake/complex-int32/petsc/include/petscsys.h:1395,
                 from
/home/lrtfm/opt/firedrake/complex-int32/petsc/include/petscsf.h:7,
                 from
/home/lrtfm/opt/firedrake/complex-int32/petsc/src/vec/is/sf/interface/vscat.c:1:
/home/lrtfm/opt/firedrake/complex-int32/petsc/include/petsc/private/vecimpl.h:124:15:
error: expected declaration specifiers or '...' before '__builtin_offsetof'
  124 | static_assert(offsetof(struct _VecOps, loadnative) == sizeof(void
(*)(void)) * VECOP_LOADNATIVE, "");
      |               ^~~~~~~~
In file included from
/home/lrtfm/opt/firedrake/complex-int32/petsc/src/vec/is/sf/interface/vscat.c:7:
/home/lrtfm/opt/firedrake/complex-int32/petsc/include/petsc/private/vecimpl.h:124:98:
error: expected declaration specifiers or '...' before string constant
  124 | static_assert(offsetof(struct _VecOps, loadnative) == sizeof(void
(*)(void)) * VECOP_LOADNATIVE, "");
      |
                             ^~
```

Could someone give me some hints to fix it? The configure.log and make.log
are attached.


Best wishes,
Zongze
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230418/bdcc7f00/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: petsc-make.log
Type: application/octet-stream
Size: 890940 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230418/bdcc7f00/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: petsc-configure.log
Type: application/octet-stream
Size: 3772331 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230418/bdcc7f00/attachment-0003.obj>


More information about the petsc-users mailing list