From 032c348bfca15b9f2003b0a4399aea571345b39b Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:20:20 +0200 Subject: [PATCH 1/7] Align wheels build logic with internal CI --- conda-recipe/bld.bat | 16 ++++++++++++++-- conda-recipe/build.sh | 15 ++++++++++++++- conda-recipe/meta.yaml | 2 ++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index becc8af7..0306c7a1 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -1,3 +1,15 @@ set MKLROOT=%PREFIX% -%PYTHON% -m pip install --no-build-isolation --no-deps . -if errorlevel 1 exit 1 + +rem Workaround to remove spaces from the env value +set WHEELS_OUTPUT_FOLDER=%WHEELS_OUTPUT_FOLDER: =% +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_fft*.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 +) diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index d2a9c693..de7486ee 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -2,4 +2,17 @@ export MKLROOT=$PREFIX export CFLAGS="-I$PREFIX/include $CFLAGS" -$PYTHON -m pip install --no-build-isolation --no-deps . +export LDFLAGS="-Wl,-rpath,\$ORIGIN/../.. -Wl,-rpath,\$ORIGIN/../../.. -L${PREFIX}/lib ${LDFLAGS}" + +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 ${WHEELS_BUILD_TAG} mkl_fft*.whl + cp mkl_fft*.whl ${WHEELS_OUTPUT_FOLDER} +else + # Build conda package + $PYTHON -m pip install --no-build-isolation --no-deps . +fi diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 05222b19..b73a15ce 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -10,6 +10,8 @@ source: build: number: {{ buildnumber }} + script_env: + - WHEELS_OUTPUT_FOLDER ignore_run_exports: - blas From 93d6b4dc87bac4a4de1adbcc4c839dce9c60ffd9 Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:26:44 +0200 Subject: [PATCH 2/7] Add conda_build_config.yaml --- conda-recipe/conda_build_config.yaml | 16 ++++++++++++++++ conda-recipe/meta.yaml | 1 + 2 files changed, 17 insertions(+) create mode 100644 conda-recipe/conda_build_config.yaml diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml new file mode 100644 index 00000000..822fd77b --- /dev/null +++ b/conda-recipe/conda_build_config.yaml @@ -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] diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index b73a15ce..4af104fd 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -18,6 +18,7 @@ build: requirements: build: - {{ compiler('c') }} + - {{ stdlib('c') }} host: - python - setuptools >=77 From 7fdf4ae88292e76479eb668ac40ca8fb6ec7dd6d Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:29:22 +0200 Subject: [PATCH 3/7] Add pip and wheel to host --- conda-recipe/meta.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index 4af104fd..e73556e7 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -21,11 +21,13 @@ requirements: - {{ stdlib('c') }} host: - python + - pip - setuptools >=77 - mkl-devel - mkl-devel 2024.2.* # [py==39] - cython - numpy-base + - wheel >=0.41.3 run: - python - mkl-service From 0893762e66901c747e3129f1a086a924aefd3199 Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:31:48 +0200 Subject: [PATCH 4/7] Fix pre-commit test issues --- conda-recipe/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index de7486ee..fe489183 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -10,8 +10,8 @@ read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \ # 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 ${WHEELS_BUILD_TAG} mkl_fft*.whl - cp mkl_fft*.whl ${WHEELS_OUTPUT_FOLDER} + ${PYTHON} -m wheel tags --remove --platform-tag "${WHEELS_BUILD_TAG}" mkl_fft*.whl + cp mkl_fft*.whl "${WHEELS_OUTPUT_FOLDER}" else # Build conda package $PYTHON -m pip install --no-build-isolation --no-deps . From 45a52328881e14577a873188fc045d38a2bd5305 Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:38:21 +0200 Subject: [PATCH 5/7] Fix removing wheel tag --- conda-recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh index fe489183..f55643db 100644 --- a/conda-recipe/build.sh +++ b/conda-recipe/build.sh @@ -10,7 +10,7 @@ read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \ # 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 "${WHEELS_BUILD_TAG}" mkl_fft*.whl + ${PYTHON} -m wheel tags --remove --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" mkl_fft*.whl cp mkl_fft*.whl "${WHEELS_OUTPUT_FOLDER}" else # Build conda package From e98a981e5aaad3fd45791b049cfaf6fd21fb6572 Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:48:33 +0200 Subject: [PATCH 6/7] use vs2017 for the windows build --- conda-recipe/conda_build_config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml index 822fd77b..d6b54bb3 100644 --- a/conda-recipe/conda_build_config.yaml +++ b/conda-recipe/conda_build_config.yaml @@ -11,6 +11,6 @@ c_stdlib_version: # [linux] c_stdlib: # [win] - vs # [win] cxx_compiler: # [win] - - vs2022 # [win] + - vs2017 # [win] c_compiler: # [win] - - vs2022 # [win] + - vs2017 # [win] From 26edc86566fd5d8b7faff1f959132d3703ad5e8c Mon Sep 17 00:00:00 2001 From: "Komarova, Evseniia" Date: Mon, 11 Aug 2025 17:57:30 +0200 Subject: [PATCH 7/7] Fix windows build --- conda-recipe/bld.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat index 0306c7a1..3a1cbb81 100644 --- a/conda-recipe/bld.bat +++ b/conda-recipe/bld.bat @@ -1,7 +1,5 @@ set MKLROOT=%PREFIX% -rem Workaround to remove spaces from the env value -set WHEELS_OUTPUT_FOLDER=%WHEELS_OUTPUT_FOLDER: =% rem Build wheel package if NOT "%WHEELS_OUTPUT_FOLDER%"=="" ( %PYTHON% -m pip wheel --no-build-isolation --no-deps .