Skip to content

Commit 19c3af7

Browse files
committed
build: Custom libmpi(_FOO) name option in configure
* Add a configure environment variable to rename libmpi(_FOO).* - `OMPI_LIBMPI_NAME` defaults to `mpi` * 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 OMPI_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 4b0b7fd commit 19c3af7

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

+183
-123
lines changed

config/opal_set_lib_prefix.m4

Lines changed: 14 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,16 @@ 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 environment variable.
45+
#
46+
AC_DEFUN([OMPI_SET_LIB_NAME],[
47+
AC_ARG_VAR([OMPI_LIBMPI_NAME],
48+
["Replace \"libmpi\" with \"libOMPI_LIBMPI_NAME\" (default=mpi)"])
49+
if test -z "$OMPI_LIBMPI_NAME"; then
50+
OMPI_LIBMPI_NAME=mpi
51+
fi
52+
53+
AC_SUBST(OMPI_LIBMPI_NAME)
54+
])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 \

ompi/file/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,5 +22,5 @@
2122
headers += \
2223
file/file.h
2324

24-
libmpi_la_SOURCES += \
25+
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
2526
file/file.c

0 commit comments

Comments
 (0)