xref: /petsc/doc/developers/development.md (revision a982d5546cc9bcf96044945e3157033f4bde0259)
1*4bcd95a3SBarry Smith(development)=
2*4bcd95a3SBarry Smith
3*4bcd95a3SBarry Smith# PETSc Development Environment
4*4bcd95a3SBarry Smith
5*4bcd95a3SBarry SmithIn the course of developing PETSc, you may find the following useful in setting up your
6*4bcd95a3SBarry Smithbuild and development environment.
7*4bcd95a3SBarry Smith
8*4bcd95a3SBarry Smith## Influential `configure` flags
9*4bcd95a3SBarry Smith
10*4bcd95a3SBarry Smith- `--with-strict-petscerrorcode`:
11*4bcd95a3SBarry Smith
12*4bcd95a3SBarry Smith  This makes `PetscErrorCode` non-discardable (see `PETSC_NODISCARD`) in order to
13*4bcd95a3SBarry Smith  catch instances of missing `PetscCall()` and friends. For this reason it is *highly
14*4bcd95a3SBarry Smith  encouraged* that you `configure` with this option. CI will already have it enabled,
15*4bcd95a3SBarry Smith  doing so locally will save you the pain of re-running it.
16*4bcd95a3SBarry Smith
17*4bcd95a3SBarry Smith  For the vast majority of cases (this includes C++ constructors/destructors!), you must
18*4bcd95a3SBarry Smith  fix discarded `PetscErrorCode` warnings by wrapping your call in the appropriate
19*4bcd95a3SBarry Smith  `PetscCall()` variant. If you are choosing to intentionally silence the warnings by
20*4bcd95a3SBarry Smith  ignoring the return code you may do so in the following way:
21*4bcd95a3SBarry Smith
22*4bcd95a3SBarry Smith  ```
23*4bcd95a3SBarry Smith  PetscErrorCode ierr;
24*4bcd95a3SBarry Smith
25*4bcd95a3SBarry Smith  ierr = SomePetscFunction(); // OK, capturing result
26*4bcd95a3SBarry Smith  (void)ierr; // to silence set-but-not-used warnings
27*4bcd95a3SBarry Smith  ```
28*4bcd95a3SBarry Smith
29*4bcd95a3SBarry Smith## Editor Integrations
30*4bcd95a3SBarry Smith
31*4bcd95a3SBarry Smith### Emacs
32*4bcd95a3SBarry Smith
33*4bcd95a3SBarry SmithTODO
34*4bcd95a3SBarry Smith
35*4bcd95a3SBarry Smith### Vim
36*4bcd95a3SBarry Smith
37*4bcd95a3SBarry SmithTODO
38