nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
Markus Kowalewski 6dba41fbcb
mpi: use mpi attribute consistently as the default MPI implementations
Use the attribute mpi to provide a system wide default MPI
implementation. The default is openmpi (as before).
This now allows for overriding the MPI implentation by using
the overlay mechanism. Build all packages with mpich instead
of the default openmpi can now be achived like this:
self: super:
 {
   mpi = super.mpich;
 }

All derivations that have been using "mpi ? null" to provide optional
building with MPI have been change in the following way to allow for
optional builds with MPI:
{ ...
, mpi
, useMpi ? false
}
2021-01-23 12:15:13 +01:00

77 lines
1.6 KiB
Nix

{ lib, stdenv, fetchFromGitLab, cmake, gfortran, perl
, openblas, hdf5-cpp, python3, texlive
, armadillo, mpi, globalarrays, openssh
, makeWrapper, fetchpatch
} :
let
version = "20.10";
gitLabRev = "v${version}";
python = python3.withPackages (ps : with ps; [ six pyparsing ]);
in stdenv.mkDerivation {
pname = "openmolcas";
inherit version;
src = fetchFromGitLab {
owner = "Molcas";
repo = "OpenMolcas";
rev = gitLabRev;
sha256 = "0xr9plgb0cfmxxqmd3wrhvl0hv2jqqfqzxwzs1jysq2m9cxl314v";
};
patches = [
# Required to handle openblas multiple outputs
./openblasPath.patch
];
nativeBuildInputs = [ perl cmake texlive.combined.scheme-minimal makeWrapper ];
buildInputs = [
gfortran
openblas
hdf5-cpp
python
armadillo
mpi
globalarrays
openssh
];
cmakeFlags = [
"-DOPENMP=ON"
"-DGA=ON"
"-DMPI=ON"
"-DLINALG=OpenBLAS"
"-DTOOLS=ON"
"-DHDF5=ON"
"-DFDE=ON"
"-DOPENBLASROOT=${openblas.dev}"
];
GAROOT=globalarrays;
postConfigure = ''
# The Makefile will install pymolcas during the build grrr.
mkdir -p $out/bin
export PATH=$PATH:$out/bin
'';
postFixup = ''
# Wrong store path in shebang (no Python pkgs), force re-patching
sed -i "1s:/.*:/usr/bin/env python:" $out/bin/pymolcas
patchShebangs $out/bin
wrapProgram $out/bin/pymolcas --set MOLCAS $out
'';
meta = with lib; {
description = "Advanced quantum chemistry software package";
homepage = "https://gitlab.com/Molcas/OpenMolcas";
maintainers = [ maintainers.markuskowa ];
license = licenses.lgpl21;
platforms = [ "x86_64-linux" ];
};
}