Skip to content

Commit 826a330

Browse files
Replace use of -c intel channel, replace use of -c main
Introduce conda-recipe-cf which does not depend on numpy-base. Use it in conda-packages workflow to enable building for wider range of Python versions than what is included in IDP.
1 parent 8fcf5e4 commit 826a330

File tree

7 files changed

+114
-10
lines changed

7 files changed

+114
-10
lines changed

.github/workflows/conda-package.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python: ['3.10']
14+
python: ['3.10', '3.11', '3.12']
1515
steps:
1616
- uses: actions/checkout@v3
1717
with:
@@ -38,15 +38,15 @@ jobs:
3838
run: conda install conda-build
3939
- name: Build conda package
4040
run: |
41-
CHANNELS="-c conda-forge -c intel --override-channels"
41+
CHANNELS="-c conda-forge -c https://software.repos.intel.com/python/conda --override-channels"
4242
VERSIONS="--python ${{ matrix.python }}"
4343
TEST="--no-test"
4444
4545
conda build \
4646
$TEST \
4747
$VERSIONS \
4848
$CHANNELS \
49-
conda-recipe
49+
conda-recipe-cf
5050
- name: Upload artifact
5151
uses: actions/upload-artifact@v3
5252
with:
@@ -59,12 +59,12 @@ jobs:
5959

6060
strategy:
6161
matrix:
62-
python: ['3.10']
62+
python: ['3.10', '3.11', '3.12']
6363
experimental: [false]
6464
runner: [ubuntu-latest]
6565
continue-on-error: ${{ matrix.experimental }}
6666
env:
67-
CHANNELS: -c intel -c main --override-channels
67+
CHANNELS: -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels
6868

6969
steps:
7070
- name: Download artifact
@@ -121,7 +121,7 @@ jobs:
121121

122122
strategy:
123123
matrix:
124-
python: ['3.10']
124+
python: ['3.10', '3.11', '3.12']
125125
env:
126126
conda-bld: C:\Miniconda\conda-bld\win-64\
127127
steps:
@@ -147,7 +147,7 @@ jobs:
147147
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
148148
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
149149
- name: Build conda package
150-
run: conda build --no-test --python ${{ matrix.python }} -c intel -c conda-forge --override-channels conda-recipe
150+
run: conda build --no-test --python ${{ matrix.python }} -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels conda-recipe-cf
151151
- name: Upload artifact
152152
uses: actions/upload-artifact@v3
153153
with:
@@ -162,13 +162,13 @@ jobs:
162162
shell: cmd /C CALL {0}
163163
strategy:
164164
matrix:
165-
python: ['3.10']
165+
python: ['3.10', '3.11', '3.12']
166166
experimental: [false]
167167
runner: [windows-latest]
168168
continue-on-error: ${{ matrix.experimental }}
169169
env:
170170
workdir: '${{ github.workspace }}'
171-
CHANNELS: -c intel -c conda-forge --override-channels
171+
CHANNELS: -c conda-forge -c https://software.repos.intel.com/python/conda --override-channels
172172

173173
steps:
174174
- name: Download artifact

conda-recipe-cf/bld.bat

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
2+
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
3+
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
4+
5+
"%PYTHON%" setup.py clean --all
6+
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
7+
8+
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
9+
REM set DIR_HINT if directory exists
10+
IF EXIST "%BUILD_PREFIX%\Library\lib\clang\%%V\" (
11+
SET "SYCL_INCLUDE_DIR_HINT=%BUILD_PREFIX%\Library\lib\clang\%%V"
12+
)
13+
)
14+
15+
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
16+
rem Install and assemble wheel package from the build bits
17+
"%PYTHON%" setup.py install bdist_wheel %SKBUILD_ARGS%
18+
if errorlevel 1 exit 1
19+
copy dist\mkl_umath*.whl %WHEELS_OUTPUT_FOLDER%
20+
if errorlevel 1 exit 1
21+
) ELSE (
22+
rem Only install
23+
"%PYTHON%" setup.py install %SKBUILD_ARGS%
24+
if errorlevel 1 exit 1
25+
)

conda-recipe-cf/build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix
2+
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${BUILD_PREFIX}/lib"
3+
4+
# Intel LLVM must cooperate with compiler and sysroot from conda
5+
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icx_for_conda.cfg
6+
export ICXCFG="$(pwd)/icx_for_conda.cfg"
7+
8+
export CMAKE_GENERATOR="Ninja"
9+
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
10+
11+
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
12+
# Install packages and assemble wheel package from built bits
13+
if [ "$CONDA_PY" == "36" ]; then
14+
WHEELS_BUILD_ARGS="-p manylinux1_x86_64"
15+
else
16+
WHEELS_BUILD_ARGS="-p manylinux2014_x86_64"
17+
fi
18+
${PYTHON} setup.py install bdist_wheel ${WHEELS_BUILD_ARGS} ${SKBUILD_ARGS}
19+
cp dist/mkl_umath*.whl ${WHEELS_OUTPUT_FOLDER}
20+
else
21+
# Perform regular install
22+
${PYTHON} setup.py install ${SKBUILD_ARGS}
23+
fi

conda-recipe-cf/meta.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{% set version = "0.1.2" %}
2+
{% set buildnumber = 0 %}
3+
4+
package:
5+
name: mkl_umath
6+
version: {{ version }}
7+
8+
source:
9+
path: ../
10+
11+
build:
12+
number: {{ buildnumber }}
13+
ignore_run_exports:
14+
- blas
15+
16+
requirements:
17+
build:
18+
- {{ compiler('c') }}
19+
- {{ compiler('cxx') }}
20+
- {{ compiler('dpcpp') }} >=2024.2 # [not osx]
21+
- sysroot_linux-64 >=2.28 # [linux]
22+
host:
23+
- setuptools
24+
- cmake
25+
- ninja
26+
- git
27+
- cython
28+
- scikit-build
29+
- python
30+
- mkl-devel
31+
- numpy
32+
run:
33+
- python
34+
- mkl
35+
- mkl-service
36+
- {{ pin_compatible('intel-cmplr-lib-rt') }}
37+
38+
test:
39+
requires:
40+
- pytest
41+
source_files:
42+
- mkl_umath/tests/test_basic.py
43+
commands:
44+
- pytest mkl_umath/tests/test_basic.py
45+
imports:
46+
- mkl_umath
47+
- mkl_umath._ufuncs
48+
- mkl_umath._patch
49+
50+
about:
51+
home: http://github.com/IntelPython/mkl_umath
52+
license: BSD-3
53+
license_file: LICENSE.txt
54+
summary: Universal functions for real and complex floating point arrays powered by Intel(R) Math Kernel Library Vector (Intel(R) MKL) and Intel(R) Short Vector Math Library (Intel(R) SVML)

conda-recipe-cf/run_tests.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
%PYTHON% tests\test_basic.py

conda-recipe-cf/run_tests.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON tests/test_basic.py

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ requirements:
1717
build:
1818
- {{ compiler('c') }}
1919
- {{ compiler('cxx') }}
20-
- {{ compiler('dpcpp') }} >=2023.2 # [not osx]
20+
- {{ compiler('dpcpp') }} >=2024.2 # [not osx]
2121
- sysroot_linux-64 >=2.28 # [linux]
2222
host:
2323
- setuptools

0 commit comments

Comments
 (0)