linking boost major version at build

27 views
Skip to first unread message

Yotam Stern

unread,
Apr 5, 2021, 12:21:21 AM4/5/21
to gtsam users
Hi, when building gtsam it links to the major + minor version of the libboost .so files.
This is very limiting if i want to use the created python package on other platforms who might have different minor version of boost still compatible with the specific version i had on the build machines.

Does anyone know how should i modify the CmakeLists file to have only the major version of the boost .so file linked? in other words .so.1 instead of say so.1.75

jiang...@gmail.com

unread,
Apr 5, 2021, 1:29:10 PM4/5/21
to gtsam users
Hi,

It's a very complex issue. Boost does not have ABI compatibility even with minor versions, so it is NOT possible to have a GTSAM (or any other library that links boost dynamically) binary that works across different systems. Check https://abi-laboratory.pro/?view=timeline&l=boost to see the problem visually.

We have provided the pypi packages of GTSAM and other packages that works on any system, by linking Boost statically. If you want to employ this approach, please refer to https://github.com/borglab/gtsam-manylinux-build to see how this is done.

Best,
Fan

Yotam Stern

unread,
Apr 5, 2021, 1:35:13 PM4/5/21
to gtsam users
I see, so if i staticly link boost i won't depend on what boost exists in the environment i run my gtsam package on. so i need to add this flag to the cmake command:

-DBoost_USE_STATIC_LIBS=ON

is this also important?

-DBoost_NO_SYSTEM_PATHS=ON

Fan Jiang

unread,
Apr 5, 2021, 3:50:00 PM4/5/21
to gtsam users
Yes that is correct. However this will not work if you have something else that depends on boost that you want to link GTSAM against. Under absolutely no circumstances should boost versions to be mixed in a binary (or in one process).

Best,
Fan

--
You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gtsam-users/5730f07f-079a-43bc-ac9c-1b27e992df87n%40googlegroups.com.

Yotam Stern

unread,
Apr 5, 2021, 5:13:34 PM4/5/21
to gtsam users
Thank you, this worked out fine, the only issue i found was that the latests release of boost have removed the static library so i had to use a slightly older version. 1.68, maybe 1.71 and 1.72 are fine also i didn't check but it makes no difference.
Reply all
Reply to author
Forward
0 new messages