blob: a5fbb679df5ba07314303319164f75c50231e6ba (
plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
|
{ stdenv, fetchFromGitHub, cmake
, gfortran, blas, lapack, eigen }:
with stdenv.lib;
let
version = "3.7.0";
in
stdenv.mkDerivation {
pname = "arpack";
inherit version;
src = fetchFromGitHub {
owner = "opencollab";
repo = "arpack-ng";
rev = version;
sha256 = "1x7a1dj3dg43nlpvjlh8jzzbadjyr3mbias6f0256qkmgdyk4izr";
};
nativeBuildInputs = [ cmake ];
buildInputs = [ gfortran blas lapack eigen ];
doCheck = true;
BLAS_LIBS = "-L${blas}/lib -lblas";
LAPACK_LIBS = "-L${lapack}/lib -llapack";
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DINTERFACE64=${optionalString blas.is64bit "1"}"
];
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'' + ''
# Prevent tests from using all cores
export OMP_NUM_THREADS=2
'';
postInstall = ''
mkdir -p $out/lib/pkgconfig
cp arpack.pc $out/lib/pkgconfig/
'';
meta = {
homepage = "https://github.com/opencollab/arpack-ng";
description = ''
A collection of Fortran77 subroutines to solve large scale eigenvalue
problems.
'';
license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.ttuegel ];
platforms = stdenv.lib.platforms.unix;
};
}
|