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..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@ @@ -37,8 +34,16 @@ default: display-build-env add-git-hooks mana_prereqs all: default -mana: mana_prereqs dmtcp - cd mpi-proxy-split && $(MAKE) install +MANA_SCRIPTS = mana_coordinator mana_launch mana_restart mana_status + +mana: mana_prereqs dmtcp $(MANA_SCRIPTS:%=bin/%) + cd mpi-proxy-split && $(MAKE) stage + +# 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: @@ -61,23 +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) - cd mpi-proxy-split && $(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 mpi-proxy-split && $(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 @@ -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/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 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 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