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