From 84637a05693179ed980ef3cc6fe2be1eea12d216 Mon Sep 17 00:00:00 2001 From: edoapra Date: Tue, 13 May 2025 12:47:11 -0700 Subject: [PATCH] cache on disk mpi_lib detection --- src/GNUmakefile | 2 +- src/config/makefile.h | 8 ++++---- src/tools/check_mpi_lib.sh | 10 ++++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100755 src/tools/check_mpi_lib.sh diff --git a/src/GNUmakefile b/src/GNUmakefile index baf6055726..dd08ea437c 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -133,7 +133,7 @@ realclean: -$(RM) $(LIBDIR)/*.a $(BINDIR)/* -$(RM) *.db movecs fort.41 fort.44 -$(RM) util/util_version.F - -$(RM) libmpi.txt mpi_include.txt ga_cppflags.txt ga_ldflags.txt ga_use_scalapack.txt oblas_ompcheck_done.txt peigs_check_done.txt + -$(RM) libmpi.txt mpi_lib.txt mpi_include.txt ga_cppflags.txt ga_ldflags.txt ga_use_scalapack.txt oblas_ompcheck_done.txt peigs_check_done.txt @# -$(RM) 64_to_32 32_to_64 deps_stamp # This conversion is such a hassle that realclean should not force it. .PHONY: cleanF diff --git a/src/config/makefile.h b/src/config/makefile.h index 009dd3f529..8b78b44bac 100644 --- a/src/config/makefile.h +++ b/src/config/makefile.h @@ -214,7 +214,7 @@ else #extract GA libs location from last word in GA_LDLFLAGS LIBPATH := $(word $(words ${GA_LDFLAGS}),${GA_LDFLAGS}) ifdef EXTERNAL_GA_PATH - LIBPATH ::= -L$(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib) + LIBPATH ::= -L$(shell $(NWCHEM_TOP)/src/tools/check_mpi_lib.sh $(NWCHEM_TOP)) endif endif endif @@ -244,7 +244,7 @@ else INCPATH := $(word $(words $(GA_CPPFLAGS)),$(GA_CPPFLAGS)) ifdef EXTERNAL_GA_PATH - INCPATH := $(INCPATH) -I$(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_include) + INCPATH ::= $(INCPATH) -I$(shell $(NWCHEM_TOP)/src/tools/check_mpi_inc.sh $(NWCHEM_TOP)) endif endif endif @@ -3989,8 +3989,8 @@ ifdef USE_MPI endif NWMPI_INCLUDE := $(shell $(NWCHEM_TOP)/src/tools/check_mpi_inc.sh $(NWCHEM_TOP)) - NWMPI_LIB := $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --mpi_lib) - NWLIBMPI := $(shell $(NWCHEM_TOP)/src/tools/guess-mpidefs --libmpi) + NWMPI_LIB := $(shell $(NWCHEM_TOP)/src/tools/check_mpi_lib.sh $(NWCHEM_TOP)) + NWLIBMPI := $(shell $(NWCHEM_TOP)/src/tools/check_libmpi.sh $(NWCHEM_TOP)) endif ifdef NWMPI_INCLUDE diff --git a/src/tools/check_mpi_lib.sh b/src/tools/check_mpi_lib.sh new file mode 100755 index 0000000000..00d9a7157e --- /dev/null +++ b/src/tools/check_mpi_lib.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +if [ $# -eq 0 ] + then + echo "NWCHEM_TOP arg missing" + exit 1 +fi +if [ ! -f $1/src/mpi_lib.txt ]; then + $1/src/tools/guess-mpidefs --mpi_lib > $1/src/mpi_lib.txt +fi +cat $1/src/mpi_lib.txt