public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 0/2] New x86 CPU flags and a package to use them.
@ 2020-04-02 13:11 Michael Orlitzky
  2020-04-02 13:11 ` [gentoo-dev] [PATCH 1/2] profiles/desc/cpu_flags_x86.desc: add avx512dq and avx512vl Michael Orlitzky
  2020-04-02 13:11 ` [gentoo-dev] [PATCH 2/2] sci-libs/fflas-ffpack: new package for finite-field linear algebra Michael Orlitzky
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Orlitzky @ 2020-04-02 13:11 UTC (permalink / raw
  To: gentoo-dev

Sending to the list because it adds two new global CPU flags, already
supported by cpuid2cpuflags but not listed in the profiles yet.

Michael Orlitzky (2):
  profiles/desc/cpu_flags_x86.desc: add avx512dq and avx512vl.
  sci-libs/fflas-ffpack: new package for finite-field linear algebra.

 profiles/desc/cpu_flags_x86.desc              |  2 +
 sci-libs/fflas-ffpack/Manifest                |  1 +
 .../fflas-ffpack/fflas-ffpack-2.4.3.ebuild    | 62 +++++++++++++
 .../files/fflas-ffpack-2.3.2-blaslapack.patch | 90 +++++++++++++++++++
 sci-libs/fflas-ffpack/metadata.xml            | 37 ++++++++
 5 files changed, 192 insertions(+)
 create mode 100644 sci-libs/fflas-ffpack/Manifest
 create mode 100644 sci-libs/fflas-ffpack/fflas-ffpack-2.4.3.ebuild
 create mode 100644 sci-libs/fflas-ffpack/files/fflas-ffpack-2.3.2-blaslapack.patch
 create mode 100644 sci-libs/fflas-ffpack/metadata.xml

-- 
2.24.1



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 1/2] profiles/desc/cpu_flags_x86.desc: add avx512dq and avx512vl.
  2020-04-02 13:11 [gentoo-dev] [PATCH 0/2] New x86 CPU flags and a package to use them Michael Orlitzky
