diff --git a/README b/README index a591dd019f4..5f9f691e453 100644 --- a/README +++ b/README @@ -140,6 +140,15 @@ General notes using the clang-4.0 system compiler. A workaround is to build Open MPI using the GNU compiler. +- Open MPI has taken some steps towards Reproducible Builds + (https://reproducible-builds.org/). Specifically, Open MPI's + "configure" and "make" process, by default, records some + system-specific information such as the hostname where Open MPI was + built and the username who built it. If you desire a Reproducible + Build, set the $USER and $HOSTNAME environment variables before + invoking "configure" and "make", and Open MPI will use those values + instead of invoking "whoami" and/or "hostname", respectively. + Platform Notes -------------- diff --git a/autogen.pl b/autogen.pl index 33e9f9d7af1..f6913c849f4 100755 --- a/autogen.pl +++ b/autogen.pl @@ -84,8 +84,8 @@ $patch_prog = "gpatch"; } -$username = getpwuid($>); -$full_hostname = `hostname`; +$username = $ENV{USER} || getpwuid($>); +$full_hostname = $ENV{HOSTNAME} || `hostname`; chomp($full_hostname); $hostname = $full_hostname; $hostname =~ s/^([\w\-]+)\..+/\1/; @@ -1190,9 +1190,6 @@ sub in_tarball { #--------------------------------------------------------------------------- -$full_hostname = `hostname`; -chomp($full_hostname); - $m4 = "dnl dnl \$HEADER\$ dnl diff --git a/config/opal_functions.m4 b/config/opal_functions.m4 index 7a85dbf8766..dca7519ca5c 100644 --- a/config/opal_functions.m4 +++ b/config/opal_functions.m4 @@ -94,8 +94,8 @@ EOF # Save some stats about this build # -OPAL_CONFIGURE_USER="`whoami`" -OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`" +OPAL_CONFIGURE_USER="${USER:-`whoami`}" +OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}" OPAL_CONFIGURE_DATE="`date`" OPAL_LIBNL_SANITY_INIT @@ -116,8 +116,8 @@ AC_DEFUN([OPAL_BASIC_SETUP],[ # Save some stats about this build # -OPAL_CONFIGURE_USER="`whoami`" -OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`" +OPAL_CONFIGURE_USER="${USER:-`whoami`}" +OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}" OPAL_CONFIGURE_DATE="`date`" # diff --git a/ompi/tools/ompi_info/Makefile.am b/ompi/tools/ompi_info/Makefile.am index 296d8ba283a..cfe81bcc8a4 100644 --- a/ompi/tools/ompi_info/Makefile.am +++ b/ompi/tools/ompi_info/Makefile.am @@ -28,7 +28,7 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"`(hostname || uname -n) 2> /dev/null | sed 1q`\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`date`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ diff --git a/orte/tools/orte-info/Makefile.am b/orte/tools/orte-info/Makefile.am index d1e68728401..b90dd922638 100644 --- a/orte/tools/orte-info/Makefile.am +++ b/orte/tools/orte-info/Makefile.am @@ -25,7 +25,7 @@ AM_CFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"`(hostname || uname -n) | sed 1q`\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`date`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \ diff --git a/oshmem/tools/oshmem_info/Makefile.am b/oshmem/tools/oshmem_info/Makefile.am index a474eaf51d0..59573737b7c 100644 --- a/oshmem/tools/oshmem_info/Makefile.am +++ b/oshmem/tools/oshmem_info/Makefile.am @@ -17,7 +17,7 @@ AM_CPPFLAGS = \ -DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \ -DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \ -DOMPI_BUILD_USER="\"$$USER\"" \ - -DOMPI_BUILD_HOST="\"`(hostname || uname -n) 2> /dev/null | sed 1q`\"" \ + -DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \ -DOMPI_BUILD_DATE="\"`date`\"" \ -DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \ -DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \