Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #29453: use PKG_CHECK_MODULES to find a system fflas-ffpack.
Browse files Browse the repository at this point in the history
We already have an spkg-configure.m4 for fflas-ffpack, but it doesn't
detect the system copy yet. This commit adds a call to PKG_CHECK_MODULES
to find a new(ish) copy on the system that should work for distros who
ship the pkg-config file. I have left the existing processor flags code
more or less alone, noting that it doesn't get executed when the user
passes --without-system-fflas-ffpack to ./configure.
  • Loading branch information
orlitzky committed Apr 2, 2020
1 parent 6a45805 commit 4cada3f
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions build/pkgs/fflas_ffpack/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
SAGE_SPKG_CONFIGURE([fflas_ffpack], [
dnl A check for a system package is not implemented yet.
sage_spkg_install_fflas_ffpack=yes
# fflas-lapack uses whatever multi-precision library givaro uses,
# either gmp or mpir.
SAGE_SPKG_DEPCHECK([atlas givaro gmp mpir openblas], [
# If our dependencies come from the system, then we can use
# the system fflas-ffpack, too. Use pkg-config to find a
# recentish version, if there is one.
PKG_CHECK_MODULES([FFLAS_FFPACK],
[fflas-ffpack >= 2.3.2],
[sage_spkg_install_fflas_ffpack=no],
[sage_spkg_install_fflas_ffpack=yes])
],
[ # Some of its dependencies are installed as SPKGs, so install the
# fflas-ffpack SPKG as well.
sage_spkg_install_fflas_ffpack=yes
])
dnl https://github.com/linbox-team/fflas-ffpack/blob/master/macros/instr_set.m4
dnl discovers these flags from the processor but fails to check whether
dnl compiler (and assembler) actually support these instruction sets.
# Warning: this doesn't get executed with --without-system-fflas-ffpack
AS_IF([test "x$sage_spkg_install_fflas_ffpack" = "xyes"],[
dnl https://github.com/linbox-team/fflas-ffpack/blob/master/macros/instr_set.m4
dnl discovers these flags from the processor but fails to check whether
dnl compiler (and assembler) actually support these instruction sets.
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl -mavx512dq], [], [
AS_VAR_APPEND([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-avx512f --disable-avx512vl --disable-avx512dq"])
])
m4_foreach([ISFLAG], [fma, fma4], [
AX_CHECK_COMPILE_FLAG([-m]ISFLAG, [], [AS_VAR_APPEND]([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-]ISFLAG[ "]))
AX_CHECK_COMPILE_FLAG([-mavx512f -mavx512vl -mavx512dq], [], [
AS_VAR_APPEND([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-avx512f --disable-avx512vl --disable-avx512dq"])
])
m4_foreach([ISFLAG], [fma, fma4], [
AX_CHECK_COMPILE_FLAG([-m]ISFLAG, [], [AS_VAR_APPEND]([SAGE_CONFIGURE_FFLAS_FFPACK], [" --disable-]ISFLAG[ "]))
])
AC_SUBST([SAGE_CONFIGURE_FFLAS_FFPACK])
])
AC_SUBST([SAGE_CONFIGURE_FFLAS_FFPACK])
])

0 comments on commit 4cada3f

Please sign in to comment.