summary refs log tree commit diff
path: root/pkgs/development/libraries/science/math/liblapack/default.nix
blob: a7d01e22d96225a617f59f916d205ce075110219 (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
44
45
{
  stdenv,
  fetchFromGitHub,
  gfortran,
  cmake,
  python2,
  shared ? false
}:
let
  inherit (stdenv.lib) optional;
  version = "3.9.0";
in

stdenv.mkDerivation {
  pname = "liblapack";
  inherit version;

  src = fetchFromGitHub {
    owner = "Reference-LAPACK";
    repo = "lapack";
    rev = "v${version}";
    sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
  };

  buildInputs = [ gfortran ];
  nativeBuildInputs = [ python2 cmake ];

  cmakeFlags = [
    "-DCMAKE_Fortran_FLAGS=-fPIC"
    "-DLAPACKE=ON"
  ]
  ++ (optional shared "-DBUILD_SHARED_LIBS=ON");

  doCheck = ! shared;

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    inherit version;
    description = "Linear Algebra PACKage";
    homepage = http://www.netlib.org/lapack/;
    license = licenses.bsd3;
    platforms = platforms.all;
  };
}