Error in petsc header files

Hello everybody we are facing a problem when installing preCICE from the source. Every dependency is compiled from the source.

Our system is

  • preCICE version 2.2.0
  • Operating system Ubuntu 16
  • All from source code
  • Boost 1.77, PETSc 3.15, OpenMPI 4.0.5, Eigen 3.3.9

Here is the error message, is there any suggestion for us?

[ 38%] Building CXX object CMakeFiles/precice.dir/src/mapping/config/MappingConfiguration.cpp.o
In file included from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscsys.h:14:0,
                 from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscis.h:7,
                 from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscao.h:8,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/utils/Petsc.hpp:44,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/mapping/PetRadialBasisFctMapping.hpp:23,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/mapping/config/MappingConfiguration.cpp:13:
/scratch/ge79qad/install_precice/dependencies/petsc/include/petscviewer.h:134:3: error: expected ‘}’ before ‘__attribute’
   PETSC_VIEWER_ASCII_VTK_ATTR = PETSC_VIEWER_ASCII_VTK_DEPRECATED,
   ^
In file included from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscvec.h:12:0,
                 from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscmat.h:6,
                 from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscpc.h:6,
                 from /scratch/ge79qad/install_precice/dependencies/petsc/include/petscksp.h:6,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/utils/Petsc.hpp:46,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/mapping/PetRadialBasisFctMapping.hpp:23,
                 from /scratch/ge79qad/install_precice/precice_source/precice-2.2.0/src/mapping/config/MappingConfiguration.cpp:13:
/scratch/ge79qad/install_precice/dependencies/petsc/include/petscviewer.h:134:31: error: expected unqualified-id before ‘=’ token
   PETSC_VIEWER_ASCII_VTK_ATTR = PETSC_VIEWER_ASCII_VTK_DEPRECATED,
                               ^
/scratch/ge79qad/install_precice/dependencies/petsc/include/petscviewer.h:164:3: error: expected declaration before ‘}’ token
   } PetscViewerFormat;
   ^
CMakeFiles/precice.dir/build.make:1111: recipe for target 'CMakeFiles/precice.dir/src/mapping/config/MappingConfiguration.cpp.o' failed
make[2]: *** [CMakeFiles/precice.dir/src/mapping/config/MappingConfiguration.cpp.o] Error 1
CMakeFiles/Makefile2:187: recipe for target 'CMakeFiles/precice.dir/all' failed
make[1]: *** [CMakeFiles/precice.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2

What version of GCC is your OpenMPI based on? You can check with mpicc --version. Did the installation of PETSc (including make test) succeed?

My guess that your underlying GCC might be too old so you could try an older version of PETSc and see if this works for you.

Our gcc version is gcc (GCC) 7.5.0

the compilation and compilation check done without any error.

the test summary is as follows

#   Summary    
# -------------
# FAILED ts_tutorials_eimex-ct_vdp_imex ts_tutorials_eimex-ct_vdp_imex_adapt vec_is_sf_tests-ex1_window_nsize-1+sf_window_flavor-dynamic_sf_window_sync-fence vec_is_sf_tests-ex1_window_nsize-1+sf_window_flavor-dynamic_sf_window_sync-active vec_is_sf_tests-ex1_window_nsize-1+sf_window_flavor-dynamic_sf_window_sync-lock diff-vec_is_sf_tests-ex4_2_window+sf_window_sync-fence_sf_window_flavor-dynamic vec_is_sf_tests-ex4_2_window+sf_window_sync-active_sf_window_flavor-dynamic diff-vec_is_sf_tests-ex4_2_window+sf_window_sync-lock_sf_window_flavor-dynamic diff-vec_is_sf_tutorials-ex3_window_dupped+sf_window_sync-fence_sf_window_flavor-dynamic vec_is_sf_tutorials-ex3_window_dupped+sf_window_sync-active_sf_window_flavor-dynamic diff-vec_is_sf_tutorials-ex3_window_dupped+sf_window_sync-lock_sf_window_flavor-dynamic diff-vec_is_sf_tutorials-ex3_window+sf_window_sync-fence_sf_window_flavor-dynamic diff-vec_is_sf_tutorials-ex3_window+sf_window_sync-active_sf_window_flavor-dynamic diff-vec_is_sf_tutorials-ex3_window+sf_window_sync-lock_sf_window_flavor-dynamic snes_tutorials-ex33_0
# success 7247/9408 tests (77.0%)
# failed 15/9408 tests (0.2%)
# todo 225/9408 tests (2.4%)
# skip 1921/9408 tests (20.4%)

It would be interesting to see the full configuration and compilation output of preCICE. As a quick solution I would try an older PETSc release (3.13 or 3.14) and see if the error persists.

The CMake configuration that I am using is as follows

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/scratch/ge79qad/install_precice/precice_source/precice-2.2.0/ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DPRECICE_PythonActions=OFF ..

I will try older PETSc release :slight_smile:

Keep us posted! :slight_smile:

Just for reference: With “output” I meant all the output CMake prints to the terminal when you run the configuration and the compilation step and not only the command line you used for the configuration. The output helps to check whether the correct libraries, compilers etc. were picked up.

1 Like

Using PETSc 3.13 I finally managed to install preCICE itself.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.