2024-02-07 01:22:34 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
|
|
|
, gfortran
|
|
|
|
, which
|
|
|
|
, perl
|
|
|
|
, procps
|
|
|
|
, libvdwxc
|
|
|
|
, libyaml
|
|
|
|
, libxc
|
|
|
|
, fftw
|
|
|
|
, blas
|
|
|
|
, lapack
|
|
|
|
, gsl
|
|
|
|
, netcdf
|
|
|
|
, arpack
|
|
|
|
, autoreconfHook
|
|
|
|
, scalapack
|
|
|
|
, mpi
|
|
|
|
, enableMpi ? true
|
2021-01-15 22:18:51 +00:00
|
|
|
, python3
|
2021-09-18 10:52:07 +00:00
|
|
|
, enableFma ? stdenv.hostPlatform.fmaSupport
|
|
|
|
, enableFma4 ? stdenv.hostPlatform.fma4Support
|
|
|
|
, enableAvx ? stdenv.hostPlatform.avx2Support
|
|
|
|
, enableAvx512 ? stdenv.hostPlatform.avx512Support
|
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";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "13.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "octopus-code";
|
|
|
|
repo = "octopus";
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-CZ+Qmv6aBQ6w11mLvTP6QAJzaGs+vmmXuNGnSyAqVDU=";
|
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
|
|
|
|
autoreconfHook
|
|
|
|
gfortran
|
|
|
|
];
|
|
|
|
|
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
|
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
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
configureFlags = with lib; [
|
2023-02-16 17:41:37 +00:00
|
|
|
"--with-yaml-prefix=${lib.getDev libyaml}"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--with-blas=-lblas"
|
|
|
|
"--with-lapack=-llapack"
|
2023-02-16 17:41:37 +00:00
|
|
|
"--with-fftw-prefix=${lib.getDev fftw}"
|
|
|
|
"--with-gsl-prefix=${lib.getDev gsl}"
|
|
|
|
"--with-libxc-prefix=${lib.getDev libxc}"
|
2024-02-07 01:22:34 +00:00
|
|
|
"--with-libvdwxc"
|
2021-09-18 10:52:07 +00:00
|
|
|
"--enable-openmp"
|
2024-02-07 01:22:34 +00:00
|
|
|
]
|
|
|
|
++ optional enableFma "--enable-fma3"
|
|
|
|
++ optional enableFma4 "--enable-fma4"
|
|
|
|
++ optional enableAvx "--enable-avx"
|
|
|
|
++ optional enableAvx512 "--enable-avx512"
|
|
|
|
++ optionals enableMpi [
|
|
|
|
"--enable-mpi"
|
|
|
|
"--with-scalapack=-lscalapack"
|
|
|
|
"CC=mpicc"
|
|
|
|
"FC=mpif90"
|
|
|
|
];
|
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" ];
|
|
|
|
};
|
|
|
|
}
|