btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / li / linbox / package.nix
blobf9258f9913614d32573ffaa1bb3b10002571fc2b
1 { lib, stdenv
2 , fetchFromGitHub
3 , fetchpatch
4 , autoreconfHook
5 , givaro
6 , pkg-config
7 , blas
8 , lapack
9 , fflas-ffpack
10 , gmpxx
13 assert (!blas.isILP64) && (!lapack.isILP64);
15 stdenv.mkDerivation rec {
16   pname = "linbox";
17   version = "1.7.0";
19   src = fetchFromGitHub {
20     owner = "linbox-team";
21     repo = pname;
22     rev = "v${version}";
23     sha256 = "sha256-mW84a98KPLqcHMjX3LIYTmVe0ngUdz6RJLpoDaAqKU8=";
24   };
26   patches = [
27     (fetchpatch {
28       url = "https://github.com/linbox-team/linbox/commit/4be26e9ef0eaf36a9909e5008940e8bf7dc625b6.patch";
29       sha256 = "PX0Tik7blXOV2vHUq92xMxaADkNoNGiax4qrjQyGK6U=";
30     })
31   ];
33   nativeBuildInputs = [
34     autoreconfHook
35     pkg-config
36   ];
38   buildInputs = [
39     givaro
40     blas
41     gmpxx
42     fflas-ffpack
43   ];
45   configureFlags = [
46     "--with-blas-libs=-lblas"
47     "--without-archnative"
48   ] ++ lib.optionals stdenv.hostPlatform.isx86_64 [
49     # disable SIMD instructions (which are enabled *when available* by default)
50     "--${if stdenv.hostPlatform.sse3Support   then "enable" else "disable"}-sse3"
51     "--${if stdenv.hostPlatform.ssse3Support  then "enable" else "disable"}-ssse3"
52     "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
53     "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
54     "--${if stdenv.hostPlatform.avxSupport    then "enable" else "disable"}-avx"
55     "--${if stdenv.hostPlatform.avx2Support   then "enable" else "disable"}-avx2"
56     "--${if stdenv.hostPlatform.fmaSupport    then "enable" else "disable"}-fma"
57     "--${if stdenv.hostPlatform.fma4Support   then "enable" else "disable"}-fma4"
58   ];
60   # https://github.com/linbox-team/linbox/issues/304
61   hardeningDisable = [ "fortify3" ];
63   doCheck = true;
65   enableParallelBuilding = true;
67   meta = with lib; {
68     description = "C++ library for exact, high-performance linear algebra";
69     mainProgram = "linbox-config";
70     license = licenses.lgpl21Plus;
71     maintainers = teams.sage.members;
72     platforms = platforms.unix;
73     homepage = "https://linalg.org/";
74   };