Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions .github/workflows/conda-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ jobs:
- name: Install conda-build
run: conda install conda-build

- name: Store conda paths as envs
shell: bash -el {0}
run: |
echo "CONDA_BLD=/usr/share/miniconda/conda-bld/linux-64/" >> $GITHUB_ENV
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE/" >> $GITHUB_ENV

- name: Build conda package
run: |
CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels"
Expand All @@ -71,16 +77,20 @@ jobs:
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: /usr/share/miniconda/conda-bld/linux-64/${{ env.PACKAGE_NAME }}-*.conda
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda

- name: Upload wheels artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl

build_windows:
runs-on: windows-latest

strategy:
matrix:
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
env:
conda-bld: C:\Miniconda\conda-bld\win-64\

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -115,14 +125,26 @@ jobs:
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0

- name: Store conda paths as envs
shell: bash -el {0}
run: |
echo "CONDA_BLD=C:\\Miniconda\\conda-bld\\win-64\\" >> $GITHUB_ENV
echo "WHEELS_OUTPUT_FOLDER=$GITHUB_WORKSPACE\\" >> $GITHUB_ENV

- name: Build conda package
run: conda build --no-test --python ${{ matrix.python }} -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels conda-recipe

- name: Upload artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
path: ${{ env.conda-bld }}${{ env.PACKAGE_NAME }}-*.conda
path: ${{ env.CONDA_BLD }}${{ env.PACKAGE_NAME }}-*.conda

- name: Upload wheels artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Wheels Python ${{ matrix.python }}
path: ${{ env.WHEELS_OUTPUT_FOLDER }}mkl_service-*.whl

test_linux:
needs: build_linux
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.5.0] (05/DD/2025)
## [2.5.1] (06/27/2025)

### Fixed
* Resolved import issue in the virtual environment which broke loading of MKL libs [gh-85](github.com/IntelPython/mkl-service/pull/85)

## [2.5.0] (06/03/2025)

### Added
* Added support for python 3.13 [gh-72](github.com/IntelPython/mkl-service/pull/72)
Expand Down
34 changes: 30 additions & 4 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@

@rem Remember to activate compiler, if needed
echo on
rem set CFLAGS=-I%PREFIX%\Library\include %CFLAGS%
rem set LDFLAGS=/LIBPATH:%PREFIX% %LDFLAGS%

set MKLROOT=%CONDA_PREFIX%
%PYTHON% -m pip install --no-build-isolation --no-deps .
if errorlevel 1 exit 1

"%PYTHON%" setup.py clean --all

:: Make CMake verbose
set "VERBOSE=1"

:: -wnx flags mean: --wheel --no-isolation --skip-dependency-check
%PYTHON% -m build -w -n -x
if %ERRORLEVEL% neq 0 exit 1

:: wheel file was renamed
for /f %%f in ('dir /b /S .\dist') do (
%PYTHON% -m pip install %%f ^
--no-build-isolation ^
--no-deps ^
--only-binary :all: ^
--no-index ^
--prefix %PREFIX% ^
-vv
if %ERRORLEVEL% neq 0 exit 1
)

:: Copy wheel package
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
copy dist\mkl_service*.whl %WHEELS_OUTPUT_FOLDER%
if %ERRORLEVEL% neq 0 exit 1
)
33 changes: 30 additions & 3 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
#!/bin/bash -x
#!/bin/bash
set -ex

# make sure that compiler has been sourced, if necessary
export MKLROOT=$CONDA_PREFIX

MKLROOT=$CONDA_PREFIX $PYTHON -m pip install --no-build-isolation --no-deps .
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"

${PYTHON} setup.py clean --all

# Make CMake verbose
export VERBOSE=1

# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
${PYTHON} -m build -w -n -x

${PYTHON} -m wheel tags --remove \
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
dist/mkl_service*.whl

${PYTHON} -m pip install dist/mkl_service*.whl \
--no-build-isolation \
--no-deps \
--only-binary :all: \
--no-index \
--prefix "${PREFIX}" \
-vv

# Copy wheel package
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
cp dist/mkl_service*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
fi
9 changes: 7 additions & 2 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "2.5.0" %}
{% set version = "2.5.1" %}
{% set buildnumber = 0 %}

package:
Expand All @@ -10,6 +10,8 @@ source:

build:
number: {{ buildnumber }}
script_env:
- WHEELS_OUTPUT_FOLDER
ignore_run_exports:
- blas
- mkl-service
Expand All @@ -19,12 +21,15 @@ requirements:
- {{ compiler('c') }}
host:
- python
- pip >=25.0
- setuptools >=77
- mkl-devel
- cython
- wheel >=0.45.1
- python-build >=1.2.2
run:
- python
- mkl
- {{ pin_compatible('mkl') }}

test:
requires:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=77", "Cython"]
requires = ["setuptools>=77", "Cython", "wheel>=0.45.1", "build>=1.2.2"]

[project]
authors = [
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@


import os
import sys
from os.path import join

import Cython.Build
Expand All @@ -38,13 +39,17 @@ def extensions():
"include_dirs": [join(mkl_root, "include")],
"library_dirs": [join(mkl_root, "lib"), join(mkl_root, "lib", "intel64")],
"libraries": ["mkl_rt"],
"rpaths": (
["$ORIGIN/../..", "$ORIGIN/../../.."] if sys.platform != "win32" else []
),
}
else:
raise ValueError("MKLROOT environment variable not set.")

mkl_include_dirs = mkl_info.get("include_dirs", [])
mkl_library_dirs = mkl_info.get("library_dirs", [])
mkl_libraries = mkl_info.get("libraries", ["mkl_rt"])
mkl_rpaths = mkl_info.get("rpaths", [])

defs = []
if any(["mkl_rt" in li for li in mkl_libraries]):
Expand All @@ -59,6 +64,7 @@ def extensions():
include_dirs=mkl_include_dirs,
libraries=mkl_libraries + (["pthread"] if os.name == "posix" else []),
library_dirs=mkl_library_dirs,
runtime_library_dirs=mkl_rpaths,
extra_compile_args=[
"-DNDEBUG"
# "-g", "-O2", "-Wall",
Expand All @@ -74,6 +80,7 @@ def extensions():
include_dirs=mkl_include_dirs,
library_dirs=mkl_library_dirs,
libraries=mkl_libraries,
runtime_library_dirs=mkl_rpaths,
extra_compile_args=[
"-DNDEBUG"
# "-g", "-O2", "-Wall",
Expand Down
Loading