Skip to content

Commit 0a83a40

Browse files
committed
Align wheels build logic with internal CI
1 parent a88f334 commit 0a83a40

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

conda-recipe/bld.bat

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
@rem Remember to source the compiler
22

33
set MKLROOT=%CONDA_PREFIX%
4-
%PYTHON% -m pip install --no-build-isolation --no-deps .
5-
if errorlevel 1 exit 1
4+
5+
rem Build wheel package
6+
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
7+
%PYTHON% -m pip wheel --no-build-isolation --no-deps .
8+
if errorlevel 1 exit 1
9+
copy mkl_random*.whl %WHEELS_OUTPUT_FOLDER%
10+
if errorlevel 1 exit 1
11+
) ELSE (
12+
rem Build conda package
13+
%PYTHON% -m pip install --no-build-isolation --no-deps .
14+
if errorlevel 1 exit 1
15+
)

conda-recipe/build.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
#!/bin/bash -x
22

33
export CFLAGS="-I$PREFIX/include $CFLAGS"
4+
export LDFLAGS="-Wl,-rpath,\$ORIGIN/../.. -Wl,-rpath,\$ORIGIN/../../.. -L${PREFIX}/lib ${LDFLAGS}"
45
export MKLROOT=$CONDA_PREFIX
5-
$PYTHON -m pip install --no-build-isolation --no-deps .
6+
7+
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
8+
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
9+
10+
# Build wheel package
11+
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
12+
$PYTHON -m pip wheel --no-build-isolation --no-deps .
13+
${PYTHON} -m wheel tags --remove --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" mkl_random*.whl
14+
cp mkl_random*.whl ${WHEELS_OUTPUT_FOLDER}
15+
else
16+
# Build conda package
17+
$PYTHON -m pip install --no-build-isolation --no-deps .
18+
fi

conda-recipe/conda_build_config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
c_compiler: # [linux]
2+
- gcc # [linux]
3+
cxx_compiler: # [linux]
4+
- gxx # [linux]
5+
cxx_compiler_version: # [linux]
6+
- '14' # [linux]
7+
c_stdlib: # [linux]
8+
- sysroot # [linux]
9+
c_stdlib_version: # [linux]
10+
- '2.28' # [linux]
11+
c_stdlib: # [win]
12+
- vs # [win]
13+
cxx_compiler: # [win]
14+
- vs2022 # [win]
15+
c_compiler: # [win]
16+
- vs2022 # [win]

conda-recipe/meta.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ source:
1010

1111
build:
1212
number: {{buildnumber}}
13+
script_env:
14+
- WHEELS_OUTPUT_FOLDER
1315
ignore_run_exports:
1416
- blas
1517

@@ -24,6 +26,7 @@ requirements:
2426
- cython
2527
- numpy-base
2628
- pip
29+
- wheel >=0.41.3
2730
run:
2831
- python
2932
- {{ pin_compatible('mkl', min_pin="x.x", max_pin="x") }}

0 commit comments

Comments
 (0)