Skip to content

Apple: Core iOS support#2949

Closed
dgovil wants to merge 2 commits intoPixarAnimationStudios:devfrom
dgovil:ios_core
Closed

Apple: Core iOS support#2949
dgovil wants to merge 2 commits intoPixarAnimationStudios:devfrom
dgovil:ios_core

Conversation

@dgovil
Copy link
Copy Markdown
Collaborator

@dgovil dgovil commented Feb 14, 2024

Description of Change(s)

This PR adds Core iOS support to the OpenUSD project. This does not include Imaging, and any Imaging related components at this time. Imaging will be added in a follow up PR. As requested, MaterialX support was also removed and will be uploaded in a separate PR.

While the build_usd.py script only supports iPhone, this change also does make it possible for the main CMake build to target other Apple platforms as long as the developer can build the dependencies themselves.

It is a minimal version of Thor's work in #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 or in TargetConditionals.h within any Apple SDK)
  • Upgrades MaterialX to 1.38.8 (from 1.38.7) as that adds support for iOS derivative platforms as well.
  • I've moved import apple_utils out from under a platform check, because the module import shouldn't be platform specific, and it removes the need for unnecessary platform checks all over the place
  • TBB requires SDKROOT be passed in to workaround a bug where it may find a random other toolchain and fail. (Valentin Roussellet figured out this edge case)
  • Added APPLE_EMBEDDED cmake parameter in Options.cmake so that it can be used to configure options further down the build setup
  • I have verified that all unit tests pass with the proposed changes
  • I have submitted a signed Contributor License Agreement

@dgovil dgovil force-pushed the ios_core branch 5 times, most recently from d140266 to 2bda389 Compare February 14, 2024 21:03
@jesschimein
Copy link
Copy Markdown
Collaborator

Filed as internal issue #USD-9301

dgovil added a commit to dgovil/USD that referenced this pull request Feb 15, 2024
This requires PixarAnimationStudios#2949 to be merged first as that introduces core iOS support first
dgovil added a commit to dgovil/USD that referenced this pull request Feb 21, 2024
This requires PixarAnimationStudios#2949 to be merged first as that introduces core iOS support first
@dgovil dgovil force-pushed the ios_core branch 3 times, most recently from 1466fc3 to c317892 Compare February 29, 2024 00:24
dgovil added a commit to dgovil/USD that referenced this pull request Feb 29, 2024
This requires PixarAnimationStudios#2949 to be merged first as that introduces core iOS support first
dgovil added a commit to dgovil/USD that referenced this pull request Feb 29, 2024
This requires PixarAnimationStudios#2949 to be merged first as that introduces core iOS support first
@jesschimein
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

pixar-oss pushed a commit that referenced this pull request Mar 26, 2024
Swaps ARCH_OS_IOS for ARCH_OS_IPHONE to align with compiler directives.

TARGET_OS_IPHONE refers to all derivative platforms whereas iOS refers
only to iPhone/iPad (Confusing but the case for historical reasons as
documented in TargetConditionals.h within any Apple SDK).

Contribution: Dhruv Govil

See #2949

(Internal change: 2321624)
pixar-oss pushed a commit that referenced this pull request Mar 30, 2024
Use Metal shader source for macOS and all Apple embedded systems.

Contribution: Dhruv Govil, Thor Hjalmarsson

Fixes #2949

(Internal change: 2322695)
@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Apr 8, 2024

@jesschimein or @meshula for whenever y'all are back, I just wanted to make a note so I can check in on the build_usd.py and apple_utils.py changes in this PR that didn't make it into 24.5.

Should I split it out into a separate PR? I think I'd missed that 24.5 was targeting just the CMake + C++ side of things. I'm just not sure how y'all want to handle the remainder of this PR.

@davidgyu
Copy link
Copy Markdown
Member

@dgovil There are some additional notes from internal code review that we want to address before merging the build script changes, but I think we can keep those associated with this PR for now.

@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Apr 12, 2024

Sounds good. Thanks!

@pixar-oss pixar-oss closed this in 8d56cde Apr 19, 2024
@meshula meshula reopened this Apr 20, 2024
@meshula
Copy link
Copy Markdown
Member

meshula commented Apr 20, 2024

