-
Notifications
You must be signed in to change notification settings - Fork 0
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
Shared library version and SONAME/install name #28
Comments
What is the use case for these two macros? |
The primary use of these macros should be Conditional compilation. For example, I'm about to merge this commit into mpi4py mpi4py/mpi4py@170da9f. I do a few things differently under the ABI. For example, I assume that all MPI symbols are present for a given API version, and I disable or do differently for implementation-specific workarounds. Irrespective of the macros, Jeff is proposing two version numbers (major and minor) for versioning the ABI. I'm trying to discuss here how these two numbers will map to the shared library filenames and SONAME. |
@dalcinl So you only need |
For the time being yes, my only need is to know whether I'm compiling under the ABI. But that does not mean that in the future having access to the ABI version in the preprocessor will not be useful. What's the problem with differentiating ABI versions? What's exactly your concern? What I'm trying to discuss in this issue is somewhat orthogonal to the addition of these constants to PS: Everytime I raise an issue or concern about a technicality and you reply back with backlash I'm left in an awkward position, in the middle of Jeff and you. For quite a bit of time, Jeff had these two constants plus three new ABI-related query routines as part of his proposal. I guess these additions will be discussed in the next Chicago reading, see Jeff's PR about that. My last merged PR added |
Why though? You could either agree with me and argue against Jeff with me. Or you could disagree with me and argue with me with Jeff. Or you could leave the argument for Jeff and me. FWIW, I don't have a sufficient distinction between an argument and a discussion. |
Because I think most of the times the most productive use of time is is to argument/discuss in group and settle things once and for all. Otherwise we agree in pairs, and then the third-party at a later time makes the whole thing restart all over again. In the particular subject of whether to expose ABI version info as macros, I think the general answer is yes, why not? But it would be really nice if a single macro would provide all what we need. For example, If a MPI implementation and the included But again, now I'm derailing myself! I opened this issue to discuss how to name and version libraries. Maybe my opening in the description was a bit confusing. I'll try to reword that.
Don't worry, I understand you use them interchangeably. I do the same all the time. |
Sounds good. So far I only see points to support a mere |
An who ultimately decides the value of the triplet to pass to libtool and the dynamic library versioning? |
The libtool triplet is a link-time option for implementers. It doesn't need to be set in header files as macros and especially doesn't need to be consumed by MPI users. Even if you want to put it in the header, it can be directly set to the triplet in a comment rather than set them in misleading macros and imply a formula to derive the triplet. |
There you have... The whole point of the ABI is interoperability across implementations. We cannot leave library versioning 100% up to the implementers, because they feel kings in their little reigns and don't give a damn about each other. Look what happened to library versions in MPICH and Open MPI. As per my recollection, there are 10 different MPI APIs (one for each MPI standard version), but in only one time (MPI-3.0) there was a backward incompatible change that removed stuff. Yet, MPICH managed to have today This is the stubs repository. Some day we will properly rename it and maintain it. Third parties will be able to use it to build binary assets without a concrete implementation. I'm already doing that in testing! |
I want these macros so I know what version of the header I compiled my application or library against, so that I can check it against the SO I'm using at runtime. If this is the wrong way to do this, that's fine - I really don't know what I'm doing w.r.t. ABI-versioned shared library designs. |
As far as arguing versus discussing, it is important to get all the objections on the table so we don't make mistakes. At some point, somebody has to decide what to do, and probably somebody isn't perfectly happy with everything, but hopefully the objections are not of the kind "this is garbage that will never work". |
@dalcinl Calm down :) I was not arguing against your whole point [to fix the so version] at all. I was saying you do not do that via header macros that are meant for MPI users. You just need to write down the exact libtool triplet in the document or as a comment in the header file and require implementers to use it.
A comment line will do. And a text in the document will enforce that. |
Libtool has explicit rules on how to set the version triplet. It does not often align with people's perception of how an API version works. I don't think it is a good idea to invent a separate rule from libtool. Rather, set the version triplet according to the libtool's rule, write that triplet down, and ask implementers to use it. PS: https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html |
ok i'm fine to use libtool's method, but i need to know how to write it into the MPI spec... |
Just write the libtool triplet literally into the spec. Every time we publish a new version of the spec, we update the triplet according to libtool's rule. |
@jeffhammond I believe I told you in private communication that I was not sure the Guys, we need to reach an agreement on whether we need or not PS: @hzhou I'm sorry, I get easily frustrated. I opened this issue with the intention of settling the versioning of the shared library, and things went sideways discussing the contents of |
@dalcinl No worries :) @jeffhammond Just a reminder that it is always easy to add to the standard later on but nearly impossible to remove from it. I find it worrisome that you are trying hard to solve all issues beyond the initial scope. It is due diligence to look at and discuss all things, but I would try hard to define the current scope. For example, I think including anything Fortran in the first ABI spec is not a good idea. Those Sorry for the side track. |
if you read the text, i am defining only what C needs from Fortran, plus stating things that are required for a Fortran implementation like VAPAA to use the C ABI. |
@jeffhammond I believe your last comment is misplaced. Did you meant to put it in #27? |
No, I was responding to Hui's comment immediately prior. |
Shared library version and name
The current status of the ABI specification defines the following major and minor ABI versions to encode backward-compatibility contracts:
MPI_ABI_VERSION
(major)1
MPI_ABI_SUBVERSION
(minor)0
We should use these numbers do define the shared library version. Shared library versions typically start at version 0, and that's the number we currently generate. However, AFAICT, that's just conventional. Should we instead start at version 1 to match
MPI_ABI_VERSION
, thus producing an SONAME oflibmpi_abi.so.1
on Linux and a install name of@rpath/libmpi_abi.1.dylib
?Alternatively, MPI could start with
MPI_ABI_VERSION=0
, although that's admittedly awkward. Likewise, havinglibmpi_abi.so.X
withX
not matchingMPI_ABI_VERSION
is also awkward.Use of libtool
On a related note, the MPI ABI major and minor numbers would most likely be used to define the current/release/age triplet of libtool's
-version-info c:r:a
. Would the following mapping be appropriate?I assume here we chose the major library version starting at 1, and not 0 as it is conventional, as per the previous discussion.
current
MPI_ABI_VERSION + MPI_ABI_SUBVERSION
revision
0
age
MPI_ABI_SUBVERSION
Which would map to the following shared library file names
libmpi_abi.so.${MPI_ABI_VERSION}
libmpi_abi.so.${MPI_ABI_VERSION}.${MPI_ABI_SUBVERSION}
libmpi_abi.${MPI_ABI_VERSION}.dylib
libmpi_abi.${MPI_ABI_VERSION}.${MPI_ABI_SUBVERSION}.dylib
EDIT: As per the current ABI proposal, libtool's
revision
number will always stay zero (is this corrent?). The full shared library filename may have an extra.0
appended on Linux.The text was updated successfully, but these errors were encountered: