From 6c393e2665147dbc7480009d37c5ba4458410682 Mon Sep 17 00:00:00 2001 From: Norbert Podhorszki Date: Tue, 26 Jul 2016 17:23:46 -0400 Subject: [PATCH] remove --disable-mpi and go back to already existing --without-mpi option in configure --- Makefile.am | 2 +- NEWS | 3 +- config/acx_mpi.m4 | 217 ++++++++++++++------------- configure.ac | 18 +-- doc/manual/introduction.tex | 1 + src/Makefile.am | 10 +- tests/Makefile.am | 4 +- utils/Makefile.am | 4 +- utils/adios_list_methods/Makefile.am | 4 +- utils/skel/Makefile.am | 2 +- 10 files changed, 135 insertions(+), 130 deletions(-) diff --git a/Makefile.am b/Makefile.am index d259b2dac..38bb0c9f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ACLOCAL_AMFLAGS=-I config SUBDIRS = src utils tests -if BUILD_MPI +if HAVE_MPI SUBDIRS += examples endif diff --git a/NEWS b/NEWS index aff69cadd..af13359ec 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,9 @@ -... +1.10.0 Release July 2016 - Fortran API for inquiring selections - bprecover utility - recover a BP file which has a damaged index data - adios_group_size() optional now + - --without-mpi option in configure to build only the sequential libraries - Python/Numpy wrapper improvements: - Support both python 2 and python 3 - Read options with point and block selection diff --git a/config/acx_mpi.m4 b/config/acx_mpi.m4 index 191d0b800..d974834d4 100644 --- a/config/acx_mpi.m4 +++ b/config/acx_mpi.m4 @@ -76,112 +76,121 @@ AC_PREREQ(2.50) dnl for AC_LANG_CASE AM_CONDITIONAL(HAVE_MPI,true) -AC_ARG_WITH(mpi, - [ --with-mpi=], - [MPI_DIR=$withval]) +dnl If --without-mpi was given set HAVE_MPI to false and do nothing more +dnl Or if nothing was given, by default we don't try to find it anymore +if test "x$with_mpi" == "xno"; then -AC_LANG_CASE([C], [ - AC_REQUIRE([AC_PROG_CC]) - AC_ARG_VAR(MPICC,[MPI C compiler command]) - AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC) - acx_mpi_save_CC="$CC" - CC="$MPICC" - AC_SUBST(MPICC) -], -[C++], [ - AC_REQUIRE([AC_PROG_CXX]) - AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) - AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX) - acx_mpi_save_CXX="$CXX" - CXX="$MPICXX" - AC_SUBST(MPICXX) -], -[Fortran 77], [ - AC_REQUIRE([AC_PROG_F77]) - AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command]) - AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77) - acx_mpi_save_F77="$F77" - F77="$MPIF77" - AC_SUBST(MPIF77) -], -[Fortran], [ - AC_REQUIRE([AC_PROG_FC]) - AC_ARG_VAR(MPIFC,[MPI Fortran compiler command]) - AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC) - acx_mpi_save_FC="$FC" - FC="$MPIFC" - AC_SUBST(MPIFC) -]) + AM_CONDITIONAL(HAVE_MPI,false) -if test x = x"$MPILIBS"; then - AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], - [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], - [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " - AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])], - [Fortran], [AC_MSG_CHECKING([for MPI_Init]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " - AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) -fi -AC_LANG_CASE([Fortran 77], [ - if test x = x"$MPILIBS"; then - AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) - fi - if test x = x"$MPILIBS"; then - AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"]) - fi -], -[Fortran], [ - if test x = x"$MPILIBS"; then - AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) - fi - if test x = x"$MPILIBS"; then - AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"]) - fi -]) -if test x = x"$MPILIBS"; then - AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"]) -fi -if test x = x"$MPILIBS"; then - AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) -fi - -dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the -dnl latter uses $CPP, not $CC (which may be mpicc). -AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpi.h]) - AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) -fi], -[C++], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpi.h]) - AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) -fi], -[Fortran 77], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpif.h]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) -fi], -[Fortran], [if test x != x"$MPILIBS"; then - AC_MSG_CHECKING([for mpif.h]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" - AC_MSG_RESULT(no)]) -fi]) - -AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], - [C++], [CXX="$acx_mpi_save_CXX"], - [Fortran 77], [F77="$acx_mpi_save_F77"], - [Fortran], [FC="$acx_mpi_save_FC"]) - -AC_SUBST(MPILIBS) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x = x"$MPILIBS"; then - $2 - : else - ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) - : + + AC_ARG_WITH(mpi, + [ --with-mpi=], + [MPI_DIR=$withval]) + + AC_LANG_CASE([C], [ + AC_REQUIRE([AC_PROG_CC]) + AC_ARG_VAR(MPICC,[MPI C compiler command]) + AC_CHECK_PROGS(MPICC, mpicc hcc mpxlc_r mpxlc mpcc cmpicc, $CC) + acx_mpi_save_CC="$CC" + CC="$MPICC" + AC_SUBST(MPICC) + ], + [C++], [ + AC_REQUIRE([AC_PROG_CXX]) + AC_ARG_VAR(MPICXX,[MPI C++ compiler command]) + AC_CHECK_PROGS(MPICXX, mpic++ mpicxx mpiCC hcp mpxlC_r mpxlC mpCC cmpic++, $CXX) + acx_mpi_save_CXX="$CXX" + CXX="$MPICXX" + AC_SUBST(MPICXX) + ], + [Fortran 77], [ + AC_REQUIRE([AC_PROG_F77]) + AC_ARG_VAR(MPIF77,[MPI Fortran 77 compiler command]) + AC_CHECK_PROGS(MPIF77, mpif77 hf77 mpxlf_r mpxlf mpf77 cmpifc, $F77) + acx_mpi_save_F77="$F77" + F77="$MPIF77" + AC_SUBST(MPIF77) + ], + [Fortran], [ + AC_REQUIRE([AC_PROG_FC]) + AC_ARG_VAR(MPIFC,[MPI Fortran compiler command]) + AC_CHECK_PROGS(MPIFC, mpif90 mpxlf95_r mpxlf90_r mpxlf95 mpxlf90 mpf90 cmpif90c, $FC) + acx_mpi_save_FC="$FC" + FC="$MPIFC" + AC_SUBST(MPIFC) + ]) + + if test x = x"$MPILIBS"; then + AC_LANG_CASE([C], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], + [C++], [AC_CHECK_FUNC(MPI_Init, [MPILIBS=" "])], + [Fortran 77], [AC_MSG_CHECKING([for MPI_Init]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])], + [Fortran], [AC_MSG_CHECKING([for MPI_Init]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[ call MPI_Init])],[MPILIBS=" " + AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)])]) + fi + AC_LANG_CASE([Fortran 77], [ + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) + fi + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpich, MPI_Init, [MPILIBS="-lfmpich"]) + fi + ], + [Fortran], [ + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(fmpi, MPI_Init, [MPILIBS="-lfmpi"]) + fi + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpichf90, MPI_Init, [MPILIBS="-lmpichf90"]) + fi + ]) + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpi, MPI_Init, [MPILIBS="-lmpi"]) + fi + if test x = x"$MPILIBS"; then + AC_CHECK_LIB(mpich, MPI_Init, [MPILIBS="-lmpich"]) + fi + + dnl We have to use AC_TRY_COMPILE and not AC_CHECK_HEADER because the + dnl latter uses $CPP, not $CC (which may be mpicc). + AC_LANG_CASE([C], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpi.h]) + AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) + fi], + [C++], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpi.h]) + AC_TRY_COMPILE([#include ],[],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) + fi], + [Fortran 77], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpif.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) + fi], + [Fortran], [if test x != x"$MPILIBS"; then + AC_MSG_CHECKING([for mpif.h]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[ include 'mpif.h'])],[AC_MSG_RESULT(yes)], [MPILIBS="" + AC_MSG_RESULT(no)]) + fi]) + + AC_LANG_CASE([C], [CC="$acx_mpi_save_CC"], + [C++], [CXX="$acx_mpi_save_CXX"], + [Fortran 77], [F77="$acx_mpi_save_F77"], + [Fortran], [FC="$acx_mpi_save_FC"]) + + AC_SUBST(MPILIBS) + + # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: + if test x = x"$MPILIBS"; then + $2 + : + else + ifelse([$1],,[AC_DEFINE(HAVE_MPI,1,[Define if you have the MPI library.])],[$1]) + : + fi fi ])dnl ACX_MPI diff --git a/configure.ac b/configure.ac index d5dc4defd..2a5f61144 100644 --- a/configure.ac +++ b/configure.ac @@ -21,18 +21,12 @@ AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX -AC_ARG_ENABLE(mpi, - [AS_HELP_STRING([--disable-mpi],[disable building the parallel libraries.])]) -AM_CONDITIONAL([BUILD_MPI], [test "x$enable_mpi" != "xno"]) - -if test "x$enable_mpi" != "xno"; then - AC_LANG(C) - ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for C])]) - +AC_LANG(C) +ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for C])]) +if test -z "${HAVE_MPI_TRUE}"; then AC_LANG(C++) ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for C++])]) else - AM_CONDITIONAL(HAVE_MPI,false) AC_DEFINE(HAVE_MPI,0,[Don not have MPI to build parallel libraries]) fi @@ -49,7 +43,7 @@ if test "x$enable_fortran" != "xno"; then F77=$FC dnl AC_PROG_F77 dnl AC_PROG_F77_C_O - if test "x$enable_mpi" != "xno"; then + if test -z "${HAVE_MPI_TRUE}"; then AC_LANG(Fortran) ACX_MPI([], [AC_MSG_ERROR([could not find mpi library for Fortran])]) fi @@ -929,7 +923,7 @@ if test -z "${BUILD_FORTRAN_TRUE}"; then else echo " - Build only the C libraries (no Fortran)"; fi -if test -z "${BUILD_MPI_TRUE}"; then +if test -z "${HAVE_MPI_TRUE}"; then echo " - Build both the parallel and sequential libraries"; else echo " - Build only the sequential libraries (no MPI)"; @@ -946,7 +940,7 @@ echo " - FCFLAGS = $FCFLAGS"; echo " - LDLAGS = $LDFLAGS"; echo " - LIBS = $LIBS"; echo -if test -z "${BUILD_MPI_TRUE}"; then +if test -z "${HAVE_MPI_TRUE}"; then echo " - MPICC = $MPICC"; echo " - MPICXX = $MPICXX"; echo " - MPIFC = $MPIFC"; diff --git a/doc/manual/introduction.tex b/doc/manual/introduction.tex index 0ea4e2787..394752822 100644 --- a/doc/manual/introduction.tex +++ b/doc/manual/introduction.tex @@ -93,6 +93,7 @@ \section{Other Interesting Features of ADIOS} \item ADIOS builds without first installing Mini-XML separately \item \verb+bprecover+ utility to recover datasets with many output steps where a step becomes corrupted \item Point selections can provide a container selection to improve read performance +\item Added --without-mpi option to configure, so that only the sequential libraries are built \item Adios Python wrapper \begin{itemize} \item Updated to support both python 2 and python 3 diff --git a/src/Makefile.am b/src/Makefile.am index 49e6a4e78..d1bc1649e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -390,7 +390,7 @@ endif BUILD_FORTRAN # Rules to build Parallel C+Fortran write libraries # -if BUILD_MPI +if HAVE_MPI # # Parallel C Write library @@ -471,7 +471,7 @@ endif BUILD_FORTRAN endif !RESEARCH_TRANSPORTS # End of building Parallel Write libs -endif BUILD_MPI +endif HAVE_MPI # End of building all Write libs endif BUILD_WRITE @@ -589,7 +589,7 @@ endif BUILD_FORTRAN # Rules to build Parallel C+Fortran write libraries # -if BUILD_MPI +if HAVE_MPI # # Parallel C Read library @@ -698,7 +698,7 @@ CLEANFILES += adios_read_mod.mod adios_defs_mod.mod adios_query_mod.mod endif BUILD_FORTRAN # End of building parallel read libraries -endif BUILD_MPI +endif HAVE_MPI ########################################## @@ -731,7 +731,7 @@ libadios_internal_nompi_a_CPPFLAGS = $(AM_CPPFLAGS) $(MACRODEFFLAG)_INTERNAL $(A #Note: $(MACRODEFFLAG)NOMPI chokes IBM's bgxlf compiler but it can pass $(MACRODEFFLAG)_NOMPI. -if BUILD_MPI +if HAVE_MPI override CC=$(MPICC) override CXX=$(MPICXX) endif diff --git a/tests/Makefile.am b/tests/Makefile.am index 8bd138e0d..07bc7c377 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,11 +1,11 @@ SUBDIRS=test_src SUITEDIR=suite if BUILD_WRITE -if BUILD_MPI +if HAVE_MPI SUBDIRS += C bp_read if BUILD_FORTRAN SUBDIRS += Fortran genarray endif BUILD_FORTRAN SUBDIRS += ${SUITEDIR} -endif BUILD_MPI +endif HAVE_MPI endif BUILD_WRITE diff --git a/utils/Makefile.am b/utils/Makefile.am index a25b07dbd..735d7a29c 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -3,12 +3,12 @@ SUBDIRS= gpp bpdump bp2ascii bpsplit bpls skeldump adios_list_methods bpmeta bpr if BUILD_WRITE SUBDIRS += adios_lint -if BUILD_MPI +if HAVE_MPI SUBDIRS += bp2bp bpdiff if HAVE_FASTBIT SUBDIRS +=fastbit endif HAVE_FASTBIT -endif BUILD_MPI +endif HAVE_MPI endif BUILD_WRITE if HAVE_HDF5 diff --git a/utils/adios_list_methods/Makefile.am b/utils/adios_list_methods/Makefile.am index 13172cb07..266e12592 100644 --- a/utils/adios_list_methods/Makefile.am +++ b/utils/adios_list_methods/Makefile.am @@ -23,7 +23,7 @@ endif BUILD_WRITE # # Executables for the parallel libraries # -if BUILD_MPI +if HAVE_MPI bin_PROGRAMS += adios_list_methods_readonly adios_list_methods_readonly_SOURCES = adios_list_methods.c adios_list_methods_readonly_CPPFLAGS = $(AM_CPPFLAGS) $(ADIOSREADLIB_CPPFLAGS) $(ADIOSREADLIB_CFLAGS) @@ -39,6 +39,6 @@ adios_list_methods_LDADD = $(top_builddir)/src/libadios.a $(ADIOSLIB_LDADD) endif BUILD_WRITE override CC=$(MPICC) override CXX=$(MPICXX) -endif BUILD_MPI +endif HAVE_MPI diff --git a/utils/skel/Makefile.am b/utils/skel/Makefile.am index f1792d08a..d9b99d4f6 100644 --- a/utils/skel/Makefile.am +++ b/utils/skel/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = etc -if BUILD_MPI +if HAVE_MPI SUBDIRS += etc endif