Skip to content

Commit

Permalink
build: Custom libmpi(_FOO) name option in configure
Browse files Browse the repository at this point in the history
 * 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$
```
  • Loading branch information
jjhursey committed Sep 30, 2016
1 parent 871ade9 commit f6f24a4
Show file tree
Hide file tree
Showing 56 changed files with 209 additions and 124 deletions.
10 changes: 9 additions & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Copyright (c) 2006-2016 Cisco Systems, Inc. All rights reserved.
Copyright (c) 2006-2011 Mellanox Technologies. All rights reserved.
Copyright (c) 2006-2012 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2007 Myricom, Inc. All rights reserved.
Copyright (c) 2008 IBM Corporation. All rights reserved.
Copyright (c) 2008-2016 IBM Corporation. All rights reserved.
Copyright (c) 2010 Oak Ridge National Labs. All rights reserved.
Copyright (c) 2011 University of Houston. All rights reserved.
Copyright (c) 2013-2015 Intel, Inc. All rights reserved
Expand Down Expand Up @@ -830,6 +830,14 @@ INSTALLATION OPTIONS
command line that are not in FILE are also used. Options on the
command line and in FILE are replaced by what is in FILE.

--with-libmpi-name=STRING
Replace libmpi.* and libmpi_FOO.* (where FOO is one of the fortran
supporting libraries installed in lib) with libSTRING.* and
libSTRING_FOO.*. This is provided as a convenience mechanism for
third-party packagers of Open MPI that might want to rename these
libraries for their own purposes. This option is *not* intended for
typical users of Open MPI.

NETWORKING SUPPORT / OPTIONS

--with-fca=<directory>
Expand Down
22 changes: 22 additions & 0 deletions config/opal_set_lib_prefix.m4
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- shell-script -*-
#
# Copyright (c) 2014 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -38,3 +39,24 @@ AC_DEFUN([ORTE_SET_LIB_PREFIX],[
orte_lib_prefix_set=yes
AC_SUBST(ORTE_LIB_PREFIX)
])dnl

#
# Rename 'libmpi' and 'libmpi_FOO' with a configure time option.
#
AC_DEFUN([OMPI_SET_LIB_NAME],[
AC_MSG_CHECKING([if want custom libmpi(_FOO) name])
AC_ARG_WITH([libmpi-name],
[AC_HELP_STRING([--with-libmpi-name=STRING],
["Replace \"libmpi(_FOO)\" with \"libSTRING(_FOO)\" (default=mpi)"])])

AS_IF([test "$with_libmpi_name" = "no"],
[AC_MSG_RESULT([Error])
AC_MSG_WARN([Invalid to specify --without-libmpi-name])
AC_MSG_ERROR([Cannot continue])])

AS_IF([test "$with_libmpi_name" = "" || test "$with_libmpi_name" = "yes"],
[with_libmpi_name="mpi"])

AC_MSG_RESULT([$with_libmpi_name])
AC_SUBST(OMPI_LIBMPI_NAME, $with_libmpi_name)
])dnl
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ fi
OPAL_SET_LIB_PREFIX([])
m4_ifdef([project_orte],
[ORTE_SET_LIB_PREFIX([])])
m4_ifdef([project_ompi],
[OMPI_SET_LIB_NAME([])])

############################################################################
# Libtool: part one
Expand Down
17 changes: 9 additions & 8 deletions ompi/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# Copyright (c) 2015 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -128,9 +129,9 @@ DIST_SUBDIRS = \

# Build the main MPI library

lib_LTLIBRARIES = libmpi.la
libmpi_la_SOURCES =
libmpi_la_LIBADD = \
lib_LTLIBRARIES = lib@OMPI_LIBMPI_NAME@.la
lib@OMPI_LIBMPI_NAME@_la_SOURCES =
lib@OMPI_LIBMPI_NAME@_la_LIBADD = \
datatype/libdatatype.la \
debuggers/libdebuggers.la \
mpi/c/libmpi_c.la \
Expand All @@ -144,13 +145,13 @@ libmpi_la_LIBADD = \


if OMPI_RTE_ORTE
libmpi_la_LIBADD += \
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
$(OMPI_TOP_BUILDDIR)/orte/lib@[email protected]
endif
libmpi_la_LIBADD += \
lib@OMPI_LIBMPI_NAME@_la_LIBADD += \
$(OMPI_TOP_BUILDDIR)/opal/lib@[email protected]
libmpi_la_DEPENDENCIES = $(libmpi_la_LIBADD)
libmpi_la_LDFLAGS = \
lib@OMPI_LIBMPI_NAME@_la_DEPENDENCIES = $(lib@OMPI_LIBMPI_NAME@_la_LIBADD)
lib@OMPI_LIBMPI_NAME@_la_LDFLAGS = \
-version-info $(libmpi_so_version) \
$(OMPI_LIBMPI_EXTRA_LDFLAGS)

Expand All @@ -159,7 +160,7 @@ headers =
noinst_LTLIBRARIES =
include_HEADERS =
dist_ompidata_DATA =
libmpi_la_SOURCES += $(headers)
lib@OMPI_LIBMPI_NAME@_la_SOURCES += $(headers)
nodist_man_MANS =

# Conditionally install the header files
Expand Down
3 changes: 2 additions & 1 deletion ompi/attribute/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -21,6 +22,6 @@
headers += \
attribute/attribute.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
attribute/attribute.c \
attribute/attribute_predefined.c
3 changes: 2 additions & 1 deletion ompi/class/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -22,6 +23,6 @@
headers += \
class/ompi_seq_tracker.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
class/ompi_seq_tracker.c

3 changes: 2 additions & 1 deletion ompi/communicator/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# reserved.
# Copyright (c) 2014 Research Organization for Information Science
# and Technology (RIST). All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -28,7 +29,7 @@ headers += \
communicator/comm_request.h \
communicator/comm_helpers.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
communicator/comm_init.c \
communicator/comm.c \
communicator/comm_cid.c \
Expand Down
7 changes: 4 additions & 3 deletions ompi/debuggers/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007-2015 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -44,13 +45,13 @@ headers = \

dlopen_test_SOURCES = dlopen_test.c
dlopen_test_LDADD = \
$(top_builddir)/ompi/libmpi.la \
$(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la \
$(top_builddir)/opal/lib@[email protected]
dlopen_test_DEPENDENCIES = $(ompi_predefined_LDADD)

predefined_gap_test_SOURCES = predefined_gap_test.c
predefined_gap_test_LDFLAGS = $(WRAPPER_EXTRA_LDFLAGS)
predefined_gap_test_LDADD = $(top_builddir)/ompi/libmpi.la
predefined_gap_test_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
predefined_gap_test_DEPENDENCIES = $(ompi_predefined_LDADD)

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

# Conditionally install the header files
Expand Down
3 changes: 2 additions & 1 deletion ompi/dpm/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- makefile -*-
#
# Copyright (c) 2015 Intel, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -13,6 +14,6 @@
headers += \
dpm/dpm.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
dpm/dpm.c

3 changes: 2 additions & 1 deletion ompi/errhandler/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -28,7 +29,7 @@ headers += \
errhandler/errhandler.h \
errhandler/errhandler_predefined.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
errhandler/errhandler.c \
errhandler/errhandler_invoke.c \
errhandler/errhandler_predefined.c \
Expand Down
3 changes: 2 additions & 1 deletion ompi/file/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -21,5 +22,5 @@
headers += \
file/file.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
file/file.c
5 changes: 3 additions & 2 deletions ompi/group/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2006-2007 University of Houston. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -24,11 +25,11 @@ headers += \
group/group.h \
group/group_dbg.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
group/group.c \
group/group_init.c \
group/group_set_rank.c \
group/group_plist.c \
group/group_sporadic.c \
group/group_strided.c \
group/group_bitmap.c
group/group_bitmap.c
3 changes: 2 additions & 1 deletion ompi/info/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# University of Stuttgart. All rights reserved.
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -22,5 +23,5 @@
headers += \
info/info.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
info/info.c
15 changes: 8 additions & 7 deletions ompi/mca/common/ompio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2016 University of Houston. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
#
# $COPYRIGHT$
#
Expand Down Expand Up @@ -43,22 +44,22 @@ sources = \

lib_LTLIBRARIES =
noinst_LTLIBRARIES =
comp_inst = lib@OPAL_LIB_PREFIX@mca_common_ompio.la
comp_noinst = lib@OPAL_LIB_PREFIX@mca_common_ompio_noinst.la
comp_inst = libmca_common_ompio.la
comp_noinst = libmca_common_ompio_noinst.la

if MCA_BUILD_ompi_common_ompio_DSO
lib_LTLIBRARIES += $(comp_inst)
else
noinst_LTLIBRARIES += $(comp_noinst)
endif

lib@OPAL_LIB_PREFIX@mca_common_ompio_la_SOURCES = $(headers) $(sources)
lib@OPAL_LIB_PREFIX@mca_common_ompio_la_CPPFLAGS = $(common_ompio_CPPFLAGS)
lib@OPAL_LIB_PREFIX@mca_common_ompio_la_LDFLAGS = \
libmca_common_ompio_la_SOURCES = $(headers) $(sources)
libmca_common_ompio_la_CPPFLAGS = $(common_ompio_CPPFLAGS)
libmca_common_ompio_la_LDFLAGS = \
-version-info $(libmca_ompi_common_ompio_so_version) \
$(common_ompio_LDFLAGS)
lib@OPAL_LIB_PREFIX@mca_common_ompio_la_LIBADD = $(common_ompio_LIBS)
lib@OPAL_LIB_PREFIX@mca_common_ompio_noinst_la_SOURCES = $(headers) $(sources)
libmca_common_ompio_la_LIBADD = $(common_ompio_LIBS)
libmca_common_ompio_noinst_la_SOURCES = $(headers) $(sources)

# Conditionally install the header files

Expand Down
3 changes: 2 additions & 1 deletion ompi/mca/io/ompio/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2008-2012 University of Houston. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -34,7 +35,7 @@ mcacomponent_LTLIBRARIES = $(component_install)
mca_io_ompio_la_SOURCES = $(headers) $(sources)
mca_io_ompio_la_LDFLAGS = -module -avoid-version
mca_io_ompio_la_LIBADD = $(io_ompio_LIBS) \
$(OMPI_TOP_BUILDDIR)/ompi/mca/common/ompio/lib@OPAL_LIB_PREFIX@mca_common_ompio.la
$(OMPI_TOP_BUILDDIR)/ompi/mca/common/ompio/libmca_common_ompio.la

noinst_LTLIBRARIES = $(component_noinst)
libmca_io_ompio_la_SOURCES = $(headers) $(sources)
Expand Down
3 changes: 2 additions & 1 deletion ompi/mca/sharedfp/addproc/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2013 University of Houston. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -60,4 +61,4 @@ mca_sharedfp_addproc_control_SOURCES = \
sharedfp_addproc_control.h \
sharedfp_addproc_control.c

mca_sharedfp_addproc_control_LDADD = $(top_builddir)/ompi/libmpi.la
mca_sharedfp_addproc_control_LDADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
3 changes: 2 additions & 1 deletion ompi/message/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand All @@ -23,5 +24,5 @@
headers += \
message/message.h

libmpi_la_SOURCES += \
lib@OMPI_LIBMPI_NAME@_la_SOURCES += \
message/message.c
3 changes: 2 additions & 1 deletion ompi/mpi/cxx/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright (c) 2004-2005 The Regents of the University of California.
# All rights reserved.
# Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
# Copyright (c) 2016 IBM Corporation. All rights reserved.
# $COPYRIGHT$
#
# Additional copyrights may follow
Expand Down Expand Up @@ -42,7 +43,7 @@ libmpi_cxx_la_SOURCES += \
file.cc
endif

libmpi_cxx_la_LIBADD = $(top_builddir)/ompi/libmpi.la
libmpi_cxx_la_LIBADD = $(top_builddir)/ompi/lib@OMPI_LIBMPI_NAME@.la
libmpi_cxx_la_LDFLAGS = -version-info $(libmpi_cxx_so_version)

headers = \
Expand Down
Loading

0 comments on commit f6f24a4

Please sign in to comment.