Skip to content
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

Malmo linux releases require specific boost versions #392

Closed
DaveyBiggers opened this issue Oct 28, 2016 · 4 comments
Closed

Malmo linux releases require specific boost versions #392

DaveyBiggers opened this issue Oct 28, 2016 · 4 comments
Labels
Milestone

Comments

@DaveyBiggers
Copy link
Member

Is it possible to avoid this?

@DaveyBiggers DaveyBiggers added this to the Giraffe milestone Nov 7, 2016
@DaveyBiggers DaveyBiggers added the P2 label Nov 7, 2016
@DaveyBiggers
Copy link
Member Author

Hmm, probably not: "There is no way to build an executable or library that will be version-agnostic to the Boost version it uses." - see http://stackoverflow.com/a/32964146

Boost doesn't maintain ABI compatibility between versions, so our only option would be to link boost statically, as we currently do for Debian 7, for example.

Looking at the sizes of the binaries in the releases, it doesn't seem as though statically linking will add a huge overhead, so this might be worth considering. Going to the other extreme, we could stop providing prebuilt Linux binaries, and just ask people to build their own. (Building is pretty simple on Linux.)

@DaveyBiggers
Copy link
Member Author

Turns out there's an issue with linking boost statically - the boost static libraries aren't compiled with -fPIC (which is needed to ensure the code is position independent). This is required for shared libaries (like Malmo). If I understand this correctly, since the shared library must be PIC, any code it pulls in must also be PIC.

Bottom line seems to be that anyone attempting to build Malmo from source would be forced to recompile boost with -fPIC before compiling Malmo. This seems a heavy price to pay. It makes life easier for users who just want to install a prebuilt Malmo, but it penalises anyone who wants to build it themselves.

@DaveyBiggers
Copy link
Member Author

@timhutton proposed something like this:
Add a flag to the root CMakeLists.txt (along the lines of the BUILD_MOD, BUILD_DOCUMENTATION etc flags) to specify whether or not to link boost statically.
This can be off, by default, so that users who want to build from source don't need to bother with the hassle of building boost (unless they need to - eg for Debian 7 or Windows). When we build the release binaries here, we switch it on (and build boost ourselves).

That way, everyone wins.
(Except us.)

@DaveyBiggers
Copy link
Member Author

Fixed in #434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant