|
| 1 | +# Build Configuration Files |
| 2 | + |
| 3 | +## Core Build Files |
| 4 | +- `setup.py`: Main build script (500+ lines, complex configuration) |
| 5 | +- `pyproject.toml`: Python project metadata + linting configuration |
| 6 | +- `dependencies-dev`: Build-time dependencies (Cython, numpy, pybind11, cmake) |
| 7 | +- `requirements-test.txt`: Test dependencies with version constraints |
| 8 | +- `conda-recipe/meta.yaml`: Conda package build configuration |
| 9 | + |
| 10 | +## Environment Variables (Critical) |
| 11 | +```bash |
| 12 | +# MANDATORY for building |
| 13 | +export DALROOT=/path/to/onedal # oneDAL installation path (required) |
| 14 | + |
| 15 | +# OPTIONAL but commonly needed |
| 16 | +export MPIROOT=/path/to/mpi # MPI for distributed features |
| 17 | +export NO_DIST=1 # Disable distributed mode |
| 18 | +export NO_DPC=1 # Disable GPU/SYCL support |
| 19 | +export NO_STREAM=1 # Disable streaming mode |
| 20 | +export DEBUG_BUILD=1 # Debug symbols + no optimization |
| 21 | +export MAKEFLAGS=-j$(nproc) # Parallel build threads |
| 22 | +``` |
| 23 | + |
| 24 | +## Build Process (4 Stages) |
| 25 | +1. **Code Generation**: oneDAL C++ headers → Python/Cython sources |
| 26 | +2. **oneDAL Bindings**: cmake + pybind11 compilation |
| 27 | +3. **Cython Processing**: .pyx files → C++ sources |
| 28 | +4. **Final Compilation**: Link everything into Python extensions |
| 29 | + |
| 30 | +## Dependencies |
| 31 | +**Build Dependencies (dependencies-dev):** |
| 32 | +- Cython==3.1.1 (exact version required) |
| 33 | +- numpy>=2.0 (version varies by Python version) |
| 34 | +- pybind11==2.13.6 |
| 35 | +- cmake==4.0.2 |
| 36 | +- setuptools==79.0.1 |
| 37 | + |
| 38 | +**Runtime Dependencies:** |
| 39 | +- Intel oneDAL 2021.1+ (backwards compatible) |
| 40 | +- numpy (version-specific, see requirements-test.txt) |
| 41 | +- scikit-learn 1.0-1.7 (see compatibility matrix) |
| 42 | + |
| 43 | +## Build Commands |
| 44 | +```bash |
| 45 | +# Development build (RECOMMENDED) |
| 46 | +python setup.py develop # Creates .egg-link, editable |
| 47 | + |
| 48 | +# Production builds |
| 49 | +python setup.py install # Full install |
| 50 | +python setup.py build_ext --inplace --force # Extensions only |
| 51 | + |
| 52 | +# Special flags (Linux) |
| 53 | +python setup.py build --abs-rpath # Absolute RPATH for custom oneDAL |
| 54 | + |
| 55 | +# Conda build |
| 56 | +conda build . # Uses conda-recipe/meta.yaml |
| 57 | +``` |
| 58 | + |
| 59 | +## Common Build Issues |
| 60 | +```bash |
| 61 | +# oneDAL not found |
| 62 | +RuntimeError: "Not set DALROOT variable" |
| 63 | +→ Solution: export DALROOT=/path/to/onedal |
| 64 | + |
| 65 | +# MPI required but missing |
| 66 | +ValueError: "'MPIROOT' is not set, cannot build with distributed mode" |
| 67 | +→ Solution: export NO_DIST=1 or set MPIROOT |
| 68 | + |
| 69 | +# Cython version mismatch |
| 70 | +→ Solution: pip install Cython==3.1.1 (exact version) |
| 71 | + |
| 72 | +# Linking issues (Linux) |
| 73 | +→ Solution: Use --abs-rpath flag |
| 74 | +``` |
| 75 | + |
| 76 | +## CI/CD Configuration |
| 77 | +- **GitHub Actions**: `.github/workflows/ci.yml` |
| 78 | +- **Azure DevOps**: `.ci/pipeline/ci.yml` (main CI system) |
| 79 | +- **Pre-commit**: `.pre-commit-config.yaml` (code quality) |
| 80 | + |
| 81 | +Build timeouts: 120 minutes in CI (can be slow due to oneDAL compilation) |
0 commit comments