halide / Halide

a language for fast, portable data-parallel computation
https://halide-lang.org
Other
5.91k stars 1.07k forks source link

Support CMAKE_OSX_ARCHITECTURES #8390

Closed alexreinking closed 2 months ago

alexreinking commented 3 months ago

As requested at the last Halide dev meeting, I have drafted an implementation of support for CMAKE_OSX_ARCHITECTURES. This is again quite complicated, in part because I attempted to avoid breaking existing user code.

As it stands, multi-target alternative selection and feature specification are stepping on each others' toes.

I'll write more tomorrow.

Fixes #8134


Breaking suggestion:

What this doesn't resolve is how to do things like TARGETS cmake-no_bounds_query cmake effectively. Perhaps the following adjustments to the above help:

Specifying an empty entry in FEATURES/MULTITARGET or whatever is challenging in CMake because it really wants to drop empty function arguments. We might need to add a dummy feature like none (either in the actual Generator or just in the build system) that does nothing but isn't the empty string.

alexreinking commented 3 months ago

Topics for discussion at the dev meeting:

  1. How to test this on CI?
  2. How to test build sanity on iOS?
alexreinking commented 3 months ago

Finally, we have a clean build! The halide-asan test failure is due to an LLVM build bug that was fixed in a revert five days ago. Marking this as Ready for Review.

@derek-gerstmann -- I'd appreciate some help testing offline.

derek-gerstmann commented 3 months ago

Testing on my MacBook Pro M1 Max and everything appears to work! I agree, it'd be nice to find a testing strategy for both desktop and mobile.

alexreinking commented 3 months ago

From dev meeting:

alexreinking commented 2 months ago

This is ready on my end. @steven-johnson -- we should coordinate adding testing to the buildbots. Should we wait to land this until we have that?

steven-johnson commented 2 months ago

This is ready on my end. @steven-johnson -- we should coordinate adding testing to the buildbots. Should we wait to land this until we have that?

yes, probably

alexreinking commented 2 months ago

Is there documentation/README for this anywhere...?

No, not yet

alexreinking commented 2 months ago

Landing this with the caveat that it might need adjustment to support IOS cross-compilation via Xcode. At the moment it seems to have not broken existing workflows and has (locally) enabled universal builds on macOS.