Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,19 @@ 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 the build date
and 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 $SOURCE_DATE_EPOCH, $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. See
https://reproducible-builds.org/docs/source-date-epoch/ for
information on the expected format and content of the
$SOURCE_DATE_EPOCH variable.

Platform Notes
--------------

Expand Down
2 changes: 1 addition & 1 deletion autogen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ sub in_tarball {
dnl This file is automatically created by autogen.pl; it should not
dnl be edited by hand!!
dnl
dnl Generated by $username at " . localtime(time) . "
dnl Generated by $username at " . localtime($ENV{SOURCE_DATE_EPOCH} || time) . "
dnl on $full_hostname.
$dnl_line\n\n";

Expand Down
14 changes: 14 additions & 0 deletions config/getdate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh
#
# Copyright (c) 2017 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2020 Cisco Systems, Inc. All rights reserved.

# Provide a way to override build date for reproducible build results
# See https://reproducible-builds.org/ for why this is good.

# There are several different flavors of date(1) out there.
# Try a few different CLI options for date(1) to see which one works.

SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(date +%s)}"
date -u -d "@$SOURCE_DATE_EPOCH" "$@" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" "$@" 2>/dev/null || date -u "$@"
16 changes: 4 additions & 12 deletions config/opal_functions.m4
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2009-2020 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2015-2017 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -94,9 +94,9 @@ EOF
# Save some stats about this build
#

OPAL_CONFIGURE_USER="`whoami`"
OPAL_CONFIGURE_HOST="`(hostname || uname -n) 2> /dev/null | sed 1q`"
OPAL_CONFIGURE_DATE="`date`"
OPAL_CONFIGURE_USER="${USER:-`whoami`}"
OPAL_CONFIGURE_HOST="${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}"
OPAL_CONFIGURE_DATE="`$srcdir/config/getdate.sh`"

OPAL_LIBNL_SANITY_INIT

Expand All @@ -112,14 +112,6 @@ dnl #######################################################################
dnl #######################################################################

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_DATE="`date`"

#
# Make automake clean emacs ~ files for "make clean"
#
Expand Down
4 changes: 2 additions & 2 deletions config/opal_get_version.m4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dnl Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
dnl University of Stuttgart. All rights reserved.
dnl Copyright (c) 2004-2005 The Regents of the University of California.
dnl All rights reserved.
dnl Copyright (c) 2008-2014 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2008-2020 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2014 Intel, Inc. All rights reserved.
dnl Copyright (c) 2014 Research Organization for Information Science
dnl and Technology (RIST). All rights reserved.
Expand Down Expand Up @@ -91,7 +91,7 @@ m4_define([OPAL_GET_VERSION],[
$2_REPO_REV=`git describe --tags --always`
fi
else
$2_REPO_REV="date`date '+%Y-%m-%d'`"
$2_REPO_REV=date`$srcdir/getdate.sh '+%Y-%m-%d'`
fi
fi

Expand Down
24 changes: 21 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,29 @@ AC_DEFUN([OMPI_CHECK_DIR_FOR_SPACES],[
AC_MSG_ERROR([Cannot continue.])])
])

AC_DEFUN([OMPI_CANONICALIZE_PATH],[
case $host_os in
darwin*)
# MacOS does not have "readlink -f" or realpath (at least as
# of MacOS Cataline / 10.15). Instead, use Python, because we
# know MacOS comes with a /usr/bin/python that has
# os.path.realpath.
$2=`/usr/bin/python -c 'import os; print os.path.realpath("'$1'")'`
;;
*)
$2=`readlink -f $1`
;;
esac
])

OMPI_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $srcdir`], [an], [absolute source tree])
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f .`], [a], [build tree])
OMPI_CANONICALIZE_PATH([$srcdir], [ompi_dir])
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [an], [absolute source tree])
OMPI_CANONICALIZE_PATH([.], [ompi_dir])
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [a], [build tree])
OMPI_CHECK_DIR_FOR_SPACES([$prefix], [a], [prefix])
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $prefix`], [an], [absolute prefix])
OMPI_CANONICALIZE_PATH([$prefix], [ompi_dir])
OMPI_CHECK_DIR_FOR_SPACES([$ompi_dir], [an], [absolute prefix])

opal_show_subtitle "Checking versions"

Expand Down
4 changes: 2 additions & 2 deletions ompi/tools/mpisync/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ 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_DATE="\"`date`\"" \
-DOMPI_BUILD_HOST="\"`$${HOSTNAME:-(hostname || uname -n) | sed 1q`\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \
Expand Down
4 changes: 2 additions & 2 deletions ompi/tools/ompi_info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ 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_DATE="\"`date`\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \
Expand Down
4 changes: 2 additions & 2 deletions orte/tools/orte-info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ 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_DATE="\"`date`\"" \
-DOMPI_BUILD_HOST="\"`$${HOSTNAME:-(hostname || uname -n) | sed 1q`\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \
Expand Down
4 changes: 2 additions & 2 deletions oshmem/tools/oshmem_info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ 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_DATE="\"`date`\"" \
-DOMPI_BUILD_HOST="\"$${HOSTNAME:-`(hostname || uname -n) 2> /dev/null | sed 1q`}\"" \
-DOMPI_BUILD_DATE="\"`$(top_srcdir)/config/getdate.sh`\"" \
-DOMPI_BUILD_CFLAGS="\"@CFLAGS@\"" \
-DOMPI_BUILD_CPPFLAGS="\"@CPPFLAGS@\"" \
-DOMPI_BUILD_CXXFLAGS="\"@CXXFLAGS@\"" \
Expand Down