@ 2020-04-02 13:11 ` Michael Orlitzky
  2020-04-02 13:11 ` [gentoo-dev] [PATCH 2/2] sci-libs/fflas-ffpack: new package for finite-field linear algebra Michael Orlitzky
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2020-04-02 13:11 UTC (permalink / raw
  To: gentoo-dev

These two flags are already supported by cpuid2cpuflags, but so far no
package in ::gentoo uses them. The forthcoming sci-libs/fflas-ffpack
will use them, however, and -- given that they're CPU flags whose names
are fixed -- it seems most sensible to add them globally right away.

Bug: https://bugs.gentoo.org/715678
---
 profiles/desc/cpu_flags_x86.desc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/profiles/desc/cpu_flags_x86.desc b/profiles/desc/cpu_flags_x86.desc
index d891398e7a6..156b677e5a4 100644
--- a/profiles/desc/cpu_flags_x86.desc
+++ b/profiles/desc/cpu_flags_x86.desc
@@ -10,7 +10,9 @@
 aes - Enable support for Intel's AES instruction set (AES-NI)
 avx - Adds support for Advanced Vector Extensions instructions
 avx2 - Adds support for Advanced Vector Extensions 2 instructions
+avx512dq - Use AVX-512 double- and quad-word instructions
 avx512f - Adds support for AVX-512 Foundation instructions
+avx512vl - Use AVX-512 vector-length instructions
 f16c - Adds support for F16C instruction set for converting between half-precision and single-precision floats
 fma3 - Use the Fused Multiply Add 3 instruction set ([fma] in cpuinfo)
 fma4 - Use the Fused Multiply Add 4 instruction set
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] [PATCH 2/2] sci-libs/fflas-ffpack: new package for finite-field linear algebra.
  2020-04-02 13:11 [gentoo-dev] [PATCH 0/2] New x86 CPU flags and a package to use them Michael Orlitzky
  2020-04-02 13:11 ` [gentoo-dev] [PATCH 1/2] profiles/desc/cpu_flags_x86.desc: add avx512dq and avx512vl Michael Orlitzky
@ 2020-04-02 13:11 ` Michael Orlitzky
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Orlitzky @ 2020-04-02 13:11 UTC (permalink / raw
  To: gentoo-dev

This is a straightforward import of the latest fflas-ffpack-2.4.3.ebuild
that François Bissey has been maintaining in the sage-on-gentoo overlay,
with only a few minor changes:

  * I added a "+" to the LICENSE to match the upstream LGPL-2.1+.

  * I switched the openmp check to use tc-check-openmp() conditionally
    on the MERGE_TYPE variable.

  * Added BDEPEND="virtual/pkgconfig" since we patch in a call to
    PKG_CHECK_MODULES.

I also removed a warning about build failures with USE=openmp. From what
I can tell, this stems from an older report (upstream Github issue 48)
using gcc-4.9.x that was never fully debugged. If the problems persist,
we can revisit that report, or just mask the flag.

Closes: https://bugs.gentoo.org/show_bug.cgi?id=715678
Package-Manager: Portage-2.3.89, Repoman-2.3.20
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
---
 sci-libs/fflas-ffpack/Manifest                |  1 +
 .../fflas-ffpack/fflas-ffpack-2.4.3.ebuild    | 62 +++++++++++++
 .../files/fflas-ffpack-2.3.2-blaslapack.patch | 90 +++++++++++++++++++
 sci-libs/fflas-ffpack/metadata.xml            | 37 ++++++++
 4 files changed, 190 insertions(+)
 create mode 100644 sci-libs/fflas-ffpack/Manifest
 create mode 100644 sci-libs/fflas-ffpack/fflas-ffpack-2.4.3.ebuild
 create mode 100644 sci-libs/fflas-ffpack/files/fflas-ffpack-2.3.2-blaslapack.patch
 create mode 100644 sci-libs/fflas-ffpack/metadata.xml

diff --git a/sci-libs/fflas-ffpack/Manifest b/sci-libs/fflas-ffpack/Manifest
new file mode 100644
index 00000000000..d10a12abc35
--- /dev/null
+++ b/sci-libs/fflas-ffpack/Manifest
@@ -0,0 +1 @@
+DIST fflas-ffpack-2.4.3.tar.gz 1059033 BLAKE2B e416429bb426a81cf9c25d54c83380ff9a9d658c711da06e6359d968843d4d9d26cf8389379f9ad4a5cbcee93e0afc9fe0497bb7a8f190e0c72c0b1f7b67de18 SHA512 c7620ba5a92e4114a581a6bea32267f9d5a9f0eb7e23fc0a7a97ce4b8124bb7b29f89ff2ad6ad270d97c76489625b57a354e581905b74ee57b35f4ca3e196a44
diff --git a/sci-libs/fflas-ffpack/fflas-ffpack-2.4.3.ebuild b/sci-libs/fflas-ffpack/fflas-ffpack-2.4.3.ebuild
new file mode 100644
index 00000000000..4115dc61ace
--- /dev/null
+++ b/sci-libs/fflas-ffpack/fflas-ffpack-2.4.3.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Library for dense linear algebra over word-size finite fields"
+HOMEPAGE="https://linbox-team.github.io/fflas-ffpack/"
+SRC_URI="https://github.com/linbox-team/${PN}/releases/download/${PV}/${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="static-libs openmp cpu_flags_x86_fma3 cpu_flags_x86_fma4 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 cpu_flags_x86_sse4_2 cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512f cpu_flags_x86_avx512dq cpu_flags_x86_avx512vl"
+
+# Our autotools patch hacks in PKG_CHECK_MODULES calls.
+BDEPEND="virtual/pkgconfig"
+DEPEND="virtual/cblas
+	virtual/blas
+	virtual/lapack
+	dev-libs/gmp[cxx]
+	=sci-libs/givaro-4.1*"
+RDEPEND="${DEPEND}"
+
+PATCHES=( "${FILESDIR}/${PN}-2.3.2-blaslapack.patch" )
+
+pkg_pretend() {
+	[[ "${MERGE_TYPE}" != "binary" ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup(){
+	tc-export PKG_CONFIG
+}
+
+src_prepare(){
+	default
+	eautoreconf
+}
+
+src_configure() {
+	econf \
+		--enable-precompilation \
+		$(use_enable openmp) \
+		$(use_enable cpu_flags_x86_fma3 fma) \
+		$(use_enable cpu_flags_x86_fma4 fma4) \
+		$(use_enable cpu_flags_x86_sse3 sse3) \
+		$(use_enable cpu_flags_x86_ssse3 ssse3) \
+		$(use_enable cpu_flags_x86_sse4_1 sse41) \
+		$(use_enable cpu_flags_x86_sse4_2 sse42) \
+		$(use_enable cpu_flags_x86_avx avx) \
+		$(use_enable cpu_flags_x86_avx2 avx2) \
+		$(use_enable cpu_flags_x86_avx512f avx512f) \
+		$(use_enable cpu_flags_x86_avx512dq avx512dq) \
+		$(use_enable cpu_flags_x86_avx512vl avx512vl) \
+		$(use_enable static-libs static)
+}
+
+src_install(){
+	default
+	find "${ED}" -name '*.la' -delete || die
+}
diff --git a/sci-libs/fflas-ffpack/files/fflas-ffpack-2.3.2-blaslapack.patch b/sci-libs/fflas-ffpack/files/fflas-ffpack-2.3.2-blaslapack.patch
new file mode 100644
index 00000000000..3154a261819
--- /dev/null
+++ b/sci-libs/fflas-ffpack/files/fflas-ffpack-2.3.2-blaslapack.patch
@@ -0,0 +1,90 @@
+diff --git a/configure.ac b/configure.ac
+index 5b46b18..5e0264a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -248,49 +248,24 @@ dnl echo '**********************************************************************
+ dnl exit 1
+ dnl ])
+ 
+-BLAS_FOUND=false
+-
+-FF_CHECK_BLAS_CFLAGS
+-FF_CHECK_BLAS_LIBS
+-FF_CHECK_MKL
+-FF_CHECK_USER_BLAS
+-FF_CHECK_USER_LAPACK
+-
+-FF_OPENBLAS_NUM_THREADS
+-
+-# FF_CHECK_BLAS
+-
+-# FF_CHECK_GOTOBLAS
+-
+-# FF_CHECK_GSL
+-
+-# if test "$BLAS_FOUND" = "false" ; then
+-	# FF_CHECK_CBLAS
+-# fi
+-
+-# if test "$BLAS_FOUND" = "false" ; then
+-	# FF_CHECK_OTHERBLAS
+-# fi
+-
+-# FF_CHECK_LAPACK
+-
+-# if test "$BLAS_FOUND" = "false" ; then
+-	# FF_CHECK_BLAS2
+-# fi
+-
+-
+-
+-# BLAS_LIBS="${BLAS_LIBS}"
+-# BLAS_LIBS="-L/${BLAS_PATH} ${LAPACK_LIBS} ${BLAS_LIBS}"
+-# AC_SUBST(BLAS_LIBS)
+-
+-# FF_CHECK_CUDA
+-
+-# AM_CONDITIONAL(FFLASFFPACK_HAVE_BLAS,  test "x$BLAS_FOUND" != "xfalse")
+-
+-
+-# FF_BENCH
+-
++PKG_PROG_PKG_CONFIG
++
++PKG_CHECK_MODULES([BLAS], [cblas blas],[
++    AC_DEFINE(HAVE_BLAS,1,[Define if BLAS is installed])
++    AC_DEFINE(HAVE_CBLAS,1,[Define if C interface to BLAS is installed])
++    HAVE_BLAS=yes
++    BLAS_PATH=""
++    CBLAS_LIBS="${BLAS_LIBS}"
++    AC_SUBST(BLAS_LIBS)
++    AC_SUBST(CBLAS_LIBS)
++    AC_SUBST(BLAS_CFLAGS)
++    AC_SUBST(BLAS_PATH)])
++
++PKG_CHECK_MODULES([LAPACK], [lapack],[
++    AC_DEFINE(HAVE_LAPACK,1,[Define if LAPACK is installed])
++    AC_SUBST(LAPACK_LIBS)])
++
++AM_CONDITIONAL(FFLASFFPACK_HAVE_LAPACK,  test "x$HAVE_LAPACK" == "x1")
+ 
+ FF_DOC
+ 
+diff --git a/fflas-ffpack-config.in b/fflas-ffpack-config.in
+index f1dac22..17633a0 100644
+--- a/fflas-ffpack-config.in
++++ b/fflas-ffpack-config.in
+@@ -107,11 +107,11 @@ while test $# -gt 0; do
+ 			;;
+ 
+ 		--libs)
+-			echo @PARLIBS@ @PRECOMPILE_LIBS@ @BLAS_LIBS@ @GIVARO_LIBS@ # @CUDA_LIBS@
++			echo @PARLIBS@ @PRECOMPILE_LIBS@ @LAPACK_LIBS@ @BLAS_LIBS@ @GIVARO_LIBS@ # @CUDA_LIBS@
+ 			;;
+ 
+ 		--blas-libs)
+-			echo  @BLAS_LIBS@
++			echo  @LAPACK_LIBS@ @BLAS_LIBS@
+ 			;;
+ 
+ 		--blas-home)
diff --git a/sci-libs/fflas-ffpack/metadata.xml b/sci-libs/fflas-ffpack/metadata.xml
new file mode 100644
index 00000000000..9de9afc41f1
--- /dev/null
+++ b/sci-libs/fflas-ffpack/metadata.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+  <maintainer type="person">
+    <email>mjo@gentoo.org</email>
+  </maintainer>
+  <!--
+      mjo: François maintained this package in the sage-on-gentoo overlay
+      long before I moved it into ::gentoo. You don't need an ACK from me
+      to merge his changes.
+  -->
+  <maintainer type="person">
+    <email>frp.bissey@gmail.com</email>
+    <name>François Bissey</name>
+  </maintainer>
+  <maintainer type="project">
+    <email>proxy-maint@gentoo.org</email>
+    <name>Proxy Maintainers</name>
+  </maintainer>
+
+  <longdescription lang="en">
+    FFLAS-FFPACK is a library for basic linear algebra operations over
+    a finite field. It is inspired by the BLAS interface (Basic Linear
+    Algebra Subprograms) and the LAPACK library for numerical linear
+    algebra, and shares part of their design. Yet it differs in many
+    aspects due to the specifics of computing over a finite field: it
+    is generic with respect to the finite field, so as to accommodate
+    a large variety of field sizes and implementations; consequently,
+    all routines use C++ template generics and the library is
+    primarily meant to be used as a source code library, to be
+    included and compiled in the user's software.
+  </longdescription>
+
+  <upstream>
+    <remote-id type="github">linbox-team/fflas-ffpack</remote-id>
+  </upstream>
+</pkgmetadata>
-- 
2.24.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-02 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 13:11 [gentoo-dev] [PATCH 0/2] New x86 CPU flags and a package to use them Michael Orlitzky
2020-04-02 13:11 ` [gentoo-dev] [PATCH 1/2] profiles/desc/cpu_flags_x86.desc: add avx512dq and avx512vl Michael Orlitzky
2020-04-02 13:11 ` [gentoo-dev] [PATCH 2/2] sci-libs/fflas-ffpack: new package for finite-field linear algebra Michael Orlitzky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox