Skip to content

Commit ef656f2

Browse files
committed
bindings: fix up makefile for c interfaces
to heed the --enable-abi-standard config option Signed-off-by: Howard Pritchard <howardp@lanl.gov>
1 parent d166410 commit ef656f2

File tree

2 files changed

+98
-58
lines changed

2 files changed

+98
-58
lines changed

ompi/mpi/c/Makefile.am

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@
4040
include $(top_srcdir)/Makefile.ompi-rules
4141

4242
noinst_LTLIBRARIES = libmpi_c.la libmpi_c_profile.la
43-
if OMPI_STANDARD_ABI
44-
noinst_LTLIBRARIES += libmpi_c_abi.la libmpi_c_abi_profile.la
45-
endif
4643
if BUILD_MPI_BINDINGS_LAYER
47-
noinst_LTLIBRARIES += libmpi_c_noprofile.la libmpi_c_abi_noprofile.la
44+
noinst_LTLIBRARIES += libmpi_c_noprofile.la
4845
endif
4946

5047
headers = bindings.h
@@ -502,7 +499,6 @@ prototype_sources = \
502499
wtime.c.in
503500

504501
EXTRA_DIST = $(prototype_sources)
505-
BUILT_SOURCES = abi.h standard_abi/mpi.h
506502

507503
# attr_fn.c contains attribute manipulation functions which do not
508504
# profiling implications, and so are always built.
@@ -520,25 +516,12 @@ if BUILD_MPI_BINDINGS_LAYER
520516
libmpi_c_la_LIBADD += libmpi_c_noprofile.la
521517
endif
522518

523-
libmpi_c_abi_la_SOURCES = \
524-
attr_fn.c \
525-
abi_details.c \
526-
abi_supported.c \
527-
abi_version.c
528-
529-
libmpi_c_abi_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES
530-
libmpi_c_abi_la_LIBADD = libmpi_c_abi_profile.la
531-
if BUILD_MPI_BINDINGS_LAYER
532-
libmpi_c_abi_la_LIBADD += libmpi_c_abi_noprofile.la
533-
endif
534-
535519
#
536520
# List of all C files that have profile versions (*_generated.c files were
537521
# generated from prototype_sources above).
538522
#
539523
#
540524
interface_profile_sources = $(prototype_sources:.c.in=_ompi_generated.c)
541-
abi_interface_profile_sources = $(prototype_sources:.c.in=_abi_generated.c)
542525

543526

544527
# Conditionally install the header files
@@ -580,15 +563,6 @@ libmpi_c_profile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=1
580563
libmpi_c_noprofile_la_SOURCES = $(interface_profile_sources) $(extra_interface_profile_sources) $(deprecated_interface_profile_sources)
581564
libmpi_c_noprofile_la_CPPFLAGS = -DOMPI_BUILD_MPI_PROFILING=0
582565

583-
libmpi_c_abi_profile_la_SOURCES = $(abi_interface_profile_sources)
584-
libmpi_c_abi_profile_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=1
585-
586-
libmpi_c_abi_noprofile_la_SOURCES = $(abi_interface_profile_sources)
587-
libmpi_c_abi_noprofile_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=0
588-
589-
nobase_include_HEADERS = standard_abi/mpi.h
590-
591-
# ABI generation rules
592566
if OMPI_GENERATE_BINDINGS
593567
%_ompi_generated.c: %.c.in
594568
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
@@ -599,36 +573,8 @@ if OMPI_GENERATE_BINDINGS
599573
source \
600574
ompi \
601575
$<
576+
endif
602577

603-
%_abi_generated.c: %.c.in
604-
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
605-
--builddir $(abs_top_builddir) \
606-
--srcdir $(abs_top_srcdir) \
607-
--output $@ \
608-
c \
609-
source \
610-
standard \
611-
$<
612-
abi.h: $(prototype_sources)
613-
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
614-
--builddir $(abs_top_builddir) \
615-
--srcdir $(abs_top_srcdir) \
616-
--output $@ \
617-
c \
618-
header \
619-
--srcdir $(srcdir) \
620-
$(prototype_sources)
621-
standard_abi/mpi.h: $(prototype_sources)
622-
mkdir -p standard_abi
623-
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
624-
--builddir $(abs_top_builddir) \
625-
--srcdir $(abs_top_srcdir) \
626-
--output $@ \
627-
c \
628-
header \
629-
--srcdir $(srcdir) \
630-
--external \
631-
$(prototype_sources)
578+
if OMPI_STANDARD_ABI
579+
include Makefile_abi.include
632580
endif
633-
# Delete generated files on maintainer-clean
634-
MAINTAINERCLEANFILES = *_generated.c abi.h standard_abi/

