depot/third_party/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
Default email a3bb8d7922 Project import generated by Copybara.
GitOrigin-RevId: 439b1605227b8adb1357b55ce8529d541abbe9eb
2021-08-06 00:33:18 +03:00

81 lines
1.8 KiB
Nix

{ lib, stdenv, fetchFromGitLab, cmake, gfortran, perl
, openblas, hdf5-cpp, python3, texlive
, armadillo, mpi, globalarrays, openssh
, makeWrapper
} :
let
version = "21.06";
# The tag keeps moving, fix a hash instead
gitLabRev = "dd982ad4bc94dec8ac1e3e99cb6a7dd249ff71de";
python = python3.withPackages (ps : with ps; [ six pyparsing ]);
in stdenv.mkDerivation {
pname = "openmolcas";
inherit version;
src = fetchFromGitLab {
owner = "Molcas";
repo = "OpenMolcas";
rev = gitLabRev;
sha256 = "07dm73n0s7ckif561yb3s9yqxsv39a73kb9qwny4yp39wdvv52hz";
};
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
'';
postInstall = ''
mv $out/pymolcas $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.lgpl21Only;
platforms = [ "x86_64-linux" ];
};
}