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

58 lines
1.3 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitHub, cmake
, gfortran, openblas, eigen }:
2015-06-04 13:17:30 +01: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 22:52:01 +01: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 13:17:30 +01:00
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DINTERFACE64=${optionalString openblas.blas64 "1"}"
];
2018-01-22 23:36:43 +00:00
2019-04-02 16:13:18 +01:00
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib
2019-04-02 16:13:18 +01:00
'' else ''
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
2019-04-02 16:13:18 +01: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 17:08:39 +01: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
};
}