Skip to content

Commit 8841b12

Browse files
committed
configure: abort if dirs with spaces are used
Abort early if the source directory, build directory, or prefix contains spaces (either the supplied directory, or the canonicalized version of the directory). This prevents users from getting cryptic errors later in configure and/or make. Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
1 parent 8f13c3b commit 8841b12

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

configure.ac

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ AM_SILENT_RULES([yes])
117117
# Make configure depend on the VERSION file, since it's used in AC_INIT
118118
AC_SUBST([CONFIGURE_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
119119

120+
# Sanity checks
121+
AC_DEFUN([OMPI_CHECK_DIR_FOR_SPACES],[
122+
dir="$1"
123+
article="$2"
124+
label="$3"
125+
126+
AC_MSG_CHECKING([directory of $label])
127+
AC_MSG_RESULT([$dir])
128+
AS_IF([test -n "`echo $dir | grep ' '`"],
129+
[AC_MSG_WARN([This version of Open MPI does not support $article $label])
130+
AC_MSG_WARN([with a path that contains spaces])
131+
AC_MSG_ERROR([Cannot continue.])])
132+
])
133+
134+
OMPI_CHECK_DIR_FOR_SPACES([$srcdir], [a], [source tree])
135+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $srcdir`], [an], [absolute source tree])
136+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f .`], [a], [build tree])
137+
OMPI_CHECK_DIR_FOR_SPACES([$prefix], [a], [prefix])
138+
OMPI_CHECK_DIR_FOR_SPACES([`readlink -f $prefix`], [an], [absolute prefix])
139+
120140
opal_show_subtitle "Checking versions"
121141

122142
# Get the version of OMPI that we are installing

0 commit comments

Comments
 (0)