gcc or clang
Set up PICurv, connect it to PETSc and MPI, and leave the installation with three verified command-line tools. Compile. Launch. Validate.Build the solver.
Prove the toolchain.simulator
postprocessor
picurv
From dependencies to a verified build.
Match the install to your machine.
PICurv sits on a compact scientific-computing toolchain. Have these components available before starting the build:
gcc or clangmpich or openmpimakepipgitDMSwarmIf PETSc is the only missing component, bootstrap can build it during the automated path.
The remaining commands run from this repository root.
The bootstrap path is the shortest route to a repeatable local installation. It checks the native toolchain, isolates the Python CLI, and builds the three PICurv launch targets.
From the PICurv repo root:
If PETSc is not installed yet, let the script build it:
The script installs system and Python dependencies, verifies PETSc/DMSwarm visibility, then builds:
bin/simulator (compiled C solver)bin/postprocessor (compiled C post-processor)bin/picurv (launcher for picurv_cli/picurv, the Python conductor entrypoint)By default, bootstrap creates .picurv-venv/ under the repo and installs the Python-side CLI dependencies there. PETSc, MPI, compilers, and scheduler tools remain provided by your loaded system or cluster modules. Bootstrap also writes .picurv-python-env, which records the seed Python runtime library path needed to launch the managed venv after you switch to a different module stack.
On an existing HPC cluster where modules already provide compilers, MPI, and PETSc, skip OS package installation:
Useful variants:
Use --no-venv when your site requires Python packages to come from modules or a centrally managed environment. If the only visible interpreter is Python 3.6, load a newer Python module before the default bootstrap path; otherwise use --no-venv and site-approved package versions.
Bootstrap does not upgrade pip during a normal install. This keeps routine updates smaller and avoids unnecessary package churn on quota-constrained cluster home directories. Pass --upgrade-pip when an explicit upgrade is needed.
Bootstrap writes .picurv-python and .picurv-python-env atomically, then checks that picurv, simulator, and postprocessor all report the release in the root VERSION file. A partial interpreter record or mixed-version native build therefore fails installation instead of becoming a latent cluster-launch error.
Debian/Ubuntu:
RHEL/CentOS/Fedora:
matplotlib is part of the standard Python dependency set because it powers summarize --plot and study plot generation.
Bootstrap verifies yaml, numpy, packaging, and matplotlib imports with PYTHONPATH and user-site packages disabled. This matches the isolated Python environment used by the picurv launcher and catches dependencies that are visible only through a loaded cluster module.
Recommended source install:
Debug build example:
Optimized build example:
PETSc's default PetscInt is 32-bit, so one vector or matrix holds at most 2,147,483,647 entries. In PICurv that limits a run to about 7.16 x 10^8 particles (a 3-component particle field), or to a grid of about 716M nodes (3-component fields; about 358M nodes with field statistics, whose workspace has 6). The solver refuses a larger run when it creates the field, naming the limit. The width is fixed when PETSc is configured; a module load cannot change it.
Above the limit, build a second set of executables in the same checkout against a PETSc configured with --with-64-bit-indices (the same options otherwise):
That builds into obj-int64/ and installs bin/simulator64 and bin/postprocessor64 beside the 32-bit pair; the build refuses a PETSc whose width does not match INDEX_BITS. picurv version lists all four executables with their widths (PETSc: 3.20.3 optimized, 64-bit indices). Keep the 32-bit pair as the default: 64-bit indices double the size of every index array, mainly in the assembled Poisson matrices.
picurv run chooses the set: a new run uses the 64-bit pair only when a particle or grid field outgrows 32-bit indices, and says so; a restart or --continue keeps the width its source checkpoints were written with; post-processing uses the width the run was staged with (<run.config>/active.json). --petsc-index-bits 32|64, or PICURV_PETSC_INDEX_BITS, chooses explicitly, and is refused against a checkpoint of the other width. A run that needs the 64-bit pair stops before staging when it is not built. Both PETSc builds name their library libpetsc.so.<version>, so whichever is first on LD_LIBRARY_PATH would be loaded; job scripts and local launches put the launched executable's own PETSc lib/ first, after the cluster profile's module_setup, so a job that loads the 32-bit PETSc module still runs the 64-bit pair on its own library. An executable started by hand against the other width's library refuses to start and says why, and picurv version shows the libpetsc each executable would load in the current shell, marking a mismatch.
Checkpoints are not portable between the two widths: PETSc binary files store their sizes as PetscInt without recording the width. checkpoint.meta records it (-checkpoint_petsc_index_bytes), and the solver and the conductor refuse a checkpoint of the other width. Files the conductor writes for the solver (generated initial conditions) use the width of the set it selected. A replacement generator script must accept --petsc-index-bytes 8, which the conductor passes only to a 64-bit run.
Official references:
Add to your shell profile (~/.bashrc or equivalent):
The etc/picurv.sh script sets PICURV_DIR, exports PICURV_PYTHON when a managed venv or bootstrap-selected Python is available, adds bin/ to your PATH for compiled executables, and also exposes picurv_cli/ as a fallback so picurv still resolves if bin/picurv is temporarily absent before a rebuild. It is idempotent and safe to source multiple times.
If you want bootstrap to add this setup to ~/.bashrc, pass --install-shell-hook. The hook is written as a managed block, so rerunning the installer updates it instead of appending duplicate source lines. Use --shell-rc <path> to target another shell startup file.
Reload and verify:
Verify PETSc has DMSwarm headers:
Expected binaries:
bin/simulator (compiled C solver)bin/postprocessor (compiled C post-processor)bin/picurv (launcher → picurv_cli/picurv)Useful variants:
After source etc/picurv.sh, use picurv directly from any directory. ./picurv_cli/picurv build writes <repo>/logs/build.log in the source repo. If you are auditing compiler warnings from a direct Make invocation, use make audit-build to generate both <repo>/logs/build.log and <repo>/logs/build.warnings.log.
Verification progresses from the installed PETSc toolchain to the complete MPI validation sweep. Start small, then choose the depth appropriate for your machine.
Recommended sequence after a successful build:
All three must report the same release. Each executable's second line names the PETSc it was built against, including its index width (int32 or int64); under it picurv version shows the libpetsc this shell would load, marked when it is not that PETSc. picurv version --format json also reports the Git commit, dirty-tree state, active workspace, and optional workspace requirement.
picurv version status checks that agreement for you and exits non-zero if it does not hold, which is the form to use in a job script or a CI step:
make doctorBuilds and runs a minimal PETSc-backed binary.
make smokeConfirms that the compiled PICurv executables launch.
make checkRuns Python regressions and PETSc-backed validation.
make check-fullAdds MPI units, fixed-size multi-rank smoke, and rank-matrix smoke.
What make doctor does not prove:
PETSC_DIR is unset or points at the wrong PETSc installation; PETSC_ARCH is only required for old-style in-tree PETSc builds.PATH.--python-bin, or use --no-venv.PYTHONPATH; prefer the managed venv launcher for normal CLI use.libpython; rerun bootstrap so .picurv-python-env records the seed runtime library path.bin/picurv symlink; rerun make -B conductor after pulling current source.libx11-dev when Linux reports cannot find -lX11.clean-project.For runtime-level failures after successful build, see Common Fatal Errors and Fixes.
For the full testing model after installation, see Testing and Validation Guide.