From b29428f562c0267de0f340555fa401906da22ad53e8d66ac8e5749e5541f3b18 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 30 Apr 2017 00:27:19 +0000 Subject: [PATCH] - Add pun.diff OBS-URL: https://build.opensuse.org/package/show/science/librsb?expand=0&rev=5 --- librsb.changes | 1 + librsb.spec | 5 ++++- pun.diff | 30 ++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 pun.diff diff --git a/librsb.changes b/librsb.changes index fc3db5f..7620fe0 100644 --- a/librsb.changes +++ b/librsb.changes @@ -7,6 +7,7 @@ Sat Apr 29 23:53:40 UTC 2017 - jengelh@inai.de sparse matrices. * rsb_file_mtx_save and rsb_file_vec_save's output use full-precision. +- Add pun.diff ------------------------------------------------------------------- Thu Oct 20 23:10:35 UTC 2016 - jengelh@inai.de diff --git a/librsb.spec b/librsb.spec index fd9fdc1..c9fefaa 100644 --- a/librsb.spec +++ b/librsb.spec @@ -25,7 +25,9 @@ Summary: Shared memory parallel sparse matrix and sparse BLAS library License: LGPL-3.0+ Group: Productivity/Scientific/Math URL: http://librsb.sf.net/ + Source: http://downloads.sf.net/%name/%name-%rversion.tar.gz +Patch1: pun.diff BuildRequires: fdupes BuildRequires: gcc-fortran BuildRequires: gsl-devel @@ -67,9 +69,10 @@ applications that want to make use of librsb. %prep %setup -qn librsb-%rversion +%patch -P 1 -p1 %build -%configure --docdir="%_docdir/%name" --disable-static +%configure --docdir="%_docdir/%name" --disable-static CFLAGS="%optflags -Wno-unused" make %{?_smp_mflags} %install diff --git a/pun.diff b/pun.diff new file mode 100644 index 0000000..9d80dc1 --- /dev/null +++ b/pun.diff @@ -0,0 +1,30 @@ +From: Jan Engelhardt +Date: 2017-04-30 02:23:53.236493153 +0200 + +Stop punting the types pointers. + +rsb_test_accuracy.c:117:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] + RSB_NUMERICAL_TYPE_SET_ELEMENT_FROM_DOUBLE(eps,RSB_NORMWISE_BACKWARD_ERROR_TOLERANCE,typecode); +--- + rsb_types.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +Index: librsb-1.2.0-rc6/rsb_types.h +=================================================================== +--- librsb-1.2.0-rc6.orig/rsb_types.h ++++ librsb-1.2.0-rc6/rsb_types.h +@@ -375,10 +375,10 @@ extern "C" { + switch(TYPE) \ + { \ + /* supported (double,float,float complex,double complex) */ \ +- case RSB_NUMERICAL_TYPE_DOUBLE : *(double*)(DST)=(double)(DSRC); break; \ +- case RSB_NUMERICAL_TYPE_FLOAT : *(float*)(DST)=(float)(DSRC); break; \ +- case RSB_NUMERICAL_TYPE_FLOAT_COMPLEX : *(float complex*)(DST)=(float complex)(DSRC); break; \ +- case RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX : *(double complex*)(DST)=(double complex)(DSRC); break; \ ++ case RSB_NUMERICAL_TYPE_DOUBLE : { double z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \ ++ case RSB_NUMERICAL_TYPE_FLOAT : { float z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \ ++ case RSB_NUMERICAL_TYPE_FLOAT_COMPLEX : { float complex z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \ ++ case RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX : { double complex z = (DSRC); memcpy(DST, &z, sizeof(z)); break; } \ + /* unsupported type */ \ + default : ; \ + } \