Skip to content

Commit 251477c

Browse files
Merge pull request #6431 from ggouaillardet/topic/mpiext_nolib
mpiext/shortfloat: do not create empty libraries
2 parents c80a842 + e1098da commit 251477c

File tree

6 files changed

+58
-55
lines changed

6 files changed

+58
-55
lines changed

config/ompi_ext.m4

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dnl University Research and Technology
55
dnl Corporation. All rights reserved.
66
dnl Copyright (c) 2009-2017 Cisco Systems, Inc. All rights reserved
77
dnl Copyright (c) 2011-2012 Oak Ridge National Labs. All rights reserved.
8-
dnl Copyright (c) 2015-2018 Research Organization for Information Science
8+
dnl Copyright (c) 2015-2019 Research Organization for Information Science
99
dnl and Technology (RIST). All rights reserved.
1010
dnl Copyright (c) 2017 The University of Tennessee and The University
1111
dnl of Tennessee Research Foundation. All rights
@@ -259,7 +259,8 @@ EOF
259259
[OMPI_MPIEXT_C],
260260
[OMPI_MPIEXT_MPIFH],
261261
[OMPI_MPIEXT_USEMPI],
262-
[OMPI_MPIEXT_USEMPIF08])])])
262+
[OMPI_MPIEXT_USEMPIF08],
263+
[OMPI_MPIEXT_ARCHIVE])])])
263264

264265
###############
265266
# C Bindings
@@ -344,10 +345,10 @@ EOF
344345

345346
OMPI_EXT_MAKE_DIR_LIST(OMPI_MPIEXT_ALL_SUBDIRS, $OMPI_MPIEXT_ALL)
346347

347-
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_C, $OMPI_MPIEXT_C, c, c)
348-
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_MPIFH, $OMPI_MPIEXT_MPIFH, mpif-h, mpifh)
349-
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPI, $OMPI_MPIEXT_USEMPI, use-mpi, usempi)
350-
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPIF08, $OMPI_MPIEXT_USEMPIF08, use-mpi-f08, usempif08)
348+
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_C, $OMPI_MPIEXT_C, $OMPI_MPIEXT_ARCHIVE, c, c)
349+
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_MPIFH, $OMPI_MPIEXT_MPIFH, $OMPI_MPIEXT_ARCHIVE, mpif-h, mpifh)
350+
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPI, $OMPI_MPIEXT_USEMPI, $OMPI_MPIEXT_ARCHIVE, use-mpi, usempi)
351+
OMPI_EXT_MAKE_LISTS(OMPI_MPIEXT_USEMPIF08, $OMPI_MPIEXT_USEMPIF08, $OMPI_MPIEXT_ARCHIVE, use-mpi-f08, usempif08)
351352

352353
comps=`echo $OMPI_MPIEXT_C | sed -e 's/^[ \t]*//;s/[ \t]*$//;s/ /, /g'`
353354
AC_DEFINE_UNQUOTED([OMPI_MPIEXT_COMPONENTS], ["$comps"],
@@ -366,7 +367,8 @@ EOF
366367
# (3) c_components_variable,
367368
# (4) mpifh_components_variable,
368369
# (5) usempi_components_variable,
369-
# (6) usempif08_components_variable)
370+
# (6) usempif08_components_variable,
371+
# (7) archive_components_variable)
370372
#
371373
# - component_name is a single, naked string (no prefix)
372374
# - all others are naked component names (e.g., "example"). If an
@@ -386,7 +388,7 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
386388
OMPI_MPIEXT_$1_CONFIG([should_build=${should_build}], [should_build=0])
387389

388390
AS_IF([test $should_build -eq 1],
389-
[EXT_PROCESS_COMPONENT([$1], [$2], [$3], [$4], [$5], [$6])],
391+
[EXT_PROCESS_COMPONENT([$1], [$2], [$3], [$4], [$5], [$6], [$7])],
390392
[EXT_PROCESS_DEAD_COMPONENT([$1], [$2])])
391393
])
392394

@@ -403,7 +405,8 @@ AC_DEFUN([EXT_CONFIGURE_M4_CONFIG_COMPONENT],[
403405
# (3) c_components_variable,
404406
# (4) mpifh_components_variable,
405407
# (5) usempi_components_variable,
406-
# (6) usempif08_components_variable)
408+
# (6) usempif08_components_variable,
409+
# (7) archive_components_variable)
407410
#
408411
# C bindings are mandatory. Other bindings are optional / built if
409412
# they are found. Here's the files that the m4 expects:
@@ -615,7 +618,7 @@ EOF
615618
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPI],
616619
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPI],
617620
[include_mpifh=1])
618-
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
621+
if test $enabled_mpifh -eq 1 && test $include_mpifh -ne 0; then
619622
mpifh_component_header="mpiext_${component}_mpifh.h"
620623
cat >> $mpiusempi_ext_h <<EOF
621624
#include "${mpifh_component_header_path}"
@@ -677,7 +680,7 @@ EOF
677680
m4_ifdef([OMPI_MPIEXT_]$1[_INCLUDE_MPIFH_IN_USEMPIF08],
678681
[include_mpifh=OMPI_MPIEXT_$1_INCLUDE_MPIFH_IN_USEMPIF08],
679682
[include_mpifh=1])
680-
if test "$enabled_mpifh" = 1 && test "$include_mpifh" != 0; then
683+
if test $enabled_mpifh -eq 1 && test $include_mpifh -ne 0; then
681684
mpifh_component_header="mpiext_${component}_mpifh.h"
682685
cat >> $mpiusempif08_ext_h <<EOF
683686
#include "${mpifh_component_header_path}"
@@ -704,6 +707,13 @@ EOF
704707
[echo "extern const ompi_mpiext_component_t ompi_mpiext_${component};" >> $outfile.extern
705708
echo " &ompi_mpiext_${component}, " >> $outfile.struct])
706709

