Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ark_petsc_ex25.c:112:10: error: expected expression before 'do' #228

Closed
sagitter opened this issue Nov 17, 2022 · 2 comments
Closed

ark_petsc_ex25.c:112:10: error: expected expression before 'do' #228

sagitter opened this issue Nov 17, 2022 · 2 comments

Comments

@sagitter
Copy link

Hi all.

sundials-5.8.0 is not compiling the example file examples/arkode/C_petsc/ark_petsc_ex25.c when i use PETSc-3.18.1:

[ 42%] Building C object examples/arkode/C_petsc/CMakeFiles/ark_petsc_ex25.dir/ark_petsc_ex25.c.o
cd /builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/build/examples/arkode/C_petsc && /usr/lib64/openmpi/bin/mpicc  -I/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/include -I/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/build/include -I/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/src/sundials -isystem /usr/include/openmpi-x86_64/petsc -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -fcommon -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -fcommon -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/include/flexiblas -D__INSDIR__=\"\" -MD -MT examples/arkode/C_petsc/CMakeFiles/ark_petsc_ex25.dir/ark_petsc_ex25.c.o -MF CMakeFiles/ark_petsc_ex25.dir/ark_petsc_ex25.c.o.d -o CMakeFiles/ark_petsc_ex25.dir/ark_petsc_ex25.c.o -c /builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/examples/arkode/C_petsc/ark_petsc_ex25.c
make[2]: Leaving directory '/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/build'
In file included from /usr/include/openmpi-x86_64/petsc/petscsys.h:1274,
                 from /usr/include/openmpi-x86_64/petsc/petscvec.h:9,
                 from /usr/include/openmpi-x86_64/petsc/petscmat.h:7,
                 from /usr/include/openmpi-x86_64/petsc/petscdm.h:6,
                 from /builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/examples/arkode/C_petsc/ark_petsc_ex25.c:32:
/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/examples/arkode/C_petsc/ark_petsc_ex25.c: In function 'main':
/builddir/build/BUILD/sundials-5.8.0/buildopenmpi_dir/examples/arkode/C_petsc/ark_petsc_ex25.c:112:10: error: expected expression before 'do'
  112 |   ierr = PetscOptionsBegin(PETSC_COMM_WORLD,NULL,"Advection-reaction options","");
      |          ^~~~~~~~~~~~~~~~~
make[2]: *** [examples/arkode/C_petsc/CMakeFiles/ark_petsc_ex25.dir/build.make:79: examples/arkode/C_petsc/CMakeFiles/ark_petsc_ex25.dir/ark_petsc_ex25.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:13891: examples/arkode/C_petsc/CMakeFiles/ark_petsc_ex25.dir/all] Error 2

Full log here

@balos1
Copy link
Member

balos1 commented Nov 17, 2022

PETSc 3.18 introduced an API change that breaks the example. You will need to either use an older PETSc version (< 3.18), use newer SUNDIALS, or possibly apply the changes in this commit 9ae48a1. We added support for PETSc 3.18 in the 6.3.0 release.

@sagitter
Copy link
Author

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants