Skip to content

Commit f6f24a4

Browse files
committed
build: Custom libmpi(_FOO) name option in configure
* Add a configure time option to rename libmpi(_FOO).* - `--with-libmpi-name=STRING` * This commit only impacts the installed libraries. Internal, temporary libraries have not been renamed to limit the scope of the patch to only what is needed. For example: ```shell shell$ ./configure --with-libmpi-name=wookie ... shell$ find . -name "libmpi*" shell$ find . -name "libwookie*" ./lib/libwookie.so.0.0.0 ./lib/libwookie.so.0 ./lib/libwookie.so ./lib/libwookie.la ./lib/libwookie_mpifh.so.0.0.0 ./lib/libwookie_mpifh.so.0 ./lib/libwookie_mpifh.so ./lib/libwookie_mpifh.la ./lib/libwookie_usempi.so.0.0.0 ./lib/libwookie_usempi.so.0 ./lib/libwookie_usempi.so ./lib/libwookie_usempi.la shell$ ```
1 parent 871ade9 commit f6f24a4

Some content is hidden

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

56 files changed

+209
-124
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
@@ -830,6 +830,14 @@ INSTALLATION OPTIONS
830830
command line that are not in FILE are also used. Options on the
831831
command line and in FILE are replaced by what is in FILE.
832832

833+
--with-libmpi-name=STRING
834+
Replace libmpi.* and libmpi_FOO.* (where FOO is one of the fortran
835+
supporting libraries installed in lib) with libSTRING.* and
836+
libSTRING_FOO.*. This is provided as a convenience mechanism for
837+
third-party packagers of Open MPI that might want to rename these
838+
libraries for their own purposes. This option is *not* intended for
839+
typical users of Open MPI.
840+
833841
NETWORKING SUPPORT / OPTIONS
834842

835843
--with-fca=<directory>

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

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,8 @@ fi
280280
OPAL_SET_LIB_PREFIX([])
281281
m4_ifdef([project_orte],
282282
[ORTE_SET_LIB_PREFIX([])])
283+
m4_ifdef([project_ompi],
284+
[OMPI_SET_LIB_NAME([])])
283285

284286
############################################################################
285287
# Libtool: part one

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
@@ -128,9 +129,9 @@ DIST_SUBDIRS = \
128129

129130
# Build the main MPI library
130131

131-
lib_LTLIBRARIES = libmpi.la
132-
libmpi_la_SOURCES =
133-
libmpi_la_LIBADD = \
132+
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@.la
133+
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
134+
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
134135
datatype/libdatatype.la \
135136
debuggers/libdebuggers.la \
136137
mpi/c/libmpi_c.la \
@@ -144,13 +145,13 @@ libmpi_la_LIBADD = \
144145

145146

146147
if OMPI_RTE_ORTE
147-
libmpi_la_LIBADD += \
148+
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
148149
$(OMPI_TOP_BUILDDIR)/orte/lib@[email protected]
149150
endif
150-
libmpi_la_LIBADD += \
151+
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
151152
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected]
152-
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)
153-
libmpi_la_LDFLAGS = \
153+
lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD)
154+
lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
154155
-version-info $(libmpi_so_version) \
155156
$(OMPI_LIBMPI_EXTRA_LDFLAGS)
156157

@@ -159,7 +160,7 @@ headers =
159160
noinst_LTLIBRARIES =
160161
include_HEADERS =
161162
dist_ompidata_DATA =
162-
libmpi_la_SOURCES += $(headers)
163+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
163164
nodist_man_MANS =
164165

165166
# 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 \

ompi/debuggers/Makefile.am

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2004-2005 The Regents of the University of California.
1111
# All rights reserved.
1212
# Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
13+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1314
# $COPYRIGHT$
1415
#
1516
# Additional copyrights may follow
@@ -44,13 +45,13 @@ headers = \
4445

4546
dlopen_test_SOURCES = dlopen_test.c
4647
dlopen_test_LDADD = \
47-
$(top_builddir)/ompi/libmpi.la \
48+
$(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \
4849
$(top_builddir)/opal/lib@[email protected]
4950
dlopen_test_DEPENDENCIES = $(ompi_predefined_LDADD)
5051

5152
predefined_gap_test_SOURCES = predefined_gap_test.c
5253
predefined_gap_test_LDFLAGS = $(WRAPPER_EXTRA_LDFLAGS)
53-
predefined_gap_test_LDADD = $(top_builddir)/ompi/libmpi.la
54+
predefined_gap_test_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
5455
predefined_gap_test_DEPENDENCIES = $(ompi_predefined_LDADD)
5556

5657
libdebuggers_la_SOURCES = \
@@ -78,7 +79,7 @@ libompi_dbg_msgq_la_LDFLAGS = -module -avoid-version
7879
# and "make check" will *build* a test in runtime/, but it won't *run*
7980
# it. :-(
8081
predefined_pad_test_LDFLAGS = $(WRAPPER_EXTRA_LDFLAGS)
81-
predefined_pad_test_LDADD = $(top_builddir)/ompi/libmpi.la
82+
predefined_pad_test_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
8283
predefined_pad_test_DEPENDENCIES = $(ompi_predefined_LDADD)
8384

8485
# Conditionally install the header files

ompi/dpm/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- makefile -*-
22
#
33
# Copyright (c) 2015 Intel, Inc. All rights reserved.
4+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
45
# $COPYRIGHT$
56
#
67
# Additional copyrights may follow
@@ -13,6 +14,6 @@
1314
headers += \
1415
dpm/dpm.h
1516

16-
libmpi_la_SOURCES += \
17+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
1718
dpm/dpm.c
1819

ompi/errhandler/Makefile.am

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) 2008 Cisco Systems, Inc. All rights reserved.
14+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
1415
# $COPYRIGHT$
1516
#
1617
# Additional copyrights may follow
@@ -28,7 +29,7 @@ headers += \
2829
errhandler/errhandler.h \
2930
errhandler/errhandler_predefined.h
3031

31-
libmpi_la_SOURCES += \
32+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
3233
errhandler/errhandler.c \
3334
errhandler/errhandler_invoke.c \
3435
errhandler/errhandler_predefined.c \

0 commit comments

Comments
 (0)