nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix

58 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake
, gfortran, openblas, eigen }:
2015-06-04 12:17:30 +00:00
with stdenv.lib;
2013-12-27 20:14:42 +00:00
2014-12-15 17:28:20 +00:00
let
version = "3.7.0";
2013-12-27 20:14:42 +00:00
in
stdenv.mkDerivation {
2019-08-13 21:52:01 +00:00
pname = "arpack";
inherit version;
src = fetchFromGitHub {
owner = "opencollab";
repo = "arpack-ng";
rev = version;
sha256 = "1x7a1dj3dg43nlpvjlh8jzzbadjyr3mbias6f0256qkmgdyk4izr";
2013-12-27 20:14:42 +00:00
};
nativeBuildInputs = [ cmake ];
buildInputs = [ gfortran openblas eigen ];
2014-03-02 00:46:53 +00:00
2018-01-22 23:36:43 +00:00
doCheck = true;
2015-12-28 17:44:03 +00:00
BLAS_LIBS = "-L${openblas}/lib -lopenblas";
2015-06-04 12:17:30 +00:00
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DINTERFACE64=${optionalString openblas.blas64 "1"}"
];
2018-01-22 23:36:43 +00:00
2019-04-02 15:13:18 +00:00
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:`pwd`/lib
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
2019-04-02 15:13:18 +00:00
'' + ''
# Prevent tests from using all cores
export OMP_NUM_THREADS=2
2015-12-28 17:44:03 +00:00
'';
postInstall = ''
mkdir -p $out/lib/pkgconfig
cp arpack.pc $out/lib/pkgconfig/
'';
2013-12-27 20:14:42 +00:00
meta = {
homepage = https://github.com/opencollab/arpack-ng;
2014-12-15 17:28:57 +00:00
description = ''
A collection of Fortran77 subroutines to solve large scale eigenvalue
2015-09-16 16:08:39 +00:00
problems.
2014-12-15 17:28:57 +00:00
'';
2013-12-27 20:14:42 +00:00
license = stdenv.lib.licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.ttuegel ];
platforms = stdenv.lib.platforms.unix;
2013-12-27 20:14:42 +00:00
};
}