Skip to content

Latest commit

 

History

History
225 lines (153 loc) · 3.87 KB

File metadata and controls

225 lines (153 loc) · 3.87 KB

Installation Guide

This guide walks you through installing KortexDL Framework on your system.


Prerequisites

Required

  • Operating System: Linux (Ubuntu 20.04+, CentOS 8+) or macOS
  • Intel oneAPI Toolkit 2025.2+: Includes MKL and Intel C++ Compiler
  • CMake 3.20+: Build system
  • Python 3.8+: Required for Python bindings
  • Git: For cloning the repository

Recommended

  • GCC 12+ or Clang 15+: Alternative to Intel ICX compiler
  • 4GB+ RAM: For building and running examples
  • 8+ CPU cores: For parallel compilation

Step 1: Install Intel oneAPI

KortexDL requires Intel's Math Kernel Library (MKL) for optimized performance.

Download Intel oneAPI

Visit: https://www.intel.com/content/www/us/en/developer/tools/oneapi/base-toolkit-download.html

Select your platform and download the installer.

Install on Linux

# Download installer (example for 2025.2)
wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/[...]/intel-cpp-essentials-2025.2.sh

# Run installer
chmod +x intel-cpp-essentials-2025.2.sh
sudo ./intel-cpp-essentials-2025.2.sh

# Source environment (add to ~/.bashrc for persistence)
source ~/intel/oneapi/setvars.sh

Verify Installation

# Check compiler
icpx --version

# Check MKL
echo $MKLROOT
# Should output: /path/to/intel/oneapi/mkl/latest

Step 2: Clone KortexDL

cd ~/Projects
git clone https://github.com/Mostafasaad1/kortexdl.git
cd kortexdl

Step 3: Build C++ Library

Configure with CMake

# Source Intel oneAPI environment
source ~/intel/oneapi/setvars.sh

# Create build directory
mkdir build && cd build

# Configure (using Intel ICX compiler)
cmake .. \\
  -DCMAKE_CXX_COMPILER=icpx \\
  -DCMAKE_C_COMPILER=icx \\
  -DCMAKE_BUILD_TYPE=Release

# Alternative: Use GCC
cmake .. \\
  -DCMAKE_CXX_COMPILER=g++-12 \\
  -DCMAKE_BUILD_TYPE=Release

Build

# Build all targets
cmake --build . -j$(nproc)

# Or build specific target
cmake --build . --target nn_common -j$(nproc)

Verify Build

# Run a simple example
./examples/linear_function_examples/regression_example

Step 4: Build Python Bindings (Optional)

Install Python Dependencies

pip install pybind11 numpy pytest

Build Bindings

cd build
cmake .. -DBUILD_PYTHON_BINDINGS=ON
cmake --build . --target _kortexdl_core -j$(nproc)

Test Python Import

cd ..
export PYTHONPATH=$PWD/build:$PYTHONPATH
python3 -c "import _kortexdl_core as bd; print('Success!', dir(bd))"

Step 5: Run Tests

C++ Tests

cd build
ctest --output-on-failure

Python Tests

cd python_bindings
PYTHONPATH=../build pytest tests/ -v

Troubleshooting

Issue: icpx: command not found

Solution: Source Intel oneAPI environment

source ~/intel/oneapi/setvars.sh

Issue: MKL not found

Solution: Verify MKLROOT is set

echo $MKLROOT
# If empty, source setvars.sh

Issue: Python binding import fails

Solution: Check PYTHONPATH includes build directory

export PYTHONPATH=/path/to/kortexdl/build:$PYTHONPATH

Issue: CMake can't find pybind11

Solution: Install pybind11 via pip

pip install pybind11

Next Steps


Platform-Specific Notes

macOS

Intel oneAPI MKL is supported on macOS. Use Homebrew for dependencies:

brew install cmake python3

Ubuntu 20.04+

Install build essentials:

sudo apt-get update
sudo apt-get install build-essential cmake python3-dev

CentOS 8+

sudo dnf groupinstall "Development Tools"
sudo dnf install cmake python3-devel

For issues, please report at: https://github.com/Mostafasaad1/kortexdl/issues