Skip to content

Commit

Permalink
Makefile: fix abi build using romio
Browse files Browse the repository at this point in the history
We no longer have any convenience libraries that need go into libmpi.so
when libpmpi.so is also built. Thus, the legacy mpi_convenience_libs
variable is no longer in use. However, we need differentiate libromio
from the other convenience libraries for the ABI build. ROMIO depends on
MPI, thus will need separate version for ABI and non-ABI build. Thus, we
create two variables -- mpi_convenience_libs and abi_convenience_libs.
Note: the former reuses the name but now with different meanings.
  • Loading branch information
hzhou committed Dec 5, 2024
1 parent f24624b commit 35655c4
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,20 @@ errnames_txt_files =
external_subdirs = @mplsrcdir@ @hwlocsrcdir@ @jsonsrcdir@ @yaksasrcdir@ @pmisrcdir@
external_ldflags = @mpllibdir@ @yaksalibdir@
external_libs = @WRAPPER_LIBS@
mpi_convenience_libs =

# convenience libs that do not depend on MPI
pmpi_convenience_libs = @mpllib@ @hwloclib@ @jsonlib@ @yaksalib@ @pmilib@

# convenience libs that depend on MPI (either MPI functions or MPI constants)
mpi_convenience_libs =
abi_convenience_libs =

if BUILD_ROMIO
external_subdirs += src/mpi/romio
pmpi_convenience_libs += src/mpi/romio/libromio.la
mpi_convenience_libs += src/mpi/romio/libromio.la
if BUILD_ABI_LIB
abi_convenience_libs += src/mpi/romio/libromio_abi.la
endif
endif

# NOTE on our semi-unconventional usage of DIST_SUBDIRS:
Expand Down Expand Up @@ -129,8 +137,8 @@ if BUILD_PROFILING_LIB
lib_LTLIBRARIES += lib/lib@PMPILIBNAME@.la
lib_lib@PMPILIBNAME@_la_SOURCES = $(mpi_sources) $(mpi_core_sources)
lib_lib@PMPILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
lib_lib@PMPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs)
EXTRA_lib_lib@PMPILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs)
lib_lib@PMPILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(mpi_convenience_libs)
EXTRA_lib_lib@PMPILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(mpi_convenience_libs)

# lib@MPILIBNAME@.la might depend on lib@PMPILIBNAME@.la. We add them
# in that order to lib_LTLIBRARIES so libtool doesn't get
Expand All @@ -139,7 +147,7 @@ lib_LTLIBRARIES += lib/lib@MPILIBNAME@.la
lib_lib@MPILIBNAME@_la_SOURCES = $(mpi_sources)
lib_lib@MPILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
lib_lib@MPILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPICH_MPI_FROM_PMPI
lib_lib@MPILIBNAME@_la_LIBADD = lib/lib@PMPILIBNAME@.la $(mpi_convenience_libs)
lib_lib@MPILIBNAME@_la_LIBADD = lib/lib@PMPILIBNAME@.la

else !BUILD_PROFILING_LIB

Expand All @@ -161,8 +169,8 @@ lib_LTLIBRARIES += lib/lib@PMPIABILIBNAME@.la
lib_lib@PMPIABILIBNAME@_la_SOURCES = $(mpi_abi_sources) $(mpi_f77_sources) $(mpi_core_sources)
lib_lib@PMPIABILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
lib_lib@PMPIABILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DF77_USE_PMPI $(abi_cppflags)
lib_lib@PMPIABILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs)
EXTRA_lib_lib@PMPIABILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs)
lib_lib@PMPIABILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(abi_convenience_libs)
EXTRA_lib_lib@PMPIABILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(abi_convenience_libs)

# lib@MPIABILIBNAME@.la might depend on lib@PMPIABILIBNAME@.la. We add them
# in that order to lib_LTLIBRARIES so libtool doesn't get
Expand All @@ -171,16 +179,16 @@ lib_LTLIBRARIES += lib/lib@MPIABILIBNAME@.la
lib_lib@MPIABILIBNAME@_la_SOURCES = $(mpi_abi_sources)
lib_lib@MPIABILIBNAME@_la_LDFLAGS = $(ABIVERSIONFLAGS)
lib_lib@MPIABILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) -DMPICH_MPI_FROM_PMPI $(abi_cppflags)
lib_lib@MPIABILIBNAME@_la_LIBADD = lib/lib@PMPIABILIBNAME@.la $(mpi_convenience_libs)
lib_lib@MPIABILIBNAME@_la_LIBADD = lib/lib@PMPIABILIBNAME@.la

else !BUILD_PROFILING_LIB

lib_LTLIBRARIES += lib/lib@MPIABILIBNAME@.la
lib_lib@MPIABILIBNAME@_la_SOURCES = $(mpi_abi_sources) $(mpi_core_sources)
lib_lib@MPIABILIBNAME@_la_LDFLAGS = $(external_ldflags) $(ABIVERSIONFLAGS)
lib_lib@MPIABILIBNAME@_la_CPPFLAGS = $(AM_CPPFLAGS) $(abi_cppflags)
lib_lib@MPIABILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(mpi_convenience_libs)
EXTRA_lib_lib@MPIABILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(mpi_convenience_libs)
lib_lib@MPIABILIBNAME@_la_LIBADD = $(external_libs) $(pmpi_convenience_libs) $(abi_convenience_libs)
EXTRA_lib_lib@MPIABILIBNAME@_la_DEPENDENCIES = $(pmpi_convenience_libs) $(abi_convenience_libs)

endif !BUILD_PROFILING_LIB
endif BUILD_ABI_LIB
Expand Down

0 comments on commit 35655c4

Please sign in to comment.