summaryrefslogtreecommitdiff
path: root/sci-libs/m4ri
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-01-21 18:52:40 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-01-21 18:52:40 +0000
commitf29eb0598f62fc3b5f09f2de5a89c0437c6164d9 (patch)
treee33392cbdd10d91ad30cb2a65130c1fb1e5ca8ac /sci-libs/m4ri
parent032a3dbb5d4ea63ec6c2ceb39c067ea6424b5792 (diff)
gentoo resync : 21.01.2020
Diffstat (limited to 'sci-libs/m4ri')
-rw-r--r--sci-libs/m4ri/Manifest4
-rw-r--r--sci-libs/m4ri/files/m4ri-20200115-libm_underlinking.patch76
-rw-r--r--sci-libs/m4ri/files/m4ri-20200115-memory_violation.patch87
-rw-r--r--sci-libs/m4ri/m4ri-20200115.ebuild57
4 files changed, 224 insertions, 0 deletions
diff --git a/sci-libs/m4ri/Manifest b/sci-libs/m4ri/Manifest
index 78ff938b663b..c4a01cf57623 100644
--- a/sci-libs/m4ri/Manifest
+++ b/sci-libs/m4ri/Manifest
@@ -1,3 +1,7 @@
+AUX m4ri-20200115-libm_underlinking.patch 2352 BLAKE2B 1c391a5d359585e8d6ffb6fa39900b214d20cc089af728a0ece4d521da0b339a31e5e1c19517506602413bf5c2f035fb45c8045459ede2a9ec84d344127f064f SHA512 d95150bab2c2954eea205bc027ec3a018f4267e19224665781273c093c12e35516a741275e3fa658f2076e7dee98d0463ed4ce0cc876def2f48a31039425df83
+AUX m4ri-20200115-memory_violation.patch 2905 BLAKE2B 08cdf9f22307f8477dd6dc5980d496cc56f4a7d625d83db77f1928417a1ba388c6a84c4866276bdad7ec4742b4dc102262e6f90c89a24423494e9877064f39d6 SHA512 70a32c5ec8e4c936b530e85d48d93e6f5d49122df658528c0fd74b3d812d25eef4d9826de3d01127bb717ecbdc20be23079d5805e3d767d225cd1cf24c321fde
DIST m4ri-20140914.tar.gz 457978 BLAKE2B eadba6d1a751cb49cef25cc7726d87aa5746b23ad0a3b9bd274735a71da43ec4751fb655f91f3748f082369875508db365595f8443d77ae9645b3e4199d4f204 SHA512 efdd4ffa194d2d2b64a23a833420926613e74072ce62b2b06d768d157e134a615d88b93ed08d9f51f0fd14d686fd068523d1dc2c7cd9fb87108c96a4a11f4643
+DIST m4ri-20200115.tar.gz 510562 BLAKE2B 4522793ab61dd97dae5c8d82a4457364f437040c9c45c355007a3150bfebb5264e336b19a7416f62b5ef937480f15079d9c0e9711dd26a6f7c6f5ce66d699296 SHA512 4791576878097077bcda768c03a43ec9a5b05c29adaa9c5f1e737e798b3fc7d027f830183d57db7b8b6b75b25e01fb522eb8b2e5359efcb05054fc341cbb403c
EBUILD m4ri-20140914.ebuild 1479 BLAKE2B cec3f194a66b82b09fd29aba43573028bfdbc0341f8e594544570a7a7c7945e7db069427823460421e7b3650bbaf9cf21d3b0ccf2a555f8f19ee42c93e92cf68 SHA512 d74486068c8987d0fca7db524c311b53a87d8c05826cb322fb009f01b0c8f1a4901ef85a4d07887546e43680e81d70fb9f587ac78f7527072fc57c5eb5424a02
+EBUILD m4ri-20200115.ebuild 1341 BLAKE2B 2dcf4b9684e01b53dca95587f2720b41778cb2a7857f5eda68f56e818b876c549925141fdfb8d611cee700e2837afdc5227fb3457d59964652ad1c84d0c49f44 SHA512 21fa9c9b51d8b3379814ac60263a5508d8278863b734e77e8157171719c584745018c58b87d3708d0c03d94cc819afc11d70b2b381e4dffc5bf0d0923037a969
MISC metadata.xml 1159 BLAKE2B 4a51b94a6a8d48e39412d90a249ef2038bcaac90653cbc187226842f33f5a8c75704b2671dc5fc63650cf4a57f77d7724409eca8d5822c7689eda3e5386902da SHA512 40d6e3dce814e11ced9da6874af71022dad66ff1b0511024a9033706f1b43ce741f418086d9beb276e09578db2acc1708758f71cdb168384d59f85627505e643
diff --git a/sci-libs/m4ri/files/m4ri-20200115-libm_underlinking.patch b/sci-libs/m4ri/files/m4ri-20200115-libm_underlinking.patch
new file mode 100644
index 000000000000..8d9d2738c087
--- /dev/null
+++ b/sci-libs/m4ri/files/m4ri-20200115-libm_underlinking.patch
@@ -0,0 +1,76 @@
+From be6c249e7838bd838174db5c2bb98bf63b026b83 Mon Sep 17 00:00:00 2001
+From: François Bissey <frp.bissey@gmail.com>
+Date: Tue, 21 Jan 2020 11:24:50 +1300
+Subject: [PATCH] Detect and use LIBM to link libm4ri in all cases.
+
+---
+ Makefile.am | 2 +-
+ configure.ac | 6 +++++-
+ m4ri.pc.in | 2 +-
+ tests/Makefile.am | 2 +-
+ 4 files changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index e317d06..416d9f1 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -58,7 +58,7 @@ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = m4ri.pc
+
+ libm4ri_la_LDFLAGS = -release 0.0.$(RELEASE) -no-undefined
+-libm4ri_la_LIBADD = $(LIBPNG_LIBADD)
++libm4ri_la_LIBADD = $(LIBPNG_LIBADD) $(LIBM)
+
+ SUBDIRS = . tests
+ DIST_SUBDIRS = $(SUBDIRS) bench
+diff --git a/configure.ac b/configure.ac
+index 39de702..520154d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -15,7 +15,7 @@ AC_CONFIG_MACRO_DIR([m4])
+ dnl Compiling with per-target flags (test_elimination.c) requires AM_PROG_CC_C_O.
+ AM_PROG_CC_C_O
+
+-AC_PROG_LIBTOOL
++LT_INIT
+
+ AC_PROG_INSTALL
+
+@@ -26,6 +26,10 @@ if test "$ac_cv_prog_cc_c99" = "no"; then
+ AC_MSG_ERROR([C99 support is required but not found.])
+ fi
+
++# Find and set LIBM on the platform.
++LT_LIB_M
++AC_SUBST(LIBM)
++
+ # SSE2 support
+ AC_ARG_ENABLE([sse2],
+ AS_HELP_STRING([--disable-sse2], [don't use SSE2 instruction set.]),
+diff --git a/m4ri.pc.in b/m4ri.pc.in
+index 5044de7..07597bd 100644
+--- a/m4ri.pc.in
++++ b/m4ri.pc.in
+@@ -7,5 +7,5 @@ Name: M4RI
+ Description: Dense linear algebra over GF(2).
+ Version: @PACKAGE_VERSION@
+ Requires: @M4RI_USE_PNG_PC@
+-Libs: -L${libdir} -lm4ri @RAW_LIBPNG@ -lm
++Libs: -L${libdir} -lm4ri @RAW_LIBPNG@ @LIBM@
+ Cflags: -I${includedir} @SIMD_CFLAGS@ @OPENMP_CFLAGS@
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index c9839a2..069e360 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -15,7 +15,7 @@ DEFINES =
+ AM_CFLAGS = -I$(TOPSRCDIR) -I$(TOPBUILDDIR) -D_XOPEN_SOURCE=600 $(DEFINES) @OPENMP_CFLAGS@ @PAPI_CFLAGS@
+
+ STAGEDIR := $(realpath -s $(TOPBUILDDIR)/.libs)
+-AM_LDFLAGS = -L$(STAGEDIR) -Wl,-rpath,$(STAGEDIR) -lm4ri -lm @PAPI_LDFLAGS@ @PAPI_LIBS@ -no-install
++AM_LDFLAGS = -L$(STAGEDIR) -Wl,-rpath,$(STAGEDIR) -lm4ri $(LIBM) @PAPI_LDFLAGS@ @PAPI_LIBS@ -no-install
+
+ test_smallops_SOURCES = test_smallops.c testing.c testing.h
+
+--
+2.10.5
+
diff --git a/sci-libs/m4ri/files/m4ri-20200115-memory_violation.patch b/sci-libs/m4ri/files/m4ri-20200115-memory_violation.patch
new file mode 100644
index 000000000000..b74be3b4bf8f
--- /dev/null
+++ b/sci-libs/m4ri/files/m4ri-20200115-memory_violation.patch
@@ -0,0 +1,87 @@
+From e2fb0dcb70a97972fa1576a528cb01458f57a85d Mon Sep 17 00:00:00 2001
+From: "Martin R. Albrecht" <martinralbrecht@googlemail.com>
+Date: Sun, 19 Jan 2020 17:44:57 -0800
+Subject: [PATCH] fix memory violation
+
+fixes #72
+---
+ m4ri/mzd.c | 2 +-
+ tests/test_misc.c | 42 ++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 43 insertions(+), 1 deletion(-)
+
+diff --git a/m4ri/mzd.c b/m4ri/mzd.c
+index 861905c..922dc3c 100644
+--- a/m4ri/mzd.c
++++ b/m4ri/mzd.c
+@@ -1894,7 +1894,7 @@ mzd_t *mzd_submatrix(mzd_t *S, mzd_t const *M, rci_t const startrow, rci_t const
+ } else {
+ wi_t j;
+ for(rci_t i=0; i<nrows; i++) {
+- for(j=0; j+m4ri_radix<=ncols; j+=m4ri_radix)
++ for(j=0; j+m4ri_radix<ncols; j+=m4ri_radix)
+ S->rows[i][j/m4ri_radix] = mzd_read_bits(M, startrow+i, startcol+j, m4ri_radix);
+ S->rows[i][j/m4ri_radix] &= ~S->high_bitmask;
+ S->rows[i][j/m4ri_radix] |= mzd_read_bits(M, startrow+i, startcol+j, ncols - j) & S->high_bitmask;
+diff --git a/tests/test_misc.c b/tests/test_misc.c
+index a9a9547..b1a2e32 100644
+--- a/tests/test_misc.c
++++ b/tests/test_misc.c
+@@ -76,6 +76,31 @@ int test_png(rci_t m, rci_t n) {
+ return ret;
+ }
+
++int test_submatrix(const rci_t m, const rci_t n, const rci_t lowr, const rci_t lowc, const rci_t highr, const rci_t highc) {
++ printf("submatrix: m: %4d, n: %4d, (%4d, %4d, %4d, %4d)", m, n, lowr, lowc, highr, highc);
++ assert(highr-lowr > 0);
++ assert(highc-lowc > 0);
++ mzd_t *M = mzd_init(m, n);
++ mzd_randomize(M);
++ mzd_t *S = mzd_init(highr-lowr, highc-lowc);
++ mzd_submatrix(S, M, lowr, lowc, highr, highc);
++ int ret = 0;
++ for(rci_t i=0; i<highr-lowr; i++) {
++ for(rci_t j=0; j<highc-lowc; j++) {
++ ret += (mzd_read_bit(M, lowr+i, lowc+j) ^ mzd_read_bit(S, i, j));
++ }
++ }
++
++ mzd_free(M);
++ mzd_free(S);
++
++ if(ret==0) {
++ printf(" ... passed\n");
++ } else {
++ printf(" ... FAILED\n");
++ }
++ return ret;
++}
+
+ int main(int argc, char *argv[]) {
+ int status = 0;
+@@ -99,6 +124,23 @@ int main(int argc, char *argv[]) {
+ status += test_png(126,12);
+ status += test_png(128,200);
+
++ status += test_submatrix(2, 127, 1, 1, 2, 127);
++ status += test_submatrix(2, 128, 1, 1, 2, 128);
++ status += test_submatrix(2, 129, 1, 1, 2, 129);
++ status += test_submatrix(2, 130, 1, 1, 2, 130);
++ status += test_submatrix(2, 131, 1, 1, 2, 131);
++
++ status += test_submatrix(2, 63, 1, 1, 1, 63);
++ status += test_submatrix(2, 64, 1, 1, 1, 64);
++ status += test_submatrix(2, 65, 1, 1, 1, 65);
++ status += test_submatrix(2, 66, 1, 1, 1, 66);
++ status += test_submatrix(2, 67, 1, 1, 1, 67);
++
++ status += test_submatrix(2, 127, 1, 63, 2, 127);
++ status += test_submatrix(2, 128, 1, 64, 2, 128);
++ status += test_submatrix(2, 129, 1, 65, 2, 129);
++ status += test_submatrix(2, 130, 1, 66, 2, 130);
++
+ if (!status) {
+ printf("All tests passed.\n");
+ } else {
+--
+2.10.5
+
diff --git a/sci-libs/m4ri/m4ri-20200115.ebuild b/sci-libs/m4ri/m4ri-20200115.ebuild
new file mode 100644
index 000000000000..fd2b189cf387
--- /dev/null
+++ b/sci-libs/m4ri/m4ri-20200115.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools flag-o-matic toolchain-funcs
+
+DESCRIPTION="Method of four russian for inversion (M4RI)"
+HOMEPAGE="https://bitbucket.org/malb/m4ri"
+SRC_URI="https://bitbucket.org/malb/${PN}/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+IUSE="debug openmp cpu_flags_x86_sse2 png static-libs"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="png? ( media-libs/libpng:= )"
+RDEPEND="${DEPEND}"
+
+# NEWS and ChangeLog are empty as of 2020-01-01, and README.md
+# didn't make it into the release tarball.
+DOCS=( AUTHORS )
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-20200115-memory_violation.patch
+ "${FILESDIR}"/${PN}-20200115-libm_underlinking.patch
+)
+
+pkg_pretend() {
+ use openmp && tc-check-openmp
+}
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ # when using openmp and -O0 the testsuite fails
+ # https://github.com/cschwan/sage-on-gentoo/issues/475
+ # Still current as of 20200115
+ use openmp && replace-flags -O0 -O1
+
+ econf \
+ $(use_enable debug) \
+ $(use_enable openmp) \
+ $(use_enable png) \
+ $(use_enable cpu_flags_x86_sse2 sse2) \
+ $(use_enable static-libs static)
+}
+
+src_install(){
+ default
+ find "${ED}" -name '*.la' -delete || die
+}