You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the master tracking issue for the Make → Bazel migration in oneDAL. The goal is to achieve full feature parity with the existing Make build system while leveraging Bazel's advantages for hermetic builds, caching, and scalability.
Migration Goals
Full Make Parity: All build targets, configurations, and platforms supported
No Regressions: Performance, binary size, and API compatibility maintained
Hermetic Builds: Reproducible builds with explicit dependencies
Custom $CXXFLAGS: Make allows injecting arbitrary compiler flags via environment; Bazel needs an equivalent escape hatch
Impact: Without parity here, developers cannot reproduce Make debug/sanitizer builds in Bazel. This is a blocker for fully replacing Make in developer workflows.
Solution Required:
Audit all Make build options (--mode=debug, --with-sanitizer, etc.)
Map each to Bazel equivalents (--compilation_mode=dbg, --features=asan, custom copts)
Expose user-facing flags via config_setting or .bazelrc configs
Problem: There is no comprehensive documentation covering:
How to build oneDAL with Bazel (basic usage)
Available build configurations and flags
Platform-specific notes (Linux, Windows, macOS)
Migration guide: Make flag → Bazel equivalent
How to integrate the Bazel build in downstream projects
Impact: Without documentation, contributors and downstream consumers cannot adopt the Bazel build system even if it is technically complete. This is a blocker for deprecating Make.
Equivalent to: Make CORE.ALGORITHMS.CUSTOM=pca kmeans svm ...
Problem: Make supports building the library with only a specific subset of
algorithms (CORE.ALGORITHMS.CUSTOM), producing a smaller .so/.a. This is
useful for distribution packages targeting specific workloads.
In Bazel today:
Building/testing individual algorithms works natively: bazel test //cpp/oneapi/dal/algo/svm:tests ✅
But //:release always includes all algorithms — no filtering ❌
Solution Required:
Add --algorithms flag (Bazel string_list_flag) to config.tpl.BUILD
Filter srcs in daal.bzl / dal.bzl using select() based on the flag
//:release respects --algorithms to produce a trimmed library
Status: Deferred to Phase 1
Testing Strategy
Unit Testing: Existing tests must pass on Bazel builds
Binary Compatibility: Symbol exports match Make builds
Overview
This is the master tracking issue for the Make → Bazel migration in oneDAL. The goal is to achieve full feature parity with the existing Make build system while leveraging Bazel's advantages for hermetic builds, caching, and scalability.
Migration Goals
Current Status
Completed
In Progress (Open PRs)
libonedal_core.ano longer contains MKL (open, in review)-fvisibility=hidden,__DAAL_IMPLEMENTATION,__ONEDAL_ENABLE_EXPORT__) (merged)//:releasetarget (open)dev/bazel/README.md) (open)Critical Blockers
BLOCKER 1: MKL Linkage Strategy Enforcement✅ ResolvedProblem: Bazel build needed to:
--exclude-libs).a) MKL-free (user provides at link time)Solution (PR #3519 + PR #3532):
alwayslink=Trueon MKL +--exclude-libshides symbols → 0 exported MKL symbolsmkl_embedlib_tag separates MKL from static link path → no MKL in.aResult:
libonedal_core.alibonedal_core.soBLOCKER 2: Static Artifact Size Bloat
Problem: Bazel-built static libraries are 2× larger than Make equivalents.
Example (
libonedal_core.a):Root Cause: MKL static libs pulled in without symbol pruning. Make build uses partial linking + LTO to strip unused symbols.
Impact:
Solution Required:
-flto)-Wl,--gc-sections)Status: Deferred to Phase 1 (accept bloat for now, optimize later)
BLOCKER 3: ICX/DPC++ Toolchain Consolidation
Problem: Make build uses different compilers for different targets:
icxfor CPU-only codeicpx(DPC++) for SYCL codeBazel currently uses single toolchain. Need to verify:
Impact: Potential performance regression or SYCL build failures
Solution Required:
Status: Not yet tested on Bazel build
BLOCKER 4: Windows MSVC Symbol Hiding
Problem: Windows doesn't support
--exclude-libs. Make build uses:/WHOLEARCHIVE,/DEF)Bazel Linux build uses
--exclude-libswhich doesn't work on Windows.Impact: MKL symbols leak on Windows, breaking ABI compatibility
Solution Required:
__declspec(dllexport)attributes (preferred)Status: Design phase, Windows builds not yet tested
Secondary Issues (Post-Blocker)
Release Layout Parity
Make build produces specific directory structure:
Bazel currently outputs flat structure. Need to match for compatibility with existing installers/scripts.
Multi-ISA Verification
Make build supports runtime CPU dispatch (SSE2, AVX2, AVX512). Need to verify:
RISC-V/ARM + OpenBLAS Fallback
Make build has experimental RISC-V support with OpenBLAS (when MKL unavailable). Bazel migration should preserve this path.
Build Time Benchmarking
Need to measure:
Target: Bazel should be faster on incremental builds.
Library Versioning & Packaging
Make build generates:
pkg-configfilesvars.sh,vars.bat)libonedal.so.1,libonedal.so.1.2.3)Bazel migration must preserve these for downstream compatibility.
ARM Platform Support
Make build supports ARM64 (Linux, macOS). Need to test Bazel cross-compilation and native builds.
BLOCKER 5: Build Options Parity (debug symbols, sanitizers, optimization levels, custom flags)
Raised by: @david-cortes-intel
Problem: Make build supports a range of build-time options that must be available in Bazel:
-g/-g0control (debug vs release builds)-fsanitize=address), UBSan, ThreadSanitizer — used in CI and developer testing-O0/-O2/-O3/ custom per-target$CXXFLAGS: Make allows injecting arbitrary compiler flags via environment; Bazel needs an equivalent escape hatchImpact: Without parity here, developers cannot reproduce Make debug/sanitizer builds in Bazel. This is a blocker for fully replacing Make in developer workflows.
Solution Required:
--mode=debug,--with-sanitizer, etc.)--compilation_mode=dbg,--features=asan, customcopts)config_settingor.bazelrcconfigsStatus: Implemented in PR #3538 (Pending Review)
BLOCKER 6: Bazel Build Documentation
Raised by: @david-cortes-intel
Problem: There is no comprehensive documentation covering:
Impact: Without documentation, contributors and downstream consumers cannot adopt the Bazel build system even if it is technically complete. This is a blocker for deprecating Make.
Solution Required:
docs/bazel-build.md(or equivalent) covering:Status: Implemented in PR #3538 (Pending Review)
Per-Algorithm Build Selection
Equivalent to: Make
CORE.ALGORITHMS.CUSTOM=pca kmeans svm ...Problem: Make supports building the library with only a specific subset of
algorithms (
CORE.ALGORITHMS.CUSTOM), producing a smaller.so/.a. This isuseful for distribution packages targeting specific workloads.
In Bazel today:
bazel test //cpp/oneapi/dal/algo/svm:tests✅//:releasealways includes all algorithms — no filtering ❌Solution Required:
--algorithmsflag (Bazelstring_list_flag) toconfig.tpl.BUILDsrcsindaal.bzl/dal.bzlusingselect()based on the flag//:releaserespects--algorithmsto produce a trimmed libraryStatus: Deferred to Phase 1
Testing Strategy
Open PRs
| #3513 | Release structure (versioning, SONAME, vars.sh, pkg-config) | 🔄 Open |
| #3532 | MKL static lib embedding fix — no MKL in
.a| 🔄 Open, in review || #3537 | ISA coverage via cfg transition on
//:release| 🔄 Open || #3538 | Debug/sanitizer configs + build documentation | 🔄 Open |
Merged PRs
-fvisibility=hidden) ✅