Skip to content

Commit 5cdbb7d

Browse files
authored
Merge pull request #2139 from jjhursey/cp-v2.x/custom-libmpi
v2.1.0: build: Custom libmpi(_FOO) name option in configure
2 parents f9a68cd + 6b8ad1a commit 5cdbb7d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+210
-126
lines changed

README

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
1212
Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved.
1313
Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved.
1414
Copyright (c) 2007 Myricom, Inc. All rights reserved.
15-
Copyright (c) 2008 IBM Corporation. All rights reserved.
15+
Copyright (c) 2008-2016 IBM Corporation. All rights reserved.
1616
Copyright (c) 2010 Oak Ridge National Labs. All rights reserved.
1717
Copyright (c) 2011 University of Houston. All rights reserved.
1818
Copyright (c) 2013-2015 Intel, Inc. All rights reserved
@@ -819,6 +819,14 @@ INSTALLATION OPTIONS
819819
command line that are not in FILE are also used. Options on the
820820
command line and in FILE are replaced by what is in FILE.
821821

822+
--with-libmpi-name=STRING
823+
Replace libmpi.* and libmpi_FOO.* (where FOO is one of the fortran
824+
supporting libraries installed in lib) with libSTRING.* and
825+
libSTRING_FOO.*. This is provided as a convenience mechanism for
826+
third-party packagers of Open MPI that might want to rename these
827+
libraries for their own purposes. This option is *not* intended for
828+
typical users of Open MPI.
829+
822830
NETWORKING SUPPORT / OPTIONS
823831

824832
--with-fca=<directory>

config/ompi_setup_mpi_fortran.m4

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ dnl reserved.
1717
dnl Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
1818
dnl Copyright (c) 2014-2015 Research Organization for Information Science
1919
dnl and Technology (RIST). All rights reserved.
20+
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
2021
dnl $COPYRIGHT$
2122
dnl
2223
dnl Additional copyrights may follow
@@ -340,9 +341,9 @@ AC_DEFUN([OMPI_SETUP_MPI_FORTRAN],[
340341
[OMPI_BUILD_FORTRAN_BINDINGS=$OMPI_FORTRAN_USEMPI_BINDINGS
341342
AS_IF([test $OMPI_FORTRAN_HAVE_IGNORE_TKR -eq 1],
342343
[OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-ignore-tkr
343-
OMPI_FORTRAN_USEMPI_LIB=-lmpi_usempi_ignore_tkr],
344+
OMPI_FORTRAN_USEMPI_LIB=-l${with_libmpi_name}_usempi_ignore_tkr],
344345
[OMPI_FORTRAN_USEMPI_DIR=mpi/fortran/use-mpi-tkr
345-
OMPI_FORTRAN_USEMPI_LIB=-lmpi_usempi])
346+
OMPI_FORTRAN_USEMPI_LIB=-l${with_libmpi_name}_usempi])
346347
])
347348

348349
OMPI_FORTRAN_HAVE_ISO_C_BINDING=0
@@ -574,7 +575,7 @@ end type test_mpi_handle],
574575

