64 lines
1.7 KiB
Nix
Raw Permalink Normal View History

2021-03-26 11:45:31 +01:00
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
, gfortran, blas, lapack, eigen }:
2015-06-04 07:17:30 -05:00
stdenv.mkDerivation rec {
2019-08-13 21:52:01 +00:00
pname = "arpack";
2021-03-26 11:45:31 +01:00
version = "3.8.0";
src = fetchFromGitHub {
owner = "opencollab";
repo = "arpack-ng";
rev = version;
2021-03-26 11:45:31 +01:00
sha256 = "sha256-nc710iLRqy/p3EaVgbEoCRzNJ9GpKqqQp33tbn7R6lA=";
2013-12-27 14:14:42 -06:00
};
2021-03-26 11:45:31 +01:00
patches = [
# https://github.com/opencollab/arpack-ng/pull/301
(fetchpatch {
name = "pkg-config-paths.patch";
url = "https://github.com/opencollab/arpack-ng/commit/47fc83cb371a9cc8a8c058097de5e0298cd548f5.patch";
excludes = [ "CHANGES" ];
sha256 = "1aijvrfsxkgzqmkzq2dmaj8q3jdpg2hwlqpfl8ddk9scv17gh9m8";
})
];
nativeBuildInputs = [ cmake ];
buildInputs = assert (blas.isILP64 == lapack.isILP64); [
gfortran
blas
lapack
eigen
];
2014-03-01 18:46:53 -06:00
2018-01-22 15:36:43 -08:00
doCheck = true;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
2021-03-26 11:45:31 +01:00
"-DINTERFACE64=${if blas.isILP64 then "1" else "0"}"
];
2018-01-22 15:36:43 -08:00
2019-04-02 17:13:18 +02:00
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib:${blas}/lib:${lapack}/lib
2019-04-02 17:13:18 +02:00
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
2019-04-02 17:13:18 +02:00
'' + ''
# Prevent tests from using all cores
export OMP_NUM_THREADS=2
2015-12-28 11:44:03 -06:00
'';
postFixup = lib.optionalString stdenv.isDarwin ''
install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libarpack.dylib
'';
2013-12-27 14:14:42 -06:00
meta = {
homepage = "https://github.com/opencollab/arpack-ng";
2014-12-15 11:28:57 -06:00
description = ''
A collection of Fortran77 subroutines to solve large scale eigenvalue
2015-09-16 11:08:39 -05:00
problems.
2014-12-15 11:28:57 -06:00
'';
license = lib.licenses.bsd3;
2021-03-26 11:45:31 +01:00
maintainers = with lib.maintainers; [ ttuegel dotlambda ];
platforms = lib.platforms.unix;
2013-12-27 14:14:42 -06:00
};
}