Boost: Use Headers instead of building when not required#2947
Boost: Use Headers instead of building when not required#2947dgovil wants to merge 1 commit intoPixarAnimationStudios:devfrom
Conversation
f61073a to
1145258
Compare
|
Filed as internal issue #USD-9296 |
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
162e736 to
b71bf91
Compare
|
Heh nice to see this latest patch reduces the boost footprint in the build directory from ~180MB of headers to ~40MB of headers! |
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. MaterialX is also disabled as requested and the upgrade will be handled in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * TBB requires SDKROOT to be passed in or it can often go off and find some random compiler toolchain and fail. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
…ot include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. MaterialX is also disabled as requested and the upgrade will be handled in a follow up PR. It is a minimal version of PixarAnimationStudios#2455 against the latest `dev` branch. Changes include: * Using latest dev branch * No imaging support. Will be added in a follow up PR. * Makes use of CMake's inbuilt iOS support, negating the need for toolchain support * Structures the code in such a way that we can add support for other iOS derived platforms+simulator in future PRs * Swaps `ARCH_OS_IOS` with `ARCH_OS_IPHONE` to align with compiler directives. IPHONE refers to all derivative platforms, whereas iOS refers to only iPhone/iPad (Confusing but the case for historical reasons as [documented here](https://chaosinmotion.com/2021/08/02/things-to-remember-compiler-conditionals-for-macos-ios-etc/)) * TBB requires SDKROOT to be passed in or it can often go off and find some random compiler toolchain and fail. * Add APPLE_EMBEDDED boolean to designate when using the CMake supported cross compilation targets. Added in Options.cmake so it can be used to configure defaults properly. This PR requires PixarAnimationStudios#2947 to be merged first as that allows for not requiring Boost patches per platform, which can get fragile.
|
Thanks for submitting this, @dgovil , though after consideration, we don't think it's right to take this, just yet, since:
|
|
@spiffmon That's understandable, though most of the header reduction complexity was by request. If I revert to my initial version of this PR, it just does a straight copy of headers and so is much more straightforward/consistent for all boost versions. A few alternatives that I'd like to run by you, since this is the basis of our iOS patch and so makes landing those somewhat more complex.
My worry is that we tie the iOS patches to removal of boost as (IMHO) they could be separable concerns. Since the PRs are stacked, it's easier to solve them from the root upwards. |
|
I'd vote to just copy all the headers, and ideally just for header-only libraries. That retains the "don't have to actually build boost" benefits without the maintenance burden, and is no worse from a size perspective than we were before. |
|
Ooh, I managed to get something working because of the following changes that landed for 24.3
It means B2 build now succeeds for iPhone derived platforms without any patches to B2's configs, and just minor changes to the b2 args. So I'll do two things:
That way, we can evaluate this PR on its own merits instead of it being tied to the iOS ones. In which case, maybe let's just close this PR out as unnecessary, in favour of the de-boosting effort? Does that sound good to you, @sunyab and @spiffmon ? |
When building USD without Python, OIIO or VDB, Boost libs aren't required. In this scenario, it is preferable to just copy over the headers instead and save some time and complexity. This also has a significant benefit that it allows the core USD build to be supported on platforms that Boost doesn't natively build on yet. It means that the build_usd.py script doesn't need to carry as many patches to Boost itself if someone is just building the core USD library. This is similar to [PR 2914](PixarAnimationStudios#2914) but can short circuit the entire bootstrap and b2 process, which may still error on platforms that b2 doesn't understand.
b71bf91 to
22baa80
Compare
|
Okay:
But totally feel free to close/reject this PR as well. The only advantage is the time/space savings of not having to run B2 now |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Great! Since you're no longer depending on this I'm going to close this out since we're not benefiting much from it, and we're also this close to being rid of the boost dependency (in most cases) anyway. Thanks! |
Description of Change(s)
When building USD without Python, OIIO or VDB, Boost libs aren't required. In this scenario, it is preferable to just copy over the headers instead and save some time and complexity.
Edit: as subsequently requested, removed the filtering. With filtering, this can reduce the header size from 180M to 37M. Without filtering, the only benefit is that you don't spend time building with B2 when you don't end up using any of its output.
This also has a significant benefit that it allows the core USD build to be supported on platforms that Boost doesn't natively build on yet like iOS and visionOS. It means that the build_usd.py script doesn't need to carry as many patches to Boost itself if someone is just building the core USD library.
This is similar to PR 2914 but can short circuit the entire bootstrap and b2 process, which may still error on platforms that b2 doesn't understand.