710+
m4_ifdef([OMPI_MPIEXT_]$1[_HAVE_OBJECT],
711+
[have_object=OMPI_MPIEXT_$1_HAVE_OBJECT],
712+
[have_object=1])
713+
if test $have_object -ne 0; then
714+
$7="$$7 $component"
715+
fi
716+
707717
# now add the flags that were set in the environment variables
708718
# framework_component_FOO (for example, the flags set by
709719
# m4_configure components)
@@ -804,7 +814,7 @@ AC_DEFUN([EXT_COMPONENT_BUILD_CHECK],[
804814
fi
805815
fi
806816

807-
AS_IF([test "$want_component" = "1"], [$2], [$3])
817+
AS_IF([test $want_component -eq 1], [$2], [$3])
808818
])
809819

810820

@@ -821,25 +831,31 @@ AC_DEFUN([OMPI_EXT_MAKE_DIR_LIST],[
821831
])
822832

823833
# OMPI_EXT_MAKE_LISTS((1) subst'ed variable prefix,
824-
# (2) shell list,
825-
# (3) bindings dir name,
826-
# (4) bindings suffix)
834+
# (2) shell list of extensions of which the bindings are enabled,
835+
# (3) shell list of extensions which needs libtool archive,
836+
# (4) bindings dir name,
837+
# (5) bindings suffix)
827838
#
828839
# Prefix every extension name with "mpiext/".
829840
# -------------------------------------------------------------------------
830841
AC_DEFUN([OMPI_EXT_MAKE_LISTS],[
831842
# Make the directory list
832843
tmp=
833844
for item in $2 ; do
834-
tmp="$tmp mpiext/$item/$3"
845+
tmp="$tmp mpiext/$item/$4"
835846
done
836847
$1_DIRS=$tmp
837848
AC_SUBST($1_DIRS)
838849

839850
# Make the list of libraries
840851
tmp=
841852
for item in $2 ; do
842-
tmp="$tmp "'$(top_builddir)'"/ompi/mpiext/$item/$3/libmpiext_${item}_$4.la"
853+
for item2 in $3 ; do
854+
if test $item = $item2; then
855+
tmp="$tmp "'$(top_builddir)'"/ompi/mpiext/$item/$4/libmpiext_${item}_$5.la"
856+
break
857+
fi
858+
done
843859
done
844860
$1_LIBS=$tmp
845861
AC_SUBST($1_LIBS)

ompi/mpiext/example/configure.m4

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Copyright (c) 2004-2009 The Trustees of Indiana University.
44
# All rights reserved.
55
# Copyright (c) 2012-2015 Cisco Systems, Inc. All rights reserved.
6+
# Copyright (c) 2019 FUJITSU LIMITED. All rights reserved.
67
# $COPYRIGHT$
78
#
89
# Additional copyrights may follow
@@ -40,3 +41,17 @@ AC_DEFUN([OMPI_MPIEXT_example_NEED_INIT], [1])
4041
# By default, mpiext_example_mpifh.h is included in the source file
4142
# of the mpi_f08_ext module. To disable it, define this macro as 0.
4243
#AC_DEFUN([OMPI_MPIEXT_example_INCLUDE_MPIFH_IN_USEMPIF08], [0])
44+
45+
# By default, $build_dir/ompi/mpiext/example/c/libmpiext_example_c.la
46+
# (Libtool archive) is added to the dependency list of libmpi.la.
47+
# This rule is the same for mpif-h and use-mpi-f08 bindings.
48+
# However, the ar command of macOS refuses to create an archive file
49+
# which does not contain any object files. If your extension has no
50+
# object files, i.e. only header files, define this macro as 0 so that
51+
# the *.la files are not added to the dependency lists.
52+
53+
# NOTE: This is currently a single macro for the entire MPI extension.
54+
# I.e., your extension either has a library for each binding, or it has *no*
55+
# libraries for any of the bindings. If finer-grained control is needed
56+
# someday, we may need to split this into multiple macros.
57+
#AC_DEFUN([OMPI_MPIEXT_example_HAVE_OBJECT], [0])

ompi/mpiext/shortfloat/c/Makefile.am

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,17 @@
11
#
22
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
3+
# Copyright (c) 2019 Research Organization for Information Science
4+
# and Technology (RIST). All rights reserved.
35
# $COPYRIGHT$
46
#
57
# Additional copyrights may follow
68
#
79
# $HEADER$
810
#
911

10-
# Convenience libtool library that will be slurped up into libmpi.la.
11-
noinst_LTLIBRARIES = libmpiext_shortfloat_c.la
12-
1312
# This is where the top-level header file (that is included in
1413
# <mpi-ext.h>) must be installed.
1514
ompidir = $(ompiincludedir)/mpiext
1615

1716
# This is the header file that is installed.
1817
ompi_HEADERS = mpiext_shortfloat_c.h
19-
20-
# Sources for the convenience libtool library.
21-
libmpiext_shortfloat_c_la_SOURCES = $(ompi_HEADERS)
22-
libmpiext_shortfloat_c_la_LDFLAGS = -module -avoid-version

ompi/mpiext/shortfloat/configure.m4

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# -*- shell-script -*-
22
#
3-
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
3+
# Copyright (c) 2018-2019 FUJITSU LIMITED. All rights reserved.
4+
# Copyright (c) 2019 Research Organization for Information Science
5+
# and Technology (RIST). All rights reserved.
46
# $COPYRIGHT$
57
#
68
# Additional copyrights may follow
@@ -41,3 +43,6 @@ AC_DEFUN([OMPI_MPIEXT_shortfloat_CONFIG],[
4143
# and the mpi_f08_ext module. The former is integer and the latter is
4244
# type(mpi_datatype).
4345
AC_DEFUN([OMPI_MPIEXT_shortfloat_INCLUDE_MPIFH_IN_USEMPIF08], [0])
46+
47+
# This extension provides only header files for datatype handles.
48+
AC_DEFUN([OMPI_MPIEXT_shortfloat_HAVE_OBJECT], [0])

ompi/mpiext/shortfloat/mpif-h/Makefile.am

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,10 @@
77
# $HEADER$
88
#
99

10-
# Convenience libtool library that will be slurped up into libmpi_mpifh.la.
11-
noinst_LTLIBRARIES =
12-
1310
# Directory where the header file to be included in mpif-ext.h must be
1411
# installed.
1512
ompidir = $(ompiincludedir)/mpiext
1613

17-
# If we are, build the convenience libtool library that will be
18-
# slurped up into libmpi_mpifh.la.
19-
noinst_LTLIBRARIES += libmpiext_shortfloat_mpifh.la
20-
2114
# Just like noinst_LTLIBRARIES, set this macro to empty and
2215
# conditionally add to it later.
2316
ompi_HEADERS =
@@ -29,8 +22,4 @@ if OMPI_BUILD_FORTRAN_MPIFH_BINDINGS
2922
# This is the header file that is installed.
3023
ompi_HEADERS += mpiext_shortfloat_mpifh.h
3124

32-
# Sources for the convenience libtool library.
33-
libmpiext_shortfloat_mpifh_la_SOURCES = $(ompi_HEADERS)
34-
libmpiext_shortfloat_mpifh_la_LDFLAGS = -module -avoid-version
35-
3625
endif
Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#
22
# Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
3+
# Copyright (c) 2019 Research Organization for Information Science
4+
# and Technology (RIST). All rights reserved.
35
# $COPYRIGHT$
46
#
57
# Additional copyrights may follow
@@ -10,33 +12,14 @@
1012
# This file builds the use_mpi_f08-based bindings for MPI extensions. It
1113
# is optional in MPI extensions.
1214

13-
# We must set these #defines and include paths so that the inner OMPI
14-
# MPI prototype header files do the Right Thing.
15-
AM_FCFLAGS = $(OMPI_FC_MODULE_FLAG)$(top_builddir)/ompi/mpi/fortran/use-mpi-f08/mod \
16-
-I$(top_srcdir) $(FCFLAGS_f90)
17-
18-
# Note that the mpi_f08-based bindings are optional -- they can only
19-
# be built if OMPI is also building the Fortran-based bindings. So we
20-
# initially set some Makefile macros to empty, and then conditionally
21-
# add to them later.
22-
noinst_LTLIBRARIES =
23-
2415
# Use the Automake conditional to know if we're building the "use mpi_f08"
2516
# bindings.
2617
if OMPI_BUILD_FORTRAN_USEMPIF08_BINDINGS
2718

28-
# If we are, build the convenience libtool library that will be
29-
# slurped up into libmpi_usempif08.la.
30-
noinst_LTLIBRARIES += libmpiext_shortfloat_usempif08.la
31-
3219
# Note that no header files are installed; instead,
3320
# mpiext_shortfloat_usempif08.h is automatically slurped up into the
3421
# mpi_f08_ext module. It must be listed so that it is included in
3522
# dist tarballs.
3623
noinst_HEADERS = mpiext_shortfloat_usempif08.h
3724

38-
# Sources for the convenience libtool library.
39-
libmpiext_shortfloat_usempif08_la_SOURCES = $(ompi_HEADERS)
40-
libmpiext_shortfloat_usempif08_la_LDFLAGS = -module -avoid-version
41-
4225
endif

0 commit comments

Comments
 (0)