[petsc-users] petscerror.h is potentially missing includes

meator meator.dev at gmail.com
Wed Aug 21 13:44:14 CDT 2024


Ah, I didn't know that this bug is reported already. Thanks for the pointer!

On 8/21/24 8:40 PM, Pierre Jolivet wrote:
> Cross-referencing https://gitlab.com/petsc/petsc/-/issues/1254 
> <https://gitlab.com/petsc/petsc/-/issues/1254>
> 
> Thanks,
> Pierre
> 
>> On 21 Aug 2024, at 8:15 PM, meator <meator.dev at gmail.com> wrote:
>>
>> Hello. I have skimmed through PETSc's documentation to see whether 
>> PETSc has any special policy for including header files, but I didn't 
>> find anything, so I assume that standard C rules apply.
>>
>> The problematic header file is <petscerror.h>. The following code 
>> doesn't compile:
>>
>>    #include <petscerror.h>
>>
>>    int main() { return 0; }
>>
>> It fails because <petscerror.h> expects `MPI_Comm` to be defined, but 
>> it is (I assume) lacking appropriate includes which would define it. 
>> This is unfortunate, because many linters targeting C/C++ sort header 
>> files alphabetically. Since "petsc" is the common prefix for most 
>> PETSc header files, `petscerror.h` was put first in my header list 
>> because it begins with an "e".
>>
>> I'm using PETSc version 3.21.3.
>>
>> Thanks in advance
>> <OpenPGP_0x1A14CB3464CBE5BF.asc>
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0x1A14CB3464CBE5BF.asc
Type: application/pgp-keys
Size: 6275 bytes
Desc: OpenPGP public key
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240821/ba553742/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240821/ba553742/attachment-0001.sig>


More information about the petsc-users mailing list