Accepting request 622196 from home:bmwiedemann:branches:science

Add reproducible.patch and set an explicit memory hierarchy to make build reproducible (boo#1100677)

note: needs testing

OBS-URL: https://build.opensuse.org/request/show/622196
OBS-URL: https://build.opensuse.org/package/show/science/librsb?expand=0&rev=9
This commit is contained in:
Jan Engelhardt 2018-07-14 10:57:37 +00:00 committed by Git OBS Bridge
parent 6a9ea624a3
commit d296541dca
3 changed files with 49 additions and 1 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Jul 12 05:02:16 UTC 2018 - bwiedemann@suse.com
- Add reproducible.patch and set an explicit memory hierarchy
to make build reproducible (boo#1100677)
-------------------------------------------------------------------
Tue Dec 26 14:10:41 UTC 2017 - jengelh@inai.de

View File

@ -28,6 +28,7 @@ Url: http://librsb.sf.net/
Source: http://downloads.sf.net/%name/%name-%rversion.tar.gz
Patch1: pun.diff
Patch2: reproducible.patch
BuildRequires: fdupes
BuildRequires: gcc-fortran
BuildRequires: gsl-devel
@ -70,9 +71,11 @@ applications that want to make use of librsb.
%prep
%setup -qn librsb-%rversion
%patch -P 1 -p1
%patch2 -p1
%build
%configure --docdir="%_docdir/%name" --disable-static CFLAGS="%optflags -Wno-unused"
%configure --docdir="%_docdir/%name" --disable-static CFLAGS="%optflags -Wno-unused" \
--with-memhinfo=L3:16/64/8192K,L2:16/64/2048K,L1:8/64/16K
make %{?_smp_mflags}
%install

39
reproducible.patch Normal file
View File

@ -0,0 +1,39 @@
Author: Bernhard M. Wiedemann <bwiedemann suse de>
Date: 2018-07-12
When setting an explicit memory hierarchy at configure time,
the autodetected one will never be used, so we do not need to store it.
This allows for building identical librsb packages on different hosts.
See https://reproducible-builds.org/ for why this is good.
Index: librsb-1.2.0-rc7/configure
===================================================================
--- librsb-1.2.0-rc7.orig/configure
+++ librsb-1.2.0-rc7/configure
@@ -22750,9 +22750,11 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
+if test "x$memhinfo" = x; then
cat >>confdefs.h <<_ACEOF
#define RSB_DETECTED_MEM_HIERARCHY_INFO "$RSB_DETECTED_MEM_HIERARCHY_INFO"
_ACEOF
+fi
cat >>confdefs.h <<_ACEOF
Index: librsb-1.2.0-rc7/configure.ac
===================================================================
--- librsb-1.2.0-rc7.orig/configure.ac
+++ librsb-1.2.0-rc7/configure.ac
@@ -319,7 +319,9 @@ dnl
AC_ARG_WITH(memhinfo, AC_HELP_STRING([--with-memhinfo], [Compile with user specified memory hierarchy information, which can be overridden by runtime detection and runtime read of RSB_USER_SET_MEM_HIERARCHY_INFO environment variable.]),
[if test "x$withval" = xno; then memhinfo="" ; openmp_flags= ; else memhinfo="$withval" ; fi] , [memhinfo="";])
AC_SUBST([RSB_USER_SET_MEM_HIERARCHY_INFO],"${memhinfo}")
+if test "x$memhinfo" = x; then
AC_SUBST([RSB_DETECTED_MEM_HIERARCHY_INFO],"${detected_memhinfo}")
+fi
dnl AC_DEFINE([RSB_USER_SET_MEM_HIERARCHY_INFO],[$memhinfo],[If not null, the library will rely on this for memory hierarchy info.])
dnl
dnl