575576
AC_MSG_CHECKING([if building Fortran 'use mpi_f08' bindings])
576577
AS_IF([test $OMPI_BUILD_FORTRAN_BINDINGS -ge $OMPI_FORTRAN_USEMPIF08_BINDINGS],
577-
[OMPI_FORTRAN_USEMPIF08_LIB=-lmpi_usempif08
578+
[OMPI_FORTRAN_USEMPIF08_LIB=-l${with_libmpi_name}_usempif08
578579
AC_MSG_RESULT([yes])],
579580
[OMPI_TRY_FORTRAN_BINDIGS=$OMPI_FORTRAN_USEMPI_BINDINGS
580581
AC_MSG_RESULT([no])])

config/opal_set_lib_prefix.m4

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- shell-script -*-
22
#
33
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
4+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
45
# $COPYRIGHT$
56
#
67
# Additional copyrights may follow
@@ -38,3 +39,24 @@ AC_DEFUN([ORTE_SET_LIB_PREFIX],[
3839
orte_lib_prefix_set=yes
3940
AC_SUBST(ORTE_LIB_PREFIX)
4041
])dnl
42+
43+
#
44+
# Rename 'libmpi' and 'libmpi_FOO' with a configure time option.
45+
#
46+
AC_DEFUN([OMPI_SET_LIB_NAME],[
47+
AC_MSG_CHECKING([if want custom libmpi(_FOO) name])
48+
AC_ARG_WITH([libmpi-name],
49+
[AC_HELP_STRING([--with-libmpi-name=STRING],
50+
["Replace \"libmpi(_FOO)\" with \"libSTRING(_FOO)\" (default=mpi)"])])
51+
52+
AS_IF([test "$with_libmpi_name" = "no"],
53+
[AC_MSG_RESULT([Error])
54+
AC_MSG_WARN([Invalid to specify --without-libmpi-name])
55+
AC_MSG_ERROR([Cannot continue])])
56+
57+
AS_IF([test "$with_libmpi_name" = "" || test "$with_libmpi_name" = "yes"],
58+
[with_libmpi_name="mpi"])
59+
60+
AC_MSG_RESULT([$with_libmpi_name])
61+
AC_SUBST(OMPI_LIBMPI_NAME, $with_libmpi_name)
62+
])dnl

config/opal_setup_wrappers.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ dnl Copyright (c) 2006-2010 Oracle and/or its affiliates. All rights reserved.
1414
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1515
dnl Copyright (c) 2015 Research Organization for Information Science
1616
dnl and Technology (RIST). All rights reserved.
17+
dnl Copyright (c) 2016 IBM Corporation. All rights reserved.
1718
dnl $COPYRIGHT$
1819
dnl
1920
dnl Additional copyrights may follow
@@ -428,7 +429,7 @@ AC_DEFUN([OPAL_SETUP_WRAPPER_FINAL],[
428429
# support. However, we do want it to fail if there is no C++
429430
# compiler.
430431
if test "$WANT_MPI_CXX_SUPPORT" = "1" ; then
431-
OMPI_WRAPPER_CXX_LIB="-lmpi_cxx"
432+
OMPI_WRAPPER_CXX_LIB="-l${with_libmpi_name}_cxx"
432433
OMPI_WRAPPER_CXX_REQUIRED_FILE=""
433434
elif test "$CXX" = "none"; then
434435
OMPI_WRAPPER_CXX_LIB=""

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ fi
276276
OPAL_SET_LIB_PREFIX([])
277277
m4_ifdef([project_orte],
278278
[ORTE_SET_LIB_PREFIX([])])
279+
m4_ifdef([project_ompi],
280+
[OMPI_SET_LIB_NAME([])])
279281

280282
############################################################################
281283
# Libtool: part one

contrib/build-mca-comps-outside-of-tree/configure.ac

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# Copyright (c) 2004-2005 The Regents of the University of California.
1212
# All rights reserved.
1313
# Copyright (c) 2011-2014 Cisco Systems, Inc. All rights reserved.
14+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1415
# $COPYRIGHT$
1516
#
1617
# Additional copyrights may follow
@@ -154,7 +155,7 @@ EOF
154155
# Open MPI v1.7 libraries
155156
LDFLAGS="$LDFLAGS -L$withval/ompi/.libs"
156157
# For OMPI v1.7 and later
157-
LIBS="$LIBS -lmpi"
158+
LIBS="$LIBS -l@OMPI_LIBMPI_NAME@"
158159

159160
CPPFLAGS="$CPPFLAGS $source_CPPFLAGS"
160161
CFLAGS="$CFLAGS $source_CFLAGS"

ompi/Makefile.am

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Copyright (c) 2015 Intel, Inc. All rights reserved.
1818
# Copyright (c) 2015 Research Organization for Information Science
1919
# and Technology (RIST). All rights reserved.
20+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
2021
# $COPYRIGHT$
2122
#
2223
# Additional copyrights may follow
@@ -127,9 +128,9 @@ DIST_SUBDIRS = \
127128

128129
# Build the main MPI library
129130

130-
lib_LTLIBRARIES = libmpi.la
131-
libmpi_la_SOURCES =
132-
libmpi_la_LIBADD = \
131+
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@.la
132+
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
133+
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
133134
datatype/libdatatype.la \
134135
debuggers/libdebuggers.la \
135136
mpi/c/libmpi_c.la \
@@ -143,13 +144,13 @@ libmpi_la_LIBADD = \
143144

144145

145146
if OMPI_RTE_ORTE
146-
libmpi_la_LIBADD += \
147+
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
147148
$(OMPI_TOP_BUILDDIR)/orte/lib@[email protected]
148149
endif
149-
libmpi_la_LIBADD += \
150+
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
150151
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected]
151-
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)
152-
libmpi_la_LDFLAGS = \
152+
lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD)
153+
lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
153154
-version-info $(libmpi_so_version) \
154155
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
155156

@@ -158,7 +159,7 @@ headers =
158159
noinst_LTLIBRARIES =
159160
include_HEADERS =
160161
dist_ompidata_DATA =
161-
libmpi_la_SOURCES += $(headers)
162+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
162163
nodist_man_MANS =
163164

164165
# Conditionally install the header files

ompi/attribute/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# University of Stuttgart. All rights reserved.
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
12+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1213
# $COPYRIGHT$
1314
#
1415
# Additional copyrights may follow
@@ -21,6 +22,6 @@
2122
headers += \
2223
attribute/attribute.h
2324

24-
libmpi_la_SOURCES += \
25+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
2526
attribute/attribute.c \
2627
attribute/attribute_predefined.c

ompi/class/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# University of Stuttgart. All rights reserved.
1111
# Copyright (c) 2004-2005 The Regents of the University of California.
1212
# All rights reserved.
13+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1314
# $COPYRIGHT$
1415
#
1516
# Additional copyrights may follow
@@ -22,6 +23,6 @@
2223
headers += \
2324
class/ompi_seq_tracker.h
2425

25-
libmpi_la_SOURCES += \
26+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
2627
class/ompi_seq_tracker.c
2728

ompi/communicator/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# reserved.
1515
# Copyright (c) 2014 Research Organization for Information Science
1616
# and Technology (RIST). All rights reserved.
17+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1718
# $COPYRIGHT$
1819
#
1920
# Additional copyrights may follow
@@ -28,7 +29,7 @@ headers += \
2829
communicator/comm_request.h \
2930
communicator/comm_helpers.h
3031

31-
libmpi_la_SOURCES += \
32+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
3233
communicator/comm_init.c \
3334
communicator/comm.c \
3435
communicator/comm_cid.c \

0 commit comments

Comments
 (0)