mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-15 09:23:37 +00:00
e0d947c79c
Don't use `with stdenv.lib` at the top of the expression, per: https://nix.dev/anti-patterns/language.html#with-attrset-expression Use rec and version inside `mkDerivation`, like almost any other derivation.
54 lines
1.3 KiB
Nix
54 lines
1.3 KiB
Nix
{ stdenv, fetchFromGitHub, cmake
|
|
, gfortran, blas, lapack, eigen }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "arpack";
|
|
version = "3.7.0";
|
|
|
|
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=${stdenv.lib.optionalString blas.isILP64 "1"}"
|
|
];
|
|
|
|
preCheck = if stdenv.isDarwin then ''
|
|
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib:${blas}/lib:${lapack}/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;
|
|
};
|
|
}
|