diff --git a/pkgs/applications/science/chemistry/octopus/default.nix b/pkgs/applications/science/chemistry/octopus/default.nix index db08de018804..93fec7149604 100644 --- a/pkgs/applications/science/chemistry/octopus/default.nix +++ b/pkgs/applications/science/chemistry/octopus/default.nix @@ -1,5 +1,23 @@ -{ lib, stdenv, fetchFromGitLab, gfortran, which, perl, procps -, libyaml, libxc, fftw, blas, lapack, gsl, netcdf, arpack, autoreconfHook +{ lib +, stdenv +, fetchFromGitLab +, gfortran +, which +, perl +, procps +, libvdwxc +, libyaml +, libxc +, fftw +, blas +, lapack +, gsl +, netcdf +, arpack +, autoreconfHook +, scalapack +, mpi +, enableMpi ? true , python3 , enableFma ? stdenv.hostPlatform.fmaSupport , enableFma4 ? stdenv.hostPlatform.fma4Support @@ -38,8 +56,12 @@ stdenv.mkDerivation rec { fftw netcdf arpack + libvdwxc (python3.withPackages (ps: [ ps.pyyaml ])) - ]; + ] ++ lib.optional enableMpi scalapack; + + propagatedBuildInputs = lib.optional enableMpi mpi; + propagatedUserEnvPkgs = lib.optional enableMpi mpi; configureFlags = with lib; [ "--with-yaml-prefix=${lib.getDev libyaml}" @@ -48,12 +70,22 @@ stdenv.mkDerivation rec { "--with-fftw-prefix=${lib.getDev fftw}" "--with-gsl-prefix=${lib.getDev gsl}" "--with-libxc-prefix=${lib.getDev libxc}" + "--with-libvdwxc" "--enable-openmp" - ] ++ optional enableFma "--enable-fma3" - ++ optional enableFma4 "--enable-fma4" - ++ optional enableAvx "--enable-avx" - ++ optional enableAvx512 "--enable-avx512"; + ] + ++ 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" + ]; + + nativeCheckInputs = lib.optional.enableMpi mpi; doCheck = false; checkTarget = "check-short"; @@ -67,6 +99,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru = lib.attrsets.optionalAttrs enableMpi { inherit mpi; }; + meta = with lib; { description = "Real-space time dependent density-functional theory code"; homepage = "https://octopus-code.org";