Hello,

If there have been changes in the API over time, shouldn't there have been some changes to the .so (dynamic library) versioning in the Makefile (as per accepted standards)? I see nothing interesting about such versioning there.

I'll likely start using it as a static library as you said, but I still remain curious about the dynamic library versioning. It seems like was just stuck at 0 since the beginning.


Mar 23, 2023, 05:53 by hyc@symas.com:
Sam Dave wrote:
Hello,

Thanks in advance for some clues on the below:

1.
Has there ever been a release of LMDB that adds/removes/changes API?

There have been additions to the API over time.
2.
On both Debian 10 (with lmdb 0.9.22) and Debian 11 (with lmdb 0.9.24) , under lib/ I see

liblmdb.so -> liblmdb.so.0 (symlink)
liblmdb.so.0 -> liblmdb.so.0.0.0 (symlink)
liblmdb.so.0.0.0 (the original file)

Has this always been at 0.0.0 since the beginning of LMDB? From the point of view of what the LMDB developers would expect, I mean. (I have no idea which
distros were distributing LMDB in the early days)
3.
What are your intentions regarding this .so versioning in relation to adding/removing/changes to the API?
Something like this, perhaps? https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
4.
Another Linux distribution (NixOS 22.11, with lmdb 0.9.29) has *only* this under lib/:

liblmdb.so (the original file)

Does this sound right to you?
What I mean is, when people compile LMDB down to an .so, would you expect them to normally add a version after the ".so"? (As they apparently did in Debian)

Read the makefile and see.

Currently liblmdb compiles down to about 110KB of x86-64 object code as a static library, and 125KB as a shared library.
IMO it is a waste of effort to use it as a shared library since it's such a tiny piece of code; it should just be
statically linked into every project that uses it. (Also the performance difference between static and dynamic linking
is a measurable proportion of liblmdb runtime, so it's just better to build and link it statically.)

--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/