summary refs log tree commit diff
path: root/pkgs/development/libraries/science/math/arpack/default.nix
blob: 71f9ef2a2b6b4dd9e0837880a9704f03787e6d62 (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
{ stdenv, fetchurl, gfortran, openblas }:

let version = "3.1.5";
in
stdenv.mkDerivation {
  name = "arpack-${version}";
  src = fetchurl {
    url = "http://forge.scilab.org/index.php/p/arpack-ng/downloads/get/arpack-ng_${version}.tar.gz";
    sha256 = "05fmg4m0yri47rzgsl2mnr1qbzrs7qyd557p3v9wwxxw0rwcwsd2";
  };

  buildInputs = [ gfortran ];
  propagatedBuildInputs = [ openblas ];

  preConfigure = ''
    substituteInPlace arpack.pc.in \
      --replace "@BLAS_LIBS@" "-L${openblas}/lib @BLAS_LIBS@"
  '';

  # Auto-detection fails because gfortran brings in BLAS by default
  configureFlags="--with-blas=-lopenblas --with-lapack=-lopenblas";

  meta = {
    homepage = "http://forge.scilab.org/index.php/p/arpack-ng/";
    description = "A collection of Fortran77 subroutines to solve large scale eigenvalue problems";
    # Looks like OpenBLAS is not that easy to build
    # there is a sgemm_itcopy undefined reference on 32-bit, for example
    platforms = ["x86_64-linux"];
    license = stdenv.lib.licenses.bsd3;
    maintainers = [ stdenv.lib.maintainers.ttuegel ];
  };
}