diff --git a/configure.ac b/configure.ac index 1507025ddf..6955d6bfd7 100644 --- a/configure.ac +++ b/configure.ac @@ -315,6 +315,30 @@ AC_DEFINE_UNQUOTED(LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX, $LAM_ALIGNMENT_FORTRAN_DBLCOMPLEX, [Size of fortran double complex]) +# +# There are 2 layers to the MPI f77 layer. The only extra thing +# that determine f77 bindings is that fortran can be disabled by +# user. In such cases, we need to not build the target at all. +# One layer generates MPI_f77* bindings. The other layer +# generates PMPI_f77* bindings. The following conditions +# determine whether each (or both) these layers are +# built. +# Superceeding clause: +# - fortran77 bindings should be enabled, else everything is +# disabled +# 1. MPI_f77* bindings are needed if: +# - Profiling is not required +# - Profiling is required but weak symbols are not +# supported +# 2. PMPI_* bindings are needed if profiling is required. +# Hence we define 2 AM_CONDITIONALs which tell us whether +# each of these layers need to be built or NOT +# +AM_CONDITIONAL(WANT_MPI_F77_BINDINGS_LAYER, + test "$WANT_MPI_PROFILING" = 0 -o "$LAM_PROFILING_COMPILE_SEPARATELY" = 1 -a "$LAM_WANT_F77_BINDINGS" = 1) + +AM_CONDITIONAL(WANT_PMPI_F77_BINDINGS_LAYER, + test "$LAM_WANT_F77_BINDINGS" = 1 -a "$WANT_MPI_PROFILING" = 1) # # Fortran 90 setup diff --git a/src/mpi/f77/Makefile.am b/src/mpi/f77/Makefile.am index c22852b43a..d8d17785b4 100644 --- a/src/mpi/f77/Makefile.am +++ b/src/mpi/f77/Makefile.am @@ -19,19 +19,25 @@ AM_CPPFLAGS = -DLAM_PROFILE_LAYER=0 # 1. When profiling is disabled. # 2. When profiling is enabled but weak symbol support is absent. # -if WANT_MPI_BINDINGS_LAYER +if WANT_MPI_F77_BINDINGS_LAYER mpi_lib = libmpi_f77_mpi.la else mpi_lib = endif -noinst_LTLIBRARIES = libmpi_f77.la $(mpi_lib) +if LAM_WANT_F77_BINDINGS + install_libs = libmpi_f77.la $(mpi_lib) +else + install_libs = +endif + +noinst_LTLIBRARIES = $(install_libs) # # The profile subdirectory always builds PMPI_* bindings. Hence, this # directory needs to be built whenever profiling is enabled # -if WANT_PMPI_BINDINGS_LAYER +if WANT_PMPI_F77_BINDINGS_LAYER pmpi_lib = profile/libmpi_f77_pmpi.la else pmpi_lib =