Files
nixpkgs/pkgs/development/python-modules/hoomd-blue/default.nix
2026-11-20 06:51:46 +00:00

107 lines
2.2 KiB
Nix

{
lib,
fetchFromGitHub,
buildPythonPackage,
pytestCheckHook,
cmake,
gcc14,
python,
eigen,
mpi,
cereal,
numpy,
pybind11,
rowan,
gsd,
h5py,
mpi4py,
sybil,
# https://github.com/glotzerlab/hoomd-blue/blob/v7.2.0/BUILDING.rst#configure
withHpmc ? true,
withMd ? true,
withMetal ? true,
withMpcd ? true,
withMpi ? false,
}:
buildPythonPackage (finalAttrs: {
version = "7.2.2";
pname = "hoomd-blue";
pyproject = false; # build with cmake
src = fetchFromGitHub {
owner = "glotzerlab";
repo = "hoomd-blue";
tag = "v${finalAttrs.version}";
hash = "sha256-t4/tcTtBq8rxF2/QkAtrKEJ9fW/exKnEtQ7Oddx+IqY=";
fetchSubmodules = true;
};
nativeBuildInputs = [
cmake
gcc14
]
++ lib.optionals withMpi [
mpi
];
buildInputs = [
eigen
cereal
]
++ lib.optionals withMpi [
cereal
];
dependencies = [
numpy
pybind11
];
dontAddPrefix = true;
cmakeFlags = [
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/${python.sitePackages}")
(lib.cmakeBool "BUILD_MD" withMd)
(lib.cmakeBool "BUILD_HPMC" withHpmc)
(lib.cmakeBool "BUILD_METAL" withMetal)
(lib.cmakeBool "BUILD_MPCD" withMpcd)
(lib.cmakeBool "BUILD_TESTING" finalAttrs.doCheck)
(lib.cmakeBool "ENABLE_MPI" withMpi)
]
++ (lib.optional withMpi (lib.cmakeFeature "MPI_HOME" "${lib.getDev mpi}"));
doCheck = true;
nativeCheckInputs = [
pytestCheckHook
gsd
h5py
rowan
sybil
]
++ lib.optionals withMpi [
mpi4py
];
pytestFlags = [ "hoomd" ];
meta = {
description = "Molecular dynamics and Monte Carlo soft matter simulation on GPUs";
longDescription = ''
HOOMD-blue is a Python package that performs hard particle Monte Carlo simulations of a
variety of shape classes and molecular dynamics simulations of particles with a range of pair,
bond, angle, and other potentials.
'';
homepage = "https://glotzerlab.engin.umich.edu/software/";
changelog = "https://github.com/glotzerlab/hoomd-blue/blob/${finalAttrs.src.tag}/CHANGELOG.rst";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [
debtquity
];
};
})