2021-02-05 17:12:51 +00:00
{ lib , stdenv , fetchFromGitHub , autoreconfHook , givaro , pkg-config , blas , lapack
2020-04-24 23:36:52 +00:00
, gmpxx
} :
assert ( ! blas . isILP64 ) && ( ! lapack . isILP64 ) ;
stdenv . mkDerivation rec {
pname = " f f l a s - f f p a c k " ;
2022-02-10 20:34:41 +00:00
version = " 2 . 5 . 0 " ;
2020-04-24 23:36:52 +00:00
src = fetchFromGitHub {
owner = " l i n b o x - t e a m " ;
repo = pname ;
2022-02-10 20:34:41 +00:00
rev = " v ${ version } " ;
sha256 = " s h a 2 5 6 - E z t c 2 j U y K R V U i Z k Y E h + I F H k D u P I y + G x 3 Z W / M s u O V a M c = " ;
2020-04-24 23:36:52 +00:00
} ;
checkInputs = [
gmpxx
] ;
enableParallelBuilding = true ;
nativeBuildInputs = [
autoreconfHook
2021-02-05 17:12:51 +00:00
pkg-config
] ++ lib . optionals doCheck checkInputs ;
2020-04-24 23:36:52 +00:00
buildInputs = [ givaro blas lapack ] ;
configureFlags = [
" - - w i t h - b l a s - l i b s = - l c b l a s "
" - - w i t h - l a p a c k - l i b s = - l l a p a c k e "
2021-02-05 17:12:51 +00:00
] ++ lib . optionals stdenv . isx86_64 [
2020-04-24 23:36:52 +00:00
# disable SIMD instructions (which are enabled *when available* by default)
# for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284)
2020-09-25 04:45:31 +00:00
" - - ${ if stdenv . hostPlatform . sse3Support then " e n a b l e " else " d i s a b l e " } - s s e 3 "
" - - ${ if stdenv . hostPlatform . ssse3Support then " e n a b l e " else " d i s a b l e " } - s s s e 3 "
" - - ${ if stdenv . hostPlatform . sse4_1Support then " e n a b l e " else " d i s a b l e " } - s s e 4 1 "
" - - ${ if stdenv . hostPlatform . sse4_2Support then " e n a b l e " else " d i s a b l e " } - s s e 4 2 "
" - - ${ if stdenv . hostPlatform . avxSupport then " e n a b l e " else " d i s a b l e " } - a v x "
" - - ${ if stdenv . hostPlatform . avx2Support then " e n a b l e " else " d i s a b l e " } - a v x 2 "
" - - ${ if stdenv . hostPlatform . avx512Support then " e n a b l e " else " d i s a b l e " } - a v x 5 1 2 f "
" - - ${ if stdenv . hostPlatform . avx512Support then " e n a b l e " else " d i s a b l e " } - a v x 5 1 2 d q "
" - - ${ if stdenv . hostPlatform . avx512Support then " e n a b l e " else " d i s a b l e " } - a v x 5 1 2 v l "
" - - ${ if stdenv . hostPlatform . fmaSupport then " e n a b l e " else " d i s a b l e " } - f m a "
" - - ${ if stdenv . hostPlatform . fma4Support then " e n a b l e " else " d i s a b l e " } - f m a 4 "
] ;
2020-04-24 23:36:52 +00:00
doCheck = true ;
2021-02-05 17:12:51 +00:00
meta = with lib ; {
2022-06-16 17:23:12 +00:00
broken = stdenv . isDarwin ;
2021-01-17 00:15:33 +00:00
description = " F i n i t e F i e l d L i n e a r A l g e b r a S u b r o u t i n e s " ;
2020-04-24 23:36:52 +00:00
license = licenses . lgpl21Plus ;
2020-11-21 19:51:51 +00:00
maintainers = teams . sage . members ;
2020-04-24 23:36:52 +00:00
platforms = platforms . unix ;
homepage = " h t t p s : / / l i n b o x - t e a m . g i t h u b . i o / f f l a s - f f p a c k / " ;
} ;
}