Skip to content

Align wheels build logic with internal CI #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 12 additions & 2 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
@rem Remember to source the compiler

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

rem Build wheel package
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
%PYTHON% -m pip wheel --no-build-isolation --no-deps .
if errorlevel 1 exit 1
copy mkl_random*.whl %WHEELS_OUTPUT_FOLDER%
if errorlevel 1 exit 1
) ELSE (
rem Build conda package
%PYTHON% -m pip install --no-build-isolation --no-deps .
if errorlevel 1 exit 1
)
15 changes: 14 additions & 1 deletion conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
#!/bin/bash -x

export CFLAGS="-I$PREFIX/include $CFLAGS"
export LDFLAGS="-Wl,-rpath,\$ORIGIN/../.. -Wl,-rpath,\$ORIGIN/../../.. -L${PREFIX}/lib ${LDFLAGS}"
export 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' ' ')"

# Build wheel package
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
$PYTHON -m pip wheel --no-build-isolation --no-deps .
${PYTHON} -m wheel tags --remove --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" mkl_random*.whl
cp mkl_random*.whl ${WHEELS_OUTPUT_FOLDER}
else
# Build conda package
$PYTHON -m pip install --no-build-isolation --no-deps .
fi
16 changes: 16 additions & 0 deletions conda-recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
c_compiler: # [linux]
- gcc # [linux]
cxx_compiler: # [linux]
- gxx # [linux]
cxx_compiler_version: # [linux]
- '14' # [linux]
c_stdlib: # [linux]
- sysroot # [linux]
c_stdlib_version: # [linux]
- '2.28' # [linux]
c_stdlib: # [win]
- vs # [win]
cxx_compiler: # [win]
- vs2022 # [win]
c_compiler: # [win]
- vs2022 # [win]
13 changes: 13 additions & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@ source:

build:
number: {{buildnumber}}
script_env:
- WHEELS_OUTPUT_FOLDER
ignore_run_exports:
- blas

requirements:
build:
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
host:
- python
- setuptools >=77
- mkl-devel
- cython
- numpy-base
- pip
- wheel >=0.41.3
run:
- python
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }}
Expand All @@ -43,3 +47,12 @@ about:
license: BSD-3-Clause
license_file: LICENSE.txt
summary: NumPy-based implementation of random number generation sampling using Intel (R) Math Kernel Library, mirroring numpy.random, but exposing all choices of sampling algorithms available in MKL.
description: |
<strong>LEGAL NOTICE: Use of this software package is subject to the
software license agreement (as set forth above, in the license section of
the installed Conda package and/or the README file) and all notices,
disclaimers or license terms for third party or open source software
included in or with the software.</strong>
<br/><br/>
EULA: <a href="https://opensource.org/licenses/BSD-3-Clause" target="_blank">BSD-3-Clause</a>
<br/><br/>
Loading