Skip to content

Commit dbe064a

Browse files
authored
Merge pull request #5653 from bmwiedemann/userhost
Allow to override build user and host
2 parents 5f1d956 + bc8a42a commit dbe064a

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

README

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,15 @@ General notes
193193
using the clang-4.0 system compiler. A workaround is to build
194194
Open MPI using the GNU compiler.
195195

196+
- Open MPI has taken some steps towards Reproducible Builds
197+
(https://reproducible-builds.org/). Specifically, Open MPI's
198+
"configure" and "make" process, by default, records some
199+
system-specific information such as the hostname where Open MPI was
200+
built and the username who built it. If you desire a Reproducible
201+
Build, set the $USER and $HOSTNAME environment variables before
202+
invoking "configure" and "make", and Open MPI will use those values
203+
instead of invoking "whoami" and/or "hostname", respectively.
204+
196205
Platform Notes
197206
--------------
198207

autogen.pl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
$patch_prog = "gpatch";
8585
}
8686

87-
$username = getpwuid($>);
88-
$full_hostname = `hostname`;
87+
$username = $ENV{USER} || getpwuid($>);
88+
$full_hostname = $ENV{HOSTNAME} || `hostname`;
8989
chomp($full_hostname);
9090
$hostname = $full_hostname;
9191
$hostname =~ s/^([\w\-]+)\..+/\1/;
@@ -1190,9 +1190,6 @@ sub in_tarball {
11901190

11911191
#---------------------------------------------------------------------------
11921192

1193-
$full_hostname = `hostname`;
1194-
chomp($full_hostname);
1195-
11961193
$m4 = "dnl
11971194
dnl \$HEADER\$
11981195
dnl

config/opal_functions.m4

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ EOF
9494
# Save some stats about this build
9595
#
9696

97-
OPAL_CONFIGURE_USER="`whoami`"
98-
OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`"
97+
OPAL_CONFIGURE_USER="${USER:-`whoami`}"
98+
OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}"
9999
OPAL_CONFIGURE_DATE="`date`"
100100

101101
OPAL_LIBNL_SANITY_INIT
@@ -116,8 +116,8 @@ AC_DEFUN([OPAL_BASIC_SETUP],[
116116
# Save some stats about this build
117117
#
118118

119-
OPAL_CONFIGURE_USER="`whoami`"
120-
OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`"
119+
OPAL_CONFIGURE_USER="${USER:-`whoami`}"
120+
OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}"
121121
OPAL_CONFIGURE_DATE="`date`"
122122

123123
#

ompi/tools/ompi_info/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ AM_CFLAGS = \
2828
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
2929
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
3030
-DOMPI_BUILD_USER="\"$$USER\"" \
31-
-DOMPI_BUILD_HOST="\"`(hostname || uname -n) 2> /dev/null | sed 1q`\"" \
31+
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
3232
-DOMPI_BUILD_DATE="\"`date`\"" \
3333
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
3434
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \

orte/tools/orte-info/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ AM_CFLAGS = \
2525
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
2626
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
2727
-DOMPI_BUILD_USER="\"$$USER\"" \
28-
-DOMPI_BUILD_HOST="\"`(hostname || uname -n) | sed 1q`\"" \
28+
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) | sed 1q`}\"" \
2929
-DOMPI_BUILD_DATE="\"`date`\"" \
3030
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
3131
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \

oshmem/tools/oshmem_info/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ AM_CPPFLAGS = \
1717
-DOPAL_CONFIGURE_HOST="\"@OPAL_CONFIGURE_HOST@\"" \
1818
-DOPAL_CONFIGURE_DATE="\"@OPAL_CONFIGURE_DATE@\"" \
1919
-DOMPI_BUILD_USER="\"$$USER\"" \
20-
-DOMPI_BUILD_HOST="\"`(hostname || uname -n) 2> /dev/null | sed 1q`\"" \
20+
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
2121
-DOMPI_BUILD_DATE="\"`date`\"" \
2222
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
2323
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \

0 commit comments

Comments
 (0)