Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / linbox / default.nix
blob6367b93b1a213fb8861fb1679658fb991b28814e
1 { lib, stdenv
2 , fetchFromGitHub
3 , autoreconfHook
4 , givaro
5 , pkg-config
6 , blas
7 , lapack
8 , fflas-ffpack
9 , gmpxx
10 , withSage ? false # sage support
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   nativeBuildInputs = [
27     autoreconfHook
28     pkg-config
29   ];
31   buildInputs = [
32     givaro
33     blas
34     gmpxx
35     fflas-ffpack
36   ];
38   configureFlags = [
39     "--with-blas-libs=-lblas"
40     "--disable-optimization"
41   ] ++ lib.optionals stdenv.isx86_64 [
42     # disable SIMD instructions (which are enabled *when available* by default)
43     "--${if stdenv.hostPlatform.sse3Support   then "enable" else "disable"}-sse3"
44     "--${if stdenv.hostPlatform.ssse3Support  then "enable" else "disable"}-ssse3"
45     "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
46     "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
47     "--${if stdenv.hostPlatform.avxSupport    then "enable" else "disable"}-avx"
48     "--${if stdenv.hostPlatform.avx2Support   then "enable" else "disable"}-avx2"
49     "--${if stdenv.hostPlatform.fmaSupport    then "enable" else "disable"}-fma"
50     "--${if stdenv.hostPlatform.fma4Support   then "enable" else "disable"}-fma4"
51   ] ++ lib.optionals withSage [
52     "--enable-sage"
53   ];
55   # https://github.com/linbox-team/linbox/issues/304
56   hardeningDisable = [ "fortify3" ];
58   doCheck = true;
60   enableParallelBuilding = true;
62   meta = with lib; {
63     description = "C++ library for exact, high-performance linear algebra";
64     license = licenses.lgpl21Plus;
65     maintainers = teams.sage.members;
66     platforms = platforms.unix;
67     homepage = "https://linalg.org/";
68   };