Skip to content

Commit 28ec108

Browse files
committed
Update conda build scripts
1 parent 51ffe83 commit 28ec108

File tree

4 files changed

+96
-20
lines changed

4 files changed

+96
-20
lines changed

conda-recipe-cf/bld.bat

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
33
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
44

55
"%PYTHON%" setup.py clean --all
6-
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
76

87
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
98
REM set DIR_HINT if directory exists
@@ -23,3 +22,32 @@ if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
2322
"%PYTHON%" setup.py install %SKBUILD_ARGS%
2423
if errorlevel 1 exit 1
2524
)
25+
26+
set "CC=icx"
27+
28+
set "CMAKE_GENERATOR=Ninja"
29+
:: Make CMake verbose
30+
set "VERBOSE=1"
31+
32+
set "CMAKE_ARGS=%CMAKE_ARGS%"
33+
34+
%PYTHON% -m build -w -n -x
35+
if %ERRORLEVEL% neq 0 exit 1
36+
37+
:: wheel file was renamed
38+
for /f %%f in ('dir /b /S .\dist') do (
39+
%PYTHON% -m pip install %%f ^
40+
--no-build-isolation ^
41+
--no-deps ^
42+
--only-binary :all: ^
43+
--no-index ^
44+
--prefix %PREFIX% ^
45+
-vv
46+
if %ERRORLEVEL% neq 0 exit 1
47+
)
48+
49+
:: Copy wheel package
50+
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
51+
copy dist\mkl_umath*.whl %WHEELS_OUTPUT_FOLDER%
52+
if errorlevel 1 exit 1
53+
)

conda-recipe-cf/build.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,24 @@ read -r GLIBC_MAJOR GLIBC_MINOR <<< "$(conda list '^sysroot_linux-64$' \
99
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
1010

1111
export CMAKE_GENERATOR="Ninja"
12-
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
12+
export CC=icx
13+
CMAKE_ARGS="${CMAKE_ARGS}
1314
14-
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
15-
# Install packages and assemble wheel package from built bits
16-
WHEELS_BUILD_ARGS="-p manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64"
17-
${PYTHON} setup.py install bdist_wheel ${WHEELS_BUILD_ARGS} ${SKBUILD_ARGS}
18-
cp dist/mkl_umath*.whl ${WHEELS_OUTPUT_FOLDER}
19-
else
20-
# Perform regular install
21-
${PYTHON} setup.py install ${SKBUILD_ARGS}
15+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
16+
${PYTHON} -m build -w -n -x
17+
18+
${PYTHON} -m wheel tags --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
19+
dist/mkl_umath*.whl
20+
21+
${PYTHON} -m pip install dist/mkl_umath*.whl \
22+
--no-build-isolation \
23+
--no-deps \
24+
--only-binary :all: \
25+
--no-index \
26+
--prefix "${PREFIX}" \
27+
-vv
28+
29+
# Copy wheel package
30+
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
31+
cp dist/mkl_umath*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
2232
fi

conda-recipe/bld.bat

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
33
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
44

55
"%PYTHON%" setup.py clean --all
6-
set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
76

87
FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
98
REM set DIR_HINT if directory exists
@@ -23,3 +22,32 @@ if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
2322
"%PYTHON%" setup.py install %SKBUILD_ARGS%
2423
if errorlevel 1 exit 1
2524
)
25+
26+
set "CC=icx"
27+
28+
set "CMAKE_GENERATOR=Ninja"
29+
:: Make CMake verbose
30+
set "VERBOSE=1"
31+
32+
set "CMAKE_ARGS=%CMAKE_ARGS%"
33+
34+
%PYTHON% -m build -w -n -x
35+
if %ERRORLEVEL% neq 0 exit 1
36+
37+
:: wheel file was renamed
38+
for /f %%f in ('dir /b /S .\dist') do (
39+
%PYTHON% -m pip install %%f ^
40+
--no-build-isolation ^
41+
--no-deps ^
42+
--only-binary :all: ^
43+
--no-index ^
44+
--prefix %PREFIX% ^
45+
-vv
46+
if %ERRORLEVEL% neq 0 exit 1
47+
)
48+
49+
:: Copy wheel package
50+
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
51+
copy dist\mkl_umath*.whl %WHEELS_OUTPUT_FOLDER%
52+
if errorlevel 1 exit 1
53+
)

conda-recipe/build.sh

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,24 @@ read -r GLIBC_MAJOR GLIBC_MINOR <<< "$(conda list '^sysroot_linux-64$' \
99
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
1010

1111
export CMAKE_GENERATOR="Ninja"
12-
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
12+
export CC=icx
13+
CMAKE_ARGS="${CMAKE_ARGS}
1314
14-
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
15-
# Install packages and assemble wheel package from built bits
16-
WHEELS_BUILD_ARGS="-p manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64"
17-
${PYTHON} setup.py install bdist_wheel ${WHEELS_BUILD_ARGS} ${SKBUILD_ARGS}
18-
cp dist/mkl_umath*.whl ${WHEELS_OUTPUT_FOLDER}
19-
else
20-
# Perform regular install
21-
${PYTHON} setup.py install ${SKBUILD_ARGS}
15+
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
16+
${PYTHON} -m build -w -n -x
17+
18+
${PYTHON} -m wheel tags --platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
19+
dist/mkl_umath*.whl
20+
21+
${PYTHON} -m pip install dist/mkl_umath*.whl \
22+
--no-build-isolation \
23+
--no-deps \
24+
--only-binary :all: \
25+
--no-index \
26+
--prefix "${PREFIX}" \
27+
-vv
28+
29+
# Copy wheel package
30+
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
31+
cp dist/mkl_umath*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
2232
fi

0 commit comments

Comments
 (0)