2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2024-04-21 15:54:59 +00:00
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, ninja
|
2024-02-07 01:22:34 +00:00
|
|
|
, gfortran
|
|
|
|
, which
|
|
|
|
, perl
|
|
|
|
, procps
|
|
|
|
, libvdwxc
|
|
|
|
, libyaml
|
|
|
|
, libxc
|
|
|
|
, fftw
|
|
|
|
, blas
|
|
|
|
, lapack
|
|
|
|
, gsl
|
|
|
|
, netcdf
|
|
|
|
, arpack
|
2024-04-21 15:54:59 +00:00
|
|
|
, spglib
|
|
|
|
, metis
|
2024-02-07 01:22:34 +00:00
|
|
|
, scalapack
|
|
|
|
, mpi
|
|
|
|
, enableMpi ? true
|
2021-01-15 22:18:51 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert (!blas.isILP64) && (!lapack.isILP64);
|
2022-11-04 12:27:35 +00:00
|
|
|
assert (blas.isILP64 == arpack.isILP64);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "octopus";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "14.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "octopus-code";
|
|
|
|
repo = "octopus";
|
|
|
|
rev = version;
|
2024-05-15 15:35:15 +00:00
|
|
|
sha256 = "sha256-8wZR+bYdxJFsUPMWbIGYxRdNzjLgHm+KFLjY7fSN7io=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
nativeBuildInputs = [
|
2024-01-25 14:12:00 +00:00
|
|
|
which
|
2021-07-14 22:03:04 +00:00
|
|
|
perl
|
|
|
|
procps
|
2024-04-21 15:54:59 +00:00
|
|
|
cmake
|
2021-07-14 22:03:04 +00:00
|
|
|
gfortran
|
2024-04-21 15:54:59 +00:00
|
|
|
pkg-config
|
|
|
|
ninja
|
2021-07-14 22:03:04 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = [
|
|
|
|
libyaml
|
|
|
|
libxc
|
|
|
|
blas
|
|
|
|
lapack
|
|
|
|
gsl
|
|
|
|
fftw
|
|
|
|
netcdf
|
|
|
|
arpack
|
2024-02-07 01:22:34 +00:00
|
|
|
libvdwxc
|
2024-04-21 15:54:59 +00:00
|
|
|
spglib
|
|
|
|
metis
|
2021-01-15 22:18:51 +00:00
|
|
|
(python3.withPackages (ps: [ ps.pyyaml ]))
|
2024-02-07 01:22:34 +00:00
|
|
|
] ++ lib.optional enableMpi scalapack;
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optional enableMpi mpi;
|
|
|
|
propagatedUserEnvPkgs = lib.optional enableMpi mpi;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
(lib.cmakeBool "OCTOPUS_MPI" enableMpi)
|
|
|
|
(lib.cmakeBool "OCTOPUS_ScaLAPACK" enableMpi)
|
|
|
|
(lib.cmakeBool "OCTOPUS_OpenMP" true)
|
2024-02-07 01:22:34 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
nativeCheckInputs = lib.optional.enableMpi mpi;
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = false;
|
|
|
|
checkTarget = "check-short";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./
|
|
|
|
'';
|
|
|
|
|
|
|
|
postConfigure = ''
|
|
|
|
patchShebangs testsuite/oct-run_testsuite.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
passthru = lib.attrsets.optionalAttrs enableMpi { inherit mpi; };
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Real-space time dependent density-functional theory code";
|
|
|
|
homepage = "https://octopus-code.org";
|
|
|
|
maintainers = with maintainers; [ markuskowa ];
|
2021-01-15 22:18:51 +00:00
|
|
|
license = with licenses; [ gpl2Only asl20 lgpl3Plus bsd3 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|