Skip to content

Commit efd0933

Browse files
committed
build: Custom libmpi name option in autogen.pl
* Add an autogen.pl CLI option to define the name of libmpi.so - `--libmpi-name josh_mpi` will replace `libmpi` with `libjosh_mpi` in all of the right places.
1 parent e84b352 commit efd0933

Some content is hidden

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

53 files changed

+162
-92
lines changed

autogen.pl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
88
# Copyright (c) 2015-2016 Research Organization for Information Science
99
# and Technology (RIST). All rights reserved.
10-
# Copyright (c) 2015 IBM Corporation. All rights reserved.
10+
# Copyright (c) 2015-2016 IBM Corporation. All rights reserved.
1111
#
1212
# $COPYRIGHT$
1313
#
@@ -48,6 +48,7 @@
4848
my $no_ompi_arg = 0;
4949
my $no_orte_arg = 0;
5050
my $no_oshmem_arg = 0;
51+
my $libmpi_name_arg = "mpi";
5152
my $quiet_arg = 0;
5253
my $debug_arg = 0;
5354
my $help_arg = 0;
@@ -1080,6 +1081,7 @@ sub in_tarball {
10801081
my $ok = Getopt::Long::GetOptions("no-ompi" => \$no_ompi_arg,
10811082
"no-orte" => \$no_orte_arg,
10821083
"no-oshmem" => \$no_oshmem_arg,
1084+
"libmpi-name=s" => \$libmpi_name_arg,
10831085
"quiet|q" => \$quiet_arg,
10841086
"debug|d" => \$debug_arg,
10851087
"help|h" => \$help_arg,
@@ -1096,6 +1098,7 @@ sub in_tarball {
10961098
--no-ompi | -no-ompi Do not build the Open MPI layer
10971099
--no-orte | -no-orte Do not build the ORTE layer
10981100
--no-oshmem | -no-oshmem Do not build the OSHMEM layer
1101+
--libmpi-name | -libmpi-name Override the default lib name of: lib$libmpi_name_arg
10991102
--quiet | -q Do not display normal verbose output
11001103
--debug | -d Output lots of debug information
11011104
--help | -h This help list
@@ -1324,6 +1327,11 @@ sub in_tarball {
13241327
m4_define([project_name_long], [$project_name_long])
13251328
m4_define([project_name_short], [$project_name_short])\n";
13261329

1330+
if( !$no_ompi_arg ) {
1331+
$m4 .= "\ndnl Library prefix
1332+
m4_define([ompi_lib_prefix], [$libmpi_name_arg])\n";
1333+
}
1334+
13271335
# Setup MCA
13281336
mca_run_global($projects);
13291337

config/opal_set_lib_prefix.m4

Lines changed: 15 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,17 @@ AC_DEFUN([ORTE_SET_LIB_PREFIX],[
3839
orte_lib_prefix_set=yes
3940
AC_SUBST(ORTE_LIB_PREFIX)
4041
])dnl
42+
43+
#
44+
# Same as OPAL LIB_PREFIX, but for the OMPI layer
45+
#
46+
AC_DEFUN([OMPI_SET_LIB_PREFIX],[
47+
AS_IF([test "$ompi_lib_prefix_set" = "yes"],
48+
[AC_MSG_WARN([OMPI lib prefix was already set!])
49+
AC_MSG_WARN([This is a configury programming error])
50+
AC_MSG_ERROR([Cannot continue])])
51+
52+
OMPI_LIB_PREFIX=$1
53+
ompi_lib_prefix_set=yes
54+
AC_SUBST(OMPI_LIB_PREFIX)
55+
])dnl

configure.ac

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# Copyright (c) 2013-2014 Intel, Inc. All rights reserved.
2323
# Copyright (c) 2014-2016 Research Organization for Information Science
2424
# and Technology (RIST). All rights reserved.
25+
# Copyright (c) 2016 IBM Corporation. All rights reserved.
2526
# $COPYRIGHT$
2627
#
2728
# Additional copyrights may follow
@@ -278,6 +279,8 @@ fi
278279
OPAL_SET_LIB_PREFIX([])
279280
m4_ifdef([project_orte],
280281
[ORTE_SET_LIB_PREFIX([])])
282+
m4_ifdef([project_ompi],
283+
[OMPI_SET_LIB_PREFIX([ompi_lib_prefix])])
281284

282285
############################################################################
283286
# 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_LIB_PREFIX@.la
133+
lib@OMPI_LIB_PREFIX@_la_SOURCES =
134+
lib@OMPI_LIB_PREFIX@_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_LIB_PREFIX@_la_LIBADD += \
148149
$(OMPI_TOP_BUILDDIR)/orte/lib@[email protected]
149150
endif
150-
libmpi_la_LIBADD += \
151+
lib@OMPI_LIB_PREFIX@_la_LIBADD += \
151152
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected]
152-
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)
153-
libmpi_la_LDFLAGS = \
153+
lib@OMPI_LIB_PREFIX@_la_DEPENDENCIES = $(lib@OMPI_LIB_PREFIX@_la_LIBADD)
154+
lib@OMPI_LIB_PREFIX@_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_LIB_PREFIX@_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_LIB_PREFIX@_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_LIB_PREFIX@_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_LIB_PREFIX@_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_LIB_PREFIX@.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_LIB_PREFIX@.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_LIB_PREFIX@.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_LIB_PREFIX@_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_LIB_PREFIX@_la_SOURCES += \
3233
errhandler/errhandler.c \
3334
errhandler/errhandler_invoke.c \
3435
errhandler/errhandler_predefined.c \

0 commit comments

Comments
 (0)