Skip to content

Commit 9e90d68

Browse files
committed
utils: don't require archivemount at configure-time
Just try to use it at runtime or error out. Signed-off-by: Brice Goglin <[email protected]>
1 parent 8864ce0 commit 9e90d68

File tree

3 files changed

+3
-14
lines changed

3 files changed

+3
-14
lines changed

config/hwloc_internal.m4

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
dnl -*- Autoconf -*-
22
dnl
3-
dnl Copyright © 2010-2022 Inria. All rights reserved.
3+
dnl Copyright © 2010-2023 Inria. All rights reserved.
44
dnl Copyright © 2009, 2011 Université Bordeaux
55
dnl Copyright © 2004-2005 The Trustees of Indiana University and Indiana
66
dnl University Research and Technology
@@ -409,12 +409,6 @@ EOF
409409
AC_CHECK_FUNCS([clock_gettime])
410410
])
411411
412-
AC_ARG_VAR([ARCHIVEMOUNT], [Location of the archivemount program (for loading archive topology in tools)])
413-
AC_PATH_TOOL([ARCHIVEMOUNT], [archivemount])
414-
if test "x$ARCHIVEMOUNT" != x; then
415-
AC_DEFINE_UNQUOTED([HWLOC_ARCHIVEMOUNT_PATH], ["$ARCHIVEMOUNT"], [Define to the location of the archivemount program])
416-
fi
417-
418412
# Only generate this if we're building the utilities
419413
# Even the netloc library Makefile is here because
420414
# we don't embed libnetloc yet, it's useless without tools

utils/hwloc/misc.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long f
277277
}
278278

279279
case HWLOC_UTILS_INPUT_ARCHIVE: {
280-
#ifdef HWLOC_ARCHIVEMOUNT_PATH
281280
char mntpath[] = "/tmp/tmpdir.hwloc.archivemount.XXXXXX";
282281
char mntcmd[512];
283282
char umntcmd[512];
@@ -291,7 +290,7 @@ hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long f
291290
perror("Creating archivemount directory");
292291
return EXIT_FAILURE;
293292
}
294-
snprintf(mntcmd, sizeof(mntcmd), "%s -o ro %s %s", HWLOC_ARCHIVEMOUNT_PATH, input, mntpath);
293+
snprintf(mntcmd, sizeof(mntcmd), "archivemount -o ro %s %s", input, mntpath);
295294
err = system(mntcmd);
296295
if (err) {
297296
perror("Archivemount'ing the archive");
@@ -326,10 +325,6 @@ hwloc_utils_enable_input_format(struct hwloc_topology *topology, unsigned long f
326325
if (!err)
327326
*input_format = sub_input_format;
328327
break;
329-
#else
330-
fprintf(stderr, "This installation of hwloc does not support loading from an archive, sorry.\n");
331-
exit(EXIT_FAILURE);
332-
#endif
333328
}
334329

335330
case HWLOC_UTILS_INPUT_SYNTHETIC:

utils/lstopo/test-lstopo.sh.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ echo "**** Import from synthetic so that we can check some exact outputs in $fil
129129
) > "$file"
130130
@DIFF@ @HWLOC_DIFF_U@ @HWLOC_DIFF_W@ $srcdir/test-lstopo.output "$file"
131131

132-
if test x@ARCHIVEMOUNT@ != x; then
132+
if which archivemount >/dev/null 2>/dev/null; then
133133
if test x@HWLOC_HAVE_LINUX@ = x1; then
134134
echo "**** Archivemount'ing a Linux fsroot archive ..."
135135
file="$tmp/test-lstopo.archivemount.fsroot.output"

0 commit comments

Comments
 (0)