ompi/mpi/c/Makefile_abi.include

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#
2+
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3+
# University Research and Technology
4+
# Corporation. All rights reserved.
5+
# Copyright (c) 2004-2013 The University of Tennessee and The University
6+
# of Tennessee Research Foundation. All rights
7+
# reserved.
8+
# Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9+
# University of Stuttgart. All rights reserved.
10+
# Copyright (c) 2004-2005 The Regents of the University of California.
11+
# All rights reserved.
12+
# Copyright (c) 2009-2021 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
14+
# Copyright (c) 2012 Oak Rigde National Laboratory. All rights reserved.
15+
# Copyright (c) 2012-2013 Inria. All rights reserved.
16+
# Copyright (c) 2013-2018 Los Alamos National Security, LLC. All rights
17+
# reserved.
18+
# Copyright (c) 2015-2020 Research Organization for Information Science
19+
# and Technology (RIST). All rights reserved.
20+
# Copyright (c) 2021 Amazon.com, Inc. or its affiliates. All Rights
21+
# reserved.
22+
# Copyright (c) 2025 Advanced Micro Devices, Inc. All Rights reserved.
23+
# $COPYRIGHT$
24+
#
25+
# Additional copyrights may follow
26+
#
27+
# $HEADER$
28+
#
29+
30+
# ABI specific make components
31+
32+
noinst_LTLIBRARIES += libmpi_c_abi.la libmpi_c_abi_profile.la
33+
if BUILD_MPI_BINDINGS_LAYER
34+
noinst_LTLIBRARIES += libmpi_c_abi_noprofile.la
35+
endif
36+
37+
BUILT_SOURCES = abi.h standard_abi/mpi.h
38+
39+
40+
libmpi_c_abi_la_SOURCES = \
41+
attr_fn.c \
42+
abi_details.c \
43+
abi_supported.c \
44+
abi_version.c
45+
46+
libmpi_c_abi_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES
47+
libmpi_c_abi_la_LIBADD = libmpi_c_abi_profile.la
48+
if BUILD_MPI_BINDINGS_LAYER
49+
libmpi_c_abi_la_LIBADD += libmpi_c_abi_noprofile.la
50+
endif
51+
52+
abi_interface_profile_sources = $(prototype_sources:.c.in=_abi_generated.c)
53+
54+
libmpi_c_abi_profile_la_SOURCES = $(abi_interface_profile_sources)
55+
libmpi_c_abi_profile_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=1
56+
57+
libmpi_c_abi_noprofile_la_SOURCES = $(abi_interface_profile_sources)
58+
libmpi_c_abi_noprofile_la_CPPFLAGS = -DOMPI_NO_MPI_PROTOTYPES -DOMPI_BUILD_MPI_PROFILING=0
59+
60+
nobase_include_HEADERS = abi.h standard_abi/mpi.h
61+
62+
if OMPI_GENERATE_BINDINGS
63+
%_abi_generated.c: %.c.in
64+
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
65+
--builddir $(abs_top_builddir) \
66+
--srcdir $(abs_top_srcdir) \
67+
--output $@ \
68+
c \
69+
source \
70+
standard \
71+
$<
72+
abi.h: $(prototype_sources)
73+
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
74+
--builddir $(abs_top_builddir) \
75+
--srcdir $(abs_top_srcdir) \
76+
--output $@ \
77+
c \
78+
header \
79+
--srcdir $(srcdir) \
80+
$(prototype_sources)
81+
standard_abi/mpi.h: $(prototype_sources)
82+
mkdir -p standard_abi
83+
$(OMPI_V_GEN) $(PYTHON) $(top_srcdir)/ompi/mpi/bindings/bindings.py \
84+
--builddir $(abs_top_builddir) \
85+
--srcdir $(abs_top_srcdir) \
86+
--output $@ \
87+
c \
88+
header \
89+
--srcdir $(srcdir) \
90+
--external \
91+
$(prototype_sources)
92+
endif
93+
# Delete generated files on maintainer-clean
94+
MAINTAINERCLEANFILES = *_generated.c abi.h standard_abi/

0 commit comments

Comments
 (0)