-
Notifications
You must be signed in to change notification settings - Fork 885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: Custom libmpi name option in configure #2059
Conversation
@jsquyres This touches the build system, so I need someone with build system expertise to look over this to make sure I didn't miss anything obvious. I'm doing some more testing now, but I think I caught all of the places that needed to change. Notice we are just focusing on An example: shell$ ./autogen.pl --libmpi-name wookie_mpi
...
shell$ grep ompi_lib_prefix config/autogen_found_items.m4
m4_define([ompi_lib_prefix], [wookie_mpi])
shell$ grep OMPI_LIB_PREFIX= configure
OMPI_LIB_PREFIX=wookie_mpi
shell$ # build and install
...
shell$ cd install-dir
shell$ find . -name "libmpi.*"
shell$ find . -name "libwookie_mpi.*"
./lib/libwookie_mpi.so.0.0.0
./lib/libwookie_mpi.so.0
./lib/libwookie_mpi.so
./lib/libwookie_mpi.la |
b33dcce
to
efd0933
Compare
rebased and ready for some review (I'd like another set of eyes on this before pushing to master). @jsquyres If you get a chance can you take a look at this PR. No big rush on this, just when you get a chance. |
@jjhursey Any reason not to also do I mention this because from a sysadmin perspective, it's pretty obvious when you can |
@@ -1096,6 +1098,7 @@ sub in_tarball { | |||
--no-ompi | -no-ompi Do not build the Open MPI layer | |||
--no-orte | -no-orte Do not build the ORTE layer | |||
--no-oshmem | -no-oshmem Do not build the OSHMEM layer | |||
--libmpi-name | -libmpi-name Override the default lib name of: lib$libmpi_name_arg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious: why is this at autogen time (vs. configure time)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it was a little odd to set it during configure time since as part of a release we want this value fixed so users don't change it. However, I could probably be convinced otherwise. Just seemed like a little bit of protection.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my default position on this is: we only put stuff in autogen.pl
that can't go in configure.ac
. Otherwise, you could make an argument that just about any configure
CLI option should also (or only) be available in autogen.pl
.
Indeed, we already have some branding-specific configure
CLI options. For example, how is the library name different than --with-package-string=STRING
or --with-ident-string=STRING
?
@@ -278,6 +279,8 @@ fi | |||
OPAL_SET_LIB_PREFIX([]) | |||
m4_ifdef([project_orte], | |||
[ORTE_SET_LIB_PREFIX([])]) | |||
m4_ifdef([project_ompi], | |||
[OMPI_SET_LIB_PREFIX([ompi_lib_prefix])]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little confused -- I see that we have the mechanisms here to add prefixes for the OPAL and ORTE libraries, but those don't appear to be used anywhere (i.e., we just pass in blank strings, so the prefixes are always empty -- there's no way to not have them be empty).
I'm therefore trying to remember why this functionality is here...? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per another email thread, those were added for a different external project (ORCM, I believe). Where they wanted to prefix libopen-pal.so
to something like liborcm_open-pal.so
. I just piggybacked on that mechanism to achieve this patch.
If there is no reason to have the OPAL_LIB_PREFIX
and ORTE_LIB_PREFIX
then we can probably remove them. But if there is a chance that other projects might want to do such renaming then we might as well leave them in. They are not hurting anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree -- no real reason to remove them.
lib_LTLIBRARIES = libmpi.la | ||
libmpi_la_SOURCES = | ||
libmpi_la_LIBADD = \ | ||
lib_LTLIBRARIES = lib@[email protected] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little odd to call this value a "prefix", when, in fact, it's the entire library name. I.e., it's:
not
The latter would follow suit for what was done with the other libraries. I.e., you could set the prefix to be josh_
, and then it would be libjosh_mpi
(etc.).
Is there a reason you want it to be the entire library name, rather than a prefix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were hoping to use this mechanism to rename libmpi
to libmpi_ibm
- so really a postfix. When preparing the patch I made it a bit more broad to allow both prefix and postfix by replacing the whole name. However, the variable OMPI_LIB_PREFIX
is misleading so adopting OMPI_LIBMPI_NAME
or OMPI_LIBRARY_NAME
is probably better.
I can make that change once we settle on what the variable should be called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you want a suffix.
Ok, in classic "Jeff wants a long name" form, I'd like OMPI_MPI_LIBRARY_NAME
. I'd settle for OMPI_MPI_LIB_NAME
, too. I think the extra MPI
is important in there because, as a project, OMPI has lots of libraries. In this case, you're specifically talking about the MPI library.
But then again, we have several MPI libraries... So it would be good to see this for all the MPI libraries -- Fortran and C++ too. E.g.:
- lib$(OMPI_MPI_LIB_NAME).la
- lib$(OMPI_MPI_LIB_NAME)_mpifh.la
- ...etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection to doing the Fortran names also. I think longer term the consistency would be desirable. Short term (for our 2.0 based release), we're only interested in the libmpi_suffix, and if the community default of empty string is applied, this change should be an effective no-op for the Open MPI v2.x branch.
To fully maintain jeff's reputation, i think the variable needs to be |
In reply to @jsquyres comment:
The truth is that we do not need it right now. However, I could envision a time where that might change. For the near term we only want to change How about this logic as a proposal:
|
I spoke with @jsquyres on the phone a little bit about this, and I think we came up with a workaround for the So, per the review, I'm going to make the following changes:
|
cd5abe2
to
19c3af7
Compare
@jsquyres I've updated the commit per the review. I think I addressed everything. Example usage: 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$ |
libwookie will be THE new official Open MPI library name right? It follows the Star Wars [tm] naming conventions of the components. Plus MPI IS quite Hairy in places. |
Per discussion on the webex this morning, a |
19c3af7
to
0cd2a20
Compare
Latest commit changes the mechanism to a configure option: |
b99ba59
to
5ee6573
Compare
Rebased - preparing for merge. Also fixed one corner case seen in diff below (case diff --git a/config/opal_set_lib_prefix.m4 b/config/opal_set_lib_prefix.m4
index 46ee4f73..69b65930 100644
--- a/config/opal_set_lib_prefix.m4
+++ b/config/opal_set_lib_prefix.m4
@@ -47,7 +47,7 @@ AC_DEFUN([OMPI_SET_LIB_NAME],[
AC_ARG_WITH([libmpi-name],
[AC_HELP_STRING([--with-libmpi-name=STRING],
["Replace \"libmpi(_FOO)\" with \"libSTRING(_FOO)\" (default=mpi)"])])
- if test "$with_libmpi_name" = "" || test "$with_libmpi_name" = "no"; then
+ if test "$with_libmpi_name" = "" || test "$with_libmpi_name" = "no" || test "$with_libmpi_name" = "yes"; t
with_libmpi_name="mpi"
fi
|
@jjhursey Do you want to error if someone specifies |
I followed the logic used by Which, looking at that logic, would have the same problem I noted a couple comments ago where if the user supplies In any case, having a error in the following case is probably good.
These cases would be the 'default', so no warning if the user specified it or not.
|
* 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$ ```
5ee6573
to
6e1a285
Compare
Pushed a rebased version with the suggested change to make shell$ ./configure --without-libmpi-name
...
checking if want custom libmpi(_FOO) name... Error
configure: WARNING: Invalid to specify --without-libmpi-name
configure: error: Cannot continue @jsquyres I think this is good to go. Any other comments? |
Sorry for chiming in late: 👍 |
In preparing the PRs I noticed a bug in the resolution of the libmpi name for the fortran wrapper compiler. PR to fix that coming shortly. |
libmpi(_FOO).*
--with-libmpi-name=STRING
defaultsSTRING
tompi
(solibmpi(_FOO).*
is not changed)