Reopened, as the noted commit only partially addressed the PR.

@dgovil dgovil force-pushed the ios_core branch 2 times, most recently from 6f1bb3a to 233f5cc Compare April 22, 2024 20:51
@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Apr 22, 2024

@davidgyu and @meshula This PR has been rebased against the latest in dev.
It only contains the build script changes which mostly amount to:

  • Adding the new build target flag
  • Setting the build target and sdkroot for TBB. The SDKRoot is required because TBB has a tendency to try and discover the wrong SDK.

@dgovil dgovil force-pushed the ios_core branch 6 times, most recently from 451dc1e to 610664e Compare April 23, 2024 01:50
@jesschimein
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Apr 23, 2024

I'm just fixing up a few other oddities I'm finding.

  1. Currently tbb seems to want to only respect the iOS build target for Debug and not release. Looking into that now.
  2. I found an intermittent bug in cmake where setting the CMAKE_SYSTEM_NAME causes the cmake find logic to change. I found this thread with a fix and it involves setting the CMAKE_FIND_ROOT_PATH_MODE variables to BOTH to work. I've updated the PR with that.

I'll report back when I fix the TBB thing. But right now it works if you set the build mode to debug.

@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Apr 23, 2024

Okay, should be good now. TBB needs an extra arg called extra_inc=big_iron.inc that I had missed in the rebase.
Essentially it makes TBB become statically compiled, which is better for iOS anyway.

With the two changes above, USD for iOS should build as easily as

build_usd.py ~/usd --build-target iOS

dgovil added a commit to dgovil/USD that referenced this pull request Apr 23, 2024
This PR builds on the [Core iOS support PR](PixarAnimationStudios#2949) to add support for building the USD core for visionOS.

Thanks to Valentin Roussellet for the basis of the TBB patch.

It includes the following changes:

* Use CMake 3.28 (which adds visionOS support)
* Patch TBB to support visionOS. Note that clang requires new platforms to be provided via the target triplet.
* Add visionOS to the accepted platforms.

Note that  visionOS's SDK is called xros, much like how the iOS SDK is iphoneos for historical reasons.
@dgovil dgovil mentioned this pull request Apr 23, 2024
2 tasks
@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented May 21, 2024

@davidgyu I just added https://github.com/PixarAnimationStudios/OpenUSD/pull/2949/commits/3cc8aa4b88b551a70c3a464920d90731a8ebf7eewhich adds the CMake code signing attributes to the CMake arguments so that even dependencies get code signed during their build if code signing is enabled.

In theory it isn't strictly related to this PR (as it should have been happening for macOS as well) but this brings it inline here

thearperson pushed a commit to cloud-zeta/OpenUSD that referenced this pull request Jun 16, 2024
This PR builds on the [Core iOS support PR](PixarAnimationStudios#2949) to add support for building the USD core for visionOS.

Thanks to Valentin Roussellet for the basis of the TBB patch.

It includes the following changes:

* Use CMake 3.28 (which adds visionOS support)
* Patch TBB to support visionOS. Note that clang requires new platforms to be provided via the target triplet.
* Add visionOS to the accepted platforms.

Note that  visionOS's SDK is called xros, much like how the iOS SDK is iphoneos for historical reasons.
dgovil added 2 commits June 18, 2024 09:28
This PR adds **Core** iOS support to the OpenUSD project. This does not 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.
@dgovil
Copy link
Copy Markdown
Collaborator Author

dgovil commented Jun 18, 2024

Rebased on top of latest from dev

dgovil added a commit to dgovil/USD that referenced this pull request Jun 18, 2024
This PR builds on the [Core iOS support PR](PixarAnimationStudios#2949) to add support for building the USD core for visionOS.

Thanks to Valentin Roussellet for the basis of the TBB patch.

It includes the following changes:

* Use CMake 3.28 (which adds visionOS support)
* Patch TBB to support visionOS. Note that clang requires new platforms to be provided via the target triplet.
* Add visionOS to the accepted platforms.

Note that  visionOS's SDK is called xros, much like how the iOS SDK is iphoneos for historical reasons.
@jesschimein
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@pixar-oss pixar-oss closed this in 6589b16 Jul 25, 2024
@davidgyu davidgyu mentioned this pull request Oct 28, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants