MoFEM is not compiling after PETSc update

23 views
Skip to first unread message

Karol Lewandowski

unread,
Nov 3, 2017, 5:07:44 PM11/3/17
to mofem...@googlegroups.com
What is the right procedure for user/developer when MoFEM is not compiling after an update?
Recently for instance, I have updated my PETSC to v3.8.0 and my MoFEM cannot finish compilation because the signature of the following function: PCMGGalerkinType() has been changed, which results in an error:

/Users/karollewandowski/moFEM/users_modules/users_modules/basic_finite_elements/src/impl/PCMGSetUpViaApproxOrders.cpp:722:10: error: no matching function for call to
      'PCMGSetGalerkin'
  ierr = PCMGSetGalerkin(pc,PETSC_FALSE); CHKERRQ(ierr);
         ^~~~~~~~~~~~~~~
/Users/karollewandowski/moFEM/petsc/include/petscpc.h:320:29: note: candidate function not viable: no known conversion from 'PetscBool' to 'PCMGGalerkinType' for 2nd argument
PETSC_EXTERN PetscErrorCode PCMGSetGalerkin(PC,PCMGGalerkinType);

Fix in this case seems quite simple, although I am sure entirely sure which of the new enumerators should I use instead PETSC_FALSE. 
In this case (and similar ones) should I create a pull request


Cheers,

Lukasz Kaczmraczyk

unread,
Nov 4, 2017, 5:00:41 AM11/4/17
to mofem...@googlegroups.com
Hello,

List of PETSc changes is in https://www.mcs.anl.gov/petsc/documentation/changes/38.html, and you are correct, that function was recently changed and takes new argument. In this context we need to set second argument to PC_MG_GALERKIN_BOTH. 

However we can not simply change code like that, since not all will like to immediately switch to new version of PETSc, so fix has to be made such that it works with older versions. In petsc file petsc/include/petscversion.h you will find what you need, i.e. version control,  and you can do

#if PETSC_VERSION_GE(3,8,0)
ierr
= PCMGSetGalerkin(...); CHKERRQ(ierr);
#else
ierr
= PCMGSetGalerkin(...); CHKERRQ(ierr);
#endif


Can you pleas make update for PCMGSetGalerkin and for other changes needed by petsc-3.8.0. Make pull request. Many thanks.

Regards,
Lukasz
Reply all
Reply to author
Forward
0 new messages