2023-03-15 09:49:59 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
2024-03-26 20:09:21 +00:00
|
|
|
, fetchpatch2
|
2023-03-15 09:49:59 +00:00
|
|
|
, gfortran
|
2024-03-26 20:09:21 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2023-03-15 09:49:59 +00:00
|
|
|
, blas
|
|
|
|
, lapack
|
|
|
|
, mctc-lib
|
|
|
|
, mstore
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert !blas.isILP64 && !lapack.isILP64;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "multicharge";
|
|
|
|
version = "0.2.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "grimme-lab";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-oUI5x5/Gd0EZBb1w+0jlJUF9X51FnkHFu8H7KctqXl0=";
|
|
|
|
};
|
|
|
|
|
2024-03-26 20:09:21 +00:00
|
|
|
patches = [
|
|
|
|
# Fix finding of MKL for Intel 2021 and newer
|
|
|
|
# Also fix finding mstore
|
|
|
|
# https://github.com/grimme-lab/multicharge/pull/20
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://github.com/grimme-lab/multicharge/commit/98a11ac524cd2a1bd9e2aeb8f4429adb2d76ee8.patch";
|
|
|
|
hash = "sha256-zZ2pcbyaHjN2ZxpMhlqUtIXImrVsLk/8WIcb9IYPgBw=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ gfortran meson ninja pkg-config python3 ];
|
2023-03-15 09:49:59 +00:00
|
|
|
|
|
|
|
buildInputs = [ blas lapack mctc-lib mstore ];
|
|
|
|
|
2024-01-11 16:28:55 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
2024-03-26 20:09:21 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2024-01-11 16:28:55 +00:00
|
|
|
postPatch = ''
|
2024-03-26 20:09:21 +00:00
|
|
|
patchShebangs --build config/install-mod.py
|
2023-03-15 09:49:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export OMP_NUM_THREADS=2
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Electronegativity equilibration model for atomic partial charges";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "multicharge";
|
2023-03-15 09:49:59 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/grimme-lab/multicharge";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.sheepforce ];
|
|
|
|
};
|
|
|
|
}
|