Skip to content

Commit

Permalink
remove --disable-mpi and go back to already existing --without-mpi op…
Browse files Browse the repository at this point in the history
…tion in configure
  • Loading branch information
pnorbert committed Jul 26, 2016
1 parent 85cc18e commit 6c393e2
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 130 deletions.
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ACLOCAL_AMFLAGS=-I config

SUBDIRS = src utils tests
if BUILD_MPI
if HAVE_MPI
SUBDIRS += examples
endif

Expand Down
3 changes: 2 additions & 1 deletion NEWS
Original file line number Diff line number Diff line change
@@ -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
Expand Down
217 changes: 113 additions & 104 deletions config/acx_mpi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -76,112 +76,121 @@ AC_PREREQ(2.50) dnl for AC_LANG_CASE
AM_CONDITIONAL(HAVE_MPI,true)
AC_ARG_WITH(mpi,
[ --with-mpi=<location of MPI installation>],
[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 <mpi.h>],[],[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 <mpi.h>],[],[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=<location of MPI installation>],
[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 <mpi.h>],[],[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 <mpi.h>],[],[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
18 changes: 6 additions & 12 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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)";
Expand All @@ -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";
Expand Down
1 change: 1 addition & 0 deletions doc/manual/introduction.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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


##########################################
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions utils/adios_list_methods/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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


Loading

0 comments on commit 6c393e2

Please sign in to comment.