From 1d93f9edb4904ddd539d09d16baeae3f2383b869 Mon Sep 17 00:00:00 2001 From: Yao Xu Date: Tue, 3 Nov 2026 20:48:03 -0500 Subject: [PATCH 1/3] Move the mana_* scripts to scripts/ The four scripts that run MANA, mana_launch, mana_restart, mana_coordinator and mana_status, were tracked in bin/. Everything else in bin/ is build output: DMTCP's programs, which 'make' copies there, and the lower half. So .gitignore needed an exception for the scripts, and 'make distclean' deleted everything in bin/ except files named *mana*. Now the scripts are in scripts/, and 'make' copies them into bin/, where they find DMTCP's programs, the lower half and lib/dmtcp as before. bin/ is all build output: .gitignore ignores it, and 'make distclean' deletes it. test-mana-restart.py tests scripts/mana_restart, so it no longer needs a build. --- .gitignore | 6 ++---- Makefile.in | 13 ++++++++++--- mpi-proxy-split/test/test-mana-restart.py | 2 +- {bin => scripts}/mana_coordinator | 0 {bin => scripts}/mana_launch | 0 {bin => scripts}/mana_restart | 0 {bin => scripts}/mana_status | 0 7 files changed, 13 insertions(+), 8 deletions(-) rename {bin => scripts}/mana_coordinator (100%) rename {bin => scripts}/mana_launch (100%) rename {bin => scripts}/mana_restart (100%) rename {bin => scripts}/mana_status (100%) diff --git a/.gitignore b/.gitignore index 32fff5753..5098bb194 100644 --- a/.gitignore +++ b/.gitignore @@ -8,10 +8,8 @@ /aclocal.m4 /autom4te.cache/ -# Made by make. bin/ also gets DMTCP's programs and the lower half, but the -# mana_* launchers are sources. -/bin/* -!/bin/mana_* +# Made by make. +/bin/ /lib/ /manpages/mana.1.gz *.[oa] diff --git a/Makefile.in b/Makefile.in index c69cb87ca..b939ab4f4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -37,9 +37,17 @@ default: display-build-env add-git-hooks mana_prereqs all: default -mana: mana_prereqs dmtcp +MANA_SCRIPTS = mana_coordinator mana_launch mana_restart mana_status + +mana: mana_prereqs dmtcp $(MANA_SCRIPTS:%=bin/%) cd mpi-proxy-split && $(MAKE) install +# bin/ holds the scripts next to DMTCP's programs and the lower half, which +# the scripts run. +$(MANA_SCRIPTS:%=bin/%): bin/%: scripts/% + @mkdir -p bin + cp -f $< $@ + # The end-to-end tests, the example and the benchmarks. tests: cd mpi-proxy-split && $(MAKE) tests @@ -88,8 +96,7 @@ distclean: clean mpi-proxy-split/mpi-wrappers/Makefile mpi-proxy-split/test/Makefile \ mpi-proxy-split/examples/Makefile rm -rf autom4te.cache - rm -rf $(top_builddir)/lib - - cd $(top_builddir)/bin && find . \! -name '*mana*' -delete + rm -rf $(top_builddir)/lib $(top_builddir)/bin tidy: rm -rf ckpt_rank* diff --git a/mpi-proxy-split/test/test-mana-restart.py b/mpi-proxy-split/test/test-mana-restart.py index b9e92b436..98f2b9252 100644 --- a/mpi-proxy-split/test/test-mana-restart.py +++ b/mpi-proxy-split/test/test-mana-restart.py @@ -9,7 +9,7 @@ ROOT = Path(__file__).resolve().parents[2] WRAPPER = Path(os.environ.get( - "MANA_RESTART_WRAPPER", ROOT / "bin" / "mana_restart")) + "MANA_RESTART_WRAPPER", ROOT / "scripts" / "mana_restart")) class ManaRestartTest(unittest.TestCase): diff --git a/bin/mana_coordinator b/scripts/mana_coordinator similarity index 100% rename from bin/mana_coordinator rename to scripts/mana_coordinator diff --git a/bin/mana_launch b/scripts/mana_launch similarity index 100% rename from bin/mana_launch rename to scripts/mana_launch diff --git a/bin/mana_restart b/scripts/mana_restart similarity index 100% rename from bin/mana_restart rename to scripts/mana_restart diff --git a/bin/mana_status b/scripts/mana_status similarity index 100% rename from bin/mana_status rename to scripts/mana_status From 0f2ebcba9d1b39a9f683d4fff54e9b29d6282b68 Mon Sep 17 00:00:00 2001 From: Yao Xu Date: Tue, 3 Nov 2026 20:48:59 -0500 Subject: [PATCH 2/3] Rename the staging targets to stage In mpi-proxy-split, 'make install' did not install MANA. It copied libmana.so, the stubs and the lower half into the source tree's lib/dmtcp and bin, where MANA's scripts find them, and it ignored prefix and DESTDIR. The top-level 'make install' ran it, and the top-level 'make uninstall' ran an uninstall rule that mpi-proxy-split did not have, so it failed. This copy is now the target 'stage', in mpi-proxy-split, lower-half and mpi-wrappers, and 'make' runs it as before. The top-level 'make install' and 'make uninstall' no longer run it. So 'make install' installs what it installed before, only DMTCP, and the next commit adds MANA. 'make uninstall' no longer fails. --- Makefile.in | 4 +--- mpi-proxy-split/Makefile.in | 24 +++++++++++++----------- mpi-proxy-split/lower-half/Makefile.in | 4 ++-- mpi-proxy-split/mpi-wrappers/Makefile.in | 4 ++-- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Makefile.in b/Makefile.in index b939ab4f4..e29e3a8cd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -40,7 +40,7 @@ all: default MANA_SCRIPTS = mana_coordinator mana_launch mana_restart mana_status mana: mana_prereqs dmtcp $(MANA_SCRIPTS:%=bin/%) - cd mpi-proxy-split && $(MAKE) install + cd mpi-proxy-split && $(MAKE) stage # bin/ holds the scripts next to DMTCP's programs and the lower half, which # the scripts run. @@ -79,12 +79,10 @@ create-dirs: install: all create-dirs cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS) - cd mpi-proxy-split && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS) cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS) uninstall: cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) - cd mpi-proxy-split && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) distclean: clean diff --git a/mpi-proxy-split/Makefile.in b/mpi-proxy-split/Makefile.in index 06c8646af..05703b1da 100644 --- a/mpi-proxy-split/Makefile.in +++ b/mpi-proxy-split/Makefile.in @@ -12,11 +12,11 @@ MPICXX = @MPICXX@ -std=c++20 override CFLAGS += -fno-stack-protector override CXXFLAGS += -fno-stack-protector -# Targets to install: +# Targets to stage: # libmana.so (using mpi-wrappers/libmpiwrappers.a), libmpistub.so, # libmpistub_audit.so -# Subdirectories needed to install +# Subdirectories needed to stage LOWER_HALF_SRCDIR=lower-half WRAPPERS_SRCDIR=mpi-wrappers @@ -45,10 +45,12 @@ override CXXFLAGS += -fPIC -I${DMTCP_INCLUDE} -I${JALIB_INCLUDE} \ # code is in libmpi_cxx.so. override CXXFLAGS += -DOMPI_SKIP_MPICXX -DMPICH_SKIP_MPICXX -# 'make' does what 'make install' does. -default: install +# 'make' builds libmana.so, the stubs and the lower half, and stages them: +# it copies them into ../lib/dmtcp and ../bin, where MANA's scripts find +# them. +default: stage -# ${WRAPPERS_SRCDIR}/libmpiwrappers.a made in install/default before libmana.so +# ${WRAPPERS_SRCDIR}/libmpiwrappers.a made in stage/default before libmana.so # libmana.so needs libmpistub.so (in the same directory once installed): with # Open MPI, it refers to the MPI library's objects (see # generate-mpi-stub-objects.py), and a program that loads the MPI library @@ -85,19 +87,19 @@ ${MANA_ROOT}/lib/dmtcp/libmana.so: libmana.so cp -f $< $@ ${MANA_ROOT}/lib/dmtcp/libmpistub.so: ${WRAPPERS_SRCDIR}/mpi_stub_wrappers.txt \ ${WRAPPERS_SRCDIR}/mpi_stub_data.c - $(MAKE) -C ${WRAPPERS_SRCDIR} install + $(MAKE) -C ${WRAPPERS_SRCDIR} stage ${MANA_ROOT}/lib/dmtcp/libmpistub_audit.so: ${WRAPPERS_SRCDIR}/mpi_stub_audit.c - $(MAKE) -C ${WRAPPERS_SRCDIR} install + $(MAKE) -C ${WRAPPERS_SRCDIR} stage # ${WRAPPERS_SRCDIR}/libmpiwrappers.a ia a prerequisite for libmana.so, # which is a prerequisite for ${MANA_ROOT}/lib/dmtcp/libmana.so -# Always do 'make default' or 'make install' -- not 'make libmana.so' -install: +# Always do 'make' or 'make stage' -- not 'make libmana.so' +stage: $(MAKE) -C ${WRAPPERS_SRCDIR} libmpiwrappers.a libmpistub.so $(MAKE) ${MANA_ROOT}/lib/dmtcp/libmana.so $(MAKE) ${MANA_ROOT}/lib/dmtcp/libmpistub.so $(MAKE) ${MANA_ROOT}/lib/dmtcp/libmpistub_audit.so - $(MAKE) -C ${LOWER_HALF_SRCDIR} install + $(MAKE) -C ${LOWER_HALF_SRCDIR} stage tidy: rm -f *~ .*.swp dmtcp_restart_script*.sh ckpt_*.dmtcp @@ -115,7 +117,7 @@ distclean: clean FORCE: -.PHONY: default clean distclean tidy check tests install +.PHONY: default clean distclean tidy check tests stage # Regenerate this Makefile when Makefile.in or config.status is newer. Makefile: Makefile.in @top_builddir@/config.status diff --git a/mpi-proxy-split/lower-half/Makefile.in b/mpi-proxy-split/lower-half/Makefile.in index 8f27094ed..acbb94f5c 100644 --- a/mpi-proxy-split/lower-half/Makefile.in +++ b/mpi-proxy-split/lower-half/Makefile.in @@ -55,7 +55,7 @@ switch-context.o: switch-context.cpp lower-half: get-symbol-offset.o build-id-debug.o copy-stack.o patch-trampoline.o lh-func-ptr.o mem-wrapper.o switch-context.o lower-half.o mmap-fixed-noreplace.o ${DMTCP_DEPS} ${MPICXX} ${TEXTSEG_ADDR_FLAG} ${CXXFLAGS} -o $@ $^ -lpthread -ldl -latomic -install: lower-half +stage: lower-half cp -f $^ ${MANA_ROOT}/bin/ tidy: @@ -70,7 +70,7 @@ clean: tidy distclean: clean -.PHONY: default clean distclean install +.PHONY: default clean distclean stage # Regenerate this Makefile when Makefile.in or config.status is newer. Makefile: Makefile.in @top_builddir@/config.status diff --git a/mpi-proxy-split/mpi-wrappers/Makefile.in b/mpi-proxy-split/mpi-wrappers/Makefile.in index b97cf05f6..4725dadf3 100644 --- a/mpi-proxy-split/mpi-wrappers/Makefile.in +++ b/mpi-proxy-split/mpi-wrappers/Makefile.in @@ -110,7 +110,7 @@ tidy: rm -rf ckpt_rank_* rm -f dmtcp_coordinator_db-*.json -install: libmpistub.so libmpistub_audit.so +stage: libmpistub.so libmpistub_audit.so cp -f libmpistub.so libmpistub_audit.so ${MANA_ROOT}/lib/dmtcp/ clean: tidy @@ -126,7 +126,7 @@ clean: tidy distclean: clean -.PHONY: default clean distclean tidy install +.PHONY: default clean distclean tidy stage # Regenerate this Makefile when Makefile.in or config.status is newer. Makefile: Makefile.in @top_builddir@/config.status From ee27cef8ffe7ac76caef0174a6a7012bef280b9e Mon Sep 17 00:00:00 2001 From: Yao Xu Date: Tue, 3 Nov 2026 20:52:47 -0500 Subject: [PATCH 3/3] Install MANA with 'make install' 'make install' installed only DMTCP. The man page was not installed either: manpages/Makefile did not define INSTALL, so make ran "$(INSTALL) -d" as "-d", which make read as an ignored error, and it defined neither datarootdir nor exec_prefix, so mandir lost its prefix. Also, the install created a directory named lib/@PACKAGE@, because @PACKAGE@ is not a configure value. Now 'make install' also installs MANA's scripts and the lower half into bindir, libmana.so and the two stubs into libdir/dmtcp, where DMTCP installs its plugins, and mana.1 into mandir. It honors prefix and DESTDIR. MANA's scripts find the other files from their own directory, so an installed MANA runs as the source tree's does, if bindir and libdir are configure's defaults. The README says how to install. 'make uninstall' removes these files, in the reverse order of 'make install', and then runs DMTCP's uninstall. It quotes each path, so a space in a directory name cannot split a path into the names of other files. --- Makefile.in | 30 ++++++++++++++++-------------- README.md | 10 ++++++++++ manpages/Makefile.in | 7 ++++++- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/Makefile.in b/Makefile.in index e29e3a8cd..00780747b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -14,13 +14,10 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ prefix=@prefix@ exec_prefix=@exec_prefix@ -datarootdir=@datarootdir@ bindir=@bindir@ libdir=@libdir@ -pkglibdir = @libdir@/@PACKAGE@ -docdir=@docdir@ -includedir=@includedir@ -mandir=@mandir@ +# DMTCP installs its plugins here too. +pkglibdir = $(libdir)/dmtcp top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ @@ -69,21 +66,26 @@ dmtcp: dmtcp/configure cp -rf ${DMTCP_ROOT}/bin . cp -rf ${DMTCP_ROOT}/lib . -create-dirs: - $(INSTALL) -d $(DESTDIR)$(bindir) - $(INSTALL) -d $(DESTDIR)$(libdir) - $(INSTALL) -d $(DESTDIR)$(pkglibdir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL) -d $(DESTDIR)$(docdir) - $(INSTALL) -d $(DESTDIR)$(mandir)/man1 +# MANA's scripts find the lower half, DMTCP's programs and MANA's libraries +# from their own directory: in it and in ../lib/dmtcp. So MANA works when +# bindir and libdir are configure's defaults, PREFIX/bin and PREFIX/lib. +MANA_LIBS = libmana.so libmpistub.so libmpistub_audit.so -install: all create-dirs +install: all cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS) + $(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(pkglibdir) + $(INSTALL_SCRIPT) $(MANA_SCRIPTS:%=scripts/%) $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) bin/lower-half $(DESTDIR)$(bindir) + $(INSTALL_PROGRAM) $(MANA_LIBS:%=lib/dmtcp/%) $(DESTDIR)$(pkglibdir) cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(INSTALL_FLAGS) +# In the reverse order of 'install'. Quote each path: a space in it must +# not split it into other files' names. uninstall: - cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) cd manpages && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) + for f in $(MANA_SCRIPTS) lower-half; do rm -f "$(DESTDIR)$(bindir)/$$f"; done + for f in $(MANA_LIBS); do rm -f "$(DESTDIR)$(pkglibdir)/$$f"; done + cd ${DMTCP_ROOT} && $(MAKE) DESTDIR=$(DESTDIR) $(UNINSTALL_FLAGS) distclean: clean - cd ${DMTCP_ROOT} && $(MAKE) distclean diff --git a/README.md b/README.md index 75dbed545..6e0890c18 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,16 @@ uses (the `dmtcp` submodule). A later `git pull` can change that commit without changing `dmtcp/`; `make` then warns, and `git submodule update` checks out the new commit. +`make` puts MANA in the source tree's `bin` and `lib/dmtcp`. To install it, +with DMTCP, into another directory, give that directory to `./configure`: + + ./configure --prefix=$HOME/mana-install + make -j8 + make install # 'make uninstall' removes it + +MANA's scripts find its other files from their own directory, so keep the +default `--bindir` and `--libdir` (`PREFIX/bin` and `PREFIX/lib`). + On Debian and Ubuntu, also install the package libc6-dbg: MANA needs the symbols of the dynamic loader, which these distributions strip. diff --git a/manpages/Makefile.in b/manpages/Makefile.in index d5d220279..e01660b77 100644 --- a/manpages/Makefile.in +++ b/manpages/Makefile.in @@ -1,5 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ mandir=@mandir@ PANDOC=@PANDOC@ +INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MANPAGES = mana.1.gz @@ -20,8 +24,9 @@ install: ${MANPAGES} $(INSTALL) -d $(DESTDIR)$(mandir)/man1 ${INSTALL_DATA} ${MANPAGES} $(DESTDIR)$(mandir)/man1 +# Quote each path: a space in it must not split it into other files' names. uninstall: - cd $(DESTDIR)$(mandir)/man1 && rm -f ${MANPAGES} + for f in $(MANPAGES); do rm -f "$(DESTDIR)$(mandir)/man1/$$f"; done clean: rm -f *.1.gz