summary refs log tree commit diff
path: root/pkgs/applications/science/chemistry/mopac/default.nix
blob: c0cdc4eff41060e618c5c4f46e90d1ad2de58d7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{ stdenv
, lib
, gfortran
, fetchFromGitHub
, cmake
, blas
, lapack
, python3Packages
}:

assert blas.isILP64 == lapack.isILP64;

stdenv.mkDerivation rec {
  pname = "mopac";
  version = "22.1.0";

  src = fetchFromGitHub {
    owner = "openmopac";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-4jQ0WCHK07CXWUPj5Z1zSXObKxnitMj+FJQbLDiS2Dc=";
  };

  nativeBuildInputs = [ gfortran cmake ];

  buildInputs = [ blas lapack ];

  checkInputs = with python3Packages; [ python numpy ];

  doCheck = true;

  preCheck = ''
    export OMP_NUM_THREADS=2
  '';

  meta = with lib; {
    description = "Semiempirical quantum chemistry";
    homepage = "https://github.com/openmopac/mopac";
    license = licenses.lgpl3Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ sheepforce markuskowa ];
  };
}