From e9d447ac2ab3bf7369cd19917e2d01bca6f61f02 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Mon, 1 Sep 2025 13:53:15 -0700 Subject: [PATCH] fix: Use OpenBLAS for ARM64 Linux builds instead of Intel MKL --- .github/workflows/build-reusable.yml | 42 +++++++++++++++++----------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index 72b18dc..b022bc5 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -125,28 +125,36 @@ jobs: echo "OS: $(uname -a)" echo "CPU info: $(lscpu | head -5)" - # Install Intel MKL for DiskANN (supports both x86_64 and aarch64) - wget -q https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79153e0f-74d7-45af-b8c2-258941adf58a/intel-onemkl-2025.0.0.940.sh - sudo sh intel-onemkl-2025.0.0.940.sh -a --components intel.oneapi.lin.mkl.devel --action install --eula accept -s - source /opt/intel/oneapi/setvars.sh - echo "MKLROOT=/opt/intel/oneapi/mkl/latest" >> $GITHUB_ENV - - # Debug: Check MKL installation - echo "🔍 MKL Installation Check:" - ls -la /opt/intel/oneapi/mkl/latest/ || echo "MKL directory not found" - ls -la /opt/intel/oneapi/mkl/latest/lib/ || echo "MKL lib directory not found" - - # Set library paths based on architecture + # Install math library based on architecture ARCH=$(uname -m) - echo "🔍 Setting library paths for architecture: $ARCH" + echo "🔍 Setting up math library for architecture: $ARCH" + if [[ "$ARCH" == "x86_64" ]]; then + # Install Intel MKL for DiskANN on x86_64 + echo "📦 Installing Intel MKL for x86_64..." + wget -q https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79153e0f-74d7-45af-b8c2-258941adf58a/intel-onemkl-2025.0.0.940.sh + sudo sh intel-onemkl-2025.0.0.940.sh -a --components intel.oneapi.lin.mkl.devel --action install --eula accept -s + source /opt/intel/oneapi/setvars.sh + echo "MKLROOT=/opt/intel/oneapi/mkl/latest" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin" >> $GITHUB_ENV echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/oneapi/mkl/latest/lib/intel64" >> $GITHUB_ENV - echo "✅ Set x86_64 library paths" + echo "✅ Intel MKL installed for x86_64" + + # Debug: Check MKL installation + echo "🔍 MKL Installation Check:" + ls -la /opt/intel/oneapi/mkl/latest/ || echo "MKL directory not found" + ls -la /opt/intel/oneapi/mkl/latest/lib/ || echo "MKL lib directory not found" + elif [[ "$ARCH" == "aarch64" ]]; then - echo "LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/latest/linux/compiler/lib" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/oneapi/mkl/latest/lib" >> $GITHUB_ENV - echo "✅ Set ARM64 library paths" + # Use OpenBLAS for ARM64 (MKL installer not compatible with ARM64) + echo "📦 Installing OpenBLAS for ARM64..." + sudo apt-get install -y libopenblas-dev liblapack-dev + echo "✅ OpenBLAS installed for ARM64" + + # Debug: Check OpenBLAS installation + echo "🔍 OpenBLAS Installation Check:" + dpkg -l | grep openblas || echo "OpenBLAS package not found" + ls -la /usr/lib/aarch64-linux-gnu/openblas/ || echo "OpenBLAS directory not found" fi # Debug: Show final library paths