macOS: Only build OneDalNative when oneDAL headers & libs are configured (fixes macOS x64 build) #7500
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
macOS: Only build OneDalNative when oneDAL headers & libs are configured (fixes macOS x64 build)
Problem
On macOS x64, building
src/Native
fails with:The oneDAL “devel” (headers) package is not available via NuGet for
osx-x64
, so locallyONEDAL_DEVEL_PATH
is not present andOneDalNative
cannot compile. Today the native CMake unconditionally includesOneDalNative
on x64, which makes a default macOS developer build fail.What this PR changes
add_subdirectory(OneDalNative)
behind explicit configuration:OneDalNative
when bothONEDAL_DEVEL_PATH
andONEDAL_REDIST_PATH
are defined and${ONEDAL_DEVEL_PATH}/include/daal.h
exists.message(STATUS ...)
and skipOneDalNative
.Why this is safe
ONEDAL_*
continue to buildOneDalNative
unchanged.OneDalNative
.build.sh
are required. The script already sets-DONEDAL_*
only when callers pass the corresponding command-line switches.Repro (before)
Behavior (after)
ONEDAL_*
not provided: CMake printsSkipping OneDalNative: ONEDAL_DEVEL_PATH/ONEDAL_REDIST_PATH not set
and the rest builds fine.ONEDAL_*
provided and${ONEDAL_DEVEL_PATH}/include/daal.h
exists:OneDalNative
builds as before.Test matrix
OneDalNative
skipped by default; other native targets build.OneDalNative
(arch guard); behavior unchanged.ONEDAL_*
are set (as in existing pipelines), behavior unchanged andOneDalNative
builds.Notes
SymSgdNative
. On macOS x64, developers who needSymSgdNative
can use Homebrew LLVM (brew install llvm libomp
) or provide appropriate OpenMP flags; that is orthogonal to oneDAL headers availability.-DMLNET_BUILD_ONEDAL=ON/OFF
flag for stricter control if maintainers prefer.