how to use a different boost version in hdk client code

   6637   8   2
User Avatar
Member
15 posts
Joined: 3月 2010
Offline
Hi,

I want to compile my hdk-based application with stuff which uses a newer version of boost. Now it seems I run into trouble as boost is baked into the hdk (seems with hdk 10.0 its version 1.33).

Is there a possibility to use a different version of boost with the hdk? I was thinking to just replace the boost directory in the hdk include dir with a newer one but that seems a bit risky. Would this be valid or are there any issues with this? Or are there any alternative routes?

Thanks,
David
User Avatar
Member
295 posts
Joined: 10月 2008
Offline
Almost certainly not. The fact that Houdini ships with that version pretty much guarantees that's what they built Houdini against. And if you use something else, even if you get the code to compile and link, you'll be setting yourself up for unpredictable runtime behavior and nasty crashes. Unless you can guarantee that the Boost version you're upgrading to is binary compatible with Houdini's version, you'll have nothing but heartache if you try this. Ultimately it's a fundamental issue with how C++ is designed and implemented by compiler vendors.
Houdini Models [learning3dfromscratch.blogspot.com]
User Avatar
Member
7766 posts
Joined: 7月 2005
Offline
The only case I think you might be able to get away with is if your HDK code ONLY uses boost header-only libraries. Then your own code can happily use the newer boost headers without actually linking to boost.

I was thinking to just replace the boost directory in the hdk include dir with a newer one but that seems a bit risky.

DO NOT DO THIS!
User Avatar
Member
295 posts
Joined: 10月 2008
Offline
Given that this is boost, and so much of it uses templates, won't that potentially screw things up? I don't know how it's being used, but if you're passing around boost objects in API/HDK calls, and those are template based structs/objects, then wouldn't that cause havoc?
Houdini Models [learning3dfromscratch.blogspot.com]
User Avatar
Member
7766 posts
Joined: 7月 2005
Offline
Yes, that might. But if you have files that do NOT include any HDK headers, then it might be possible to use different boost headers provided that there's no cross-over. But yeah, it's pretty dangerous still.
User Avatar
Member
15 posts
Joined: 3月 2010
Offline
Thanks alot for your input. I wonder how other big studios like sony, dd etc. do it when they write hdk client code which also links against their own codebase. Either they dont use boost (1.34+) or they dont write hdk modules which uses their proprietary code at the same time. But thats hard to imagine.

David
User Avatar
Member
295 posts
Joined: 10月 2008
Offline
I don't work at any of those places, but I can't imagine that they try to mix and match boost versions. It's just too big of a PITA, for little return.
<rant mode on>
Of course much of this is due to the crazy language design in C++, the lack of a standard ABI, and guys like Bjarne Stroustrup not actively condemning compiler vendors earlier in the languages life cycle to prevent the current situation of compiler vendors re-inventing the wheel all over the place and ending up with huge variations in compiler compatibility. Grrrrr. And this is coming from someone who actually prefers C++ over various other alternatives (C, C#, etc).
Houdini Models [learning3dfromscratch.blogspot.com]
User Avatar
Member
790 posts
Joined: 4月 2020
Offline
I am not sure how it works, but for us it works. We mainly use the smart pointers from boost, but using our own data structures inside houdini and passing boost pointers around works. Our internal libraries use a newer version of boost as the one the hdk shipped with.

I have ran into a few small issues once or twice, but nothing we could ever pin to not using the same version.

Koen
User Avatar
Member
15 posts
Joined: 3月 2010
Offline
koen
I am not sure how it works, but for us it works. We mainly use the smart pointers from boost, but using our own data structures inside houdini and passing boost pointers around works. Our internal libraries use a newer version of boost as the one the hdk shipped with.

I have ran into a few small issues once or twice, but nothing we could ever pin to not using the same version.

Koen

Thanks alot, Koen.

David
  • Quick Links