Skip to content

Commit ed5533f

Browse files
author
Release Manager
committed
Trac #29453: Detect and use the system fflas-ffpack
This package already has an spkg-configure.m4 file and some distro information, but we can't yet detect and use the system copy. Here's hoping everyone ships the pkg-config file. URL: https://trac.sagemath.org/29453 Reported by: mjo Ticket author(s): Michael Orlitzky Reviewer(s): Matthias Koeppe
2 parents c68ef6d + bdac4ba commit ed5533f

File tree

5 files changed

+34
-12
lines changed

5 files changed

+34
-12
lines changed
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fflas-ffpack
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fflas-ffpack
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sci-libs/fflas-ffpack
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fflas-ffpack
+30-12
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
SAGE_SPKG_CONFIGURE([fflas_ffpack], [
2-
dnl A check for a system package is not implemented yet.
3-
sage_spkg_install_fflas_ffpack=yes
4-
5-
dnl https://github.com/linbox-team/fflas-ffpack/blob/master/macros/instr_set.m4
6-
dnl discovers these flags from the processor but fails to check whether
7-
dnl compiler (and assembler) actually support these instruction sets.
8-
9-
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl -mavx512dq], [], [
10-
AS_VAR_APPEND([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-avx512f --disable-avx512vl --disable-avx512dq"])
2+
# fflas-lapack uses whatever multi-precision library givaro uses,
3+
# either gmp or mpir.
4+
SAGE_SPKG_DEPCHECK([atlas givaro gmp mpir openblas], [
5+
# If our dependencies come from the system, then we can use
6+
# the system fflas-ffpack, too. Use pkg-config to find a
7+
# recentish version, if there is one.
8+
PKG_CHECK_MODULES([FFLAS_FFPACK],
9+
[fflas-ffpack >= 2.4.0],
10+
[sage_spkg_install_fflas_ffpack=no],
11+
[sage_spkg_install_fflas_ffpack=yes])
12+
],
13+
[ # Some of its dependencies are installed as SPKGs, so install the
14+
# fflas-ffpack SPKG as well.
15+
sage_spkg_install_fflas_ffpack=yes
1116
])
12-
m4_foreach([ISFLAG], [fma, fma4], [
13-
AX_CHECK_COMPILE_FLAG([-m]ISFLAG, [], [AS_VAR_APPEND]([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-]ISFLAG[ "]))
17+
],[],[],[
18+
# Run this AFTER the check above, unconditionally, so that in particular
19+
# it gets run if the user passes --without-system-fflas-ffpack to the
20+
# ./configure script.
21+
AS_IF([test "x$sage_spkg_install_fflas_ffpack" = "xyes"],[
22+
dnl https://github.com/linbox-team/fflas-ffpack/blob/master/macros/instr_set.m4
23+
dnl discovers these flags from the processor but fails to check whether
24+
dnl compiler (and assembler) actually support these instruction sets.
25+
26+
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl -mavx512dq], [], [
27+
AS_VAR_APPEND([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-avx512f --disable-avx512vl --disable-avx512dq"])
28+
])
29+
m4_foreach([ISFLAG], [fma, fma4], [
30+
AX_CHECK_COMPILE_FLAG([-m]ISFLAG, [], [AS_VAR_APPEND]([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-]ISFLAG[ "]))
31+
])
32+
AC_SUBST([SAGE_CONFIGURE_FFLAS_FFPACK])
1433
])
15-
AC_SUBST([SAGE_CONFIGURE_FFLAS_FFPACK])
1634
])

0 commit comments

Comments
 (0)