mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-19 03:48:57 +00:00
b2d7f4b1ba
Many (less easily automatically converted) old-style strings remain. Where there was any possible ambiguity about the exact version or variant intended, nothing was changed. IANAL, nor a search robot. Use `with stdenv.lib` wherever it makes sense.
50 lines
1.3 KiB
Nix
50 lines
1.3 KiB
Nix
{ stdenv, fetchurl, gfortran, atlas, cmake, python, shared ? false }:
|
|
let
|
|
atlasMaybeShared = atlas.override { inherit shared; };
|
|
usedLibExtension = if shared then ".so" else ".a";
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
version = "3.5.0";
|
|
name = "liblapack-${version}";
|
|
src = fetchurl {
|
|
url = "http://www.netlib.org/lapack/lapack-${version}.tgz";
|
|
sha256 = "0lk3f97i9imqascnlf6wr5mjpyxqcdj73pgj97dj2mgvyg9z1n4s";
|
|
};
|
|
|
|
propagatedBuildInputs = [ atlasMaybeShared ];
|
|
buildInputs = [ gfortran cmake ];
|
|
nativeBuildInputs = [ python ];
|
|
|
|
cmakeFlags = [
|
|
"-DUSE_OPTIMIZED_BLAS=ON"
|
|
"-DBLAS_ATLAS_f77blas_LIBRARY=${atlasMaybeShared}/lib/libf77blas${usedLibExtension}"
|
|
"-DBLAS_ATLAS_atlas_LIBRARY=${atlasMaybeShared}/lib/libatlas${usedLibExtension}"
|
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
|
]
|
|
++ (stdenv.lib.optional shared "-DBUILD_SHARED_LIBS=ON")
|
|
;
|
|
|
|
doCheck = ! shared;
|
|
|
|
checkPhase = "
|
|
sed -i 's,^#!.*,#!${python}/bin/python,' lapack_testing.py
|
|
ctest
|
|
";
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
passthru = {
|
|
blas = atlas;
|
|
};
|
|
|
|
meta = with stdenv.lib; {
|
|
inherit version;
|
|
description = "Linear Algebra PACKage";
|
|
homepage = "http://www.netlib.org/lapack/";
|
|
license = with licenses; bsd3;
|
|
|
|
platforms = platforms.all;
|
|
maintainers = [ maintainers.simons ];
|
|
};
|
|
}
|