Skip to content

Commit 99d4540

Browse files
committed
Update conda build scripts
1 parent 51ffe83 commit 99d4540

File tree

4 files changed

+84
-34
lines changed

4 files changed

+84
-34
lines changed

conda-recipe-cf/bld.bat

Lines changed: 23 additions & 8 deletions
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
@@ -12,14 +11,30 @@ FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
1211
)
1312
)
1413

14+
set "CC=icx"
15+
16+
set "CMAKE_GENERATOR=Ninja"
17+
:: Make CMake verbose
18+
set "VERBOSE=1"
19+
20+
set "CMAKE_ARGS=%CMAKE_ARGS%"
21+
22+
%PYTHON% -m build -w -n -x
23+
if %ERRORLEVEL% neq 0 exit 1
24+
25+
for /f %%f in ('dir /b /S .\dist') do (
26+
%PYTHON% -m pip install %%f ^
27+
--no-build-isolation ^
28+
--no-deps ^
29+
--only-binary :all: ^
30+
--no-index ^
31+
--prefix %PREFIX% ^
32+
-vv
33+
if %ERRORLEVEL% neq 0 exit 1
34+
)
35+
36+
:: Copy wheel package
1537
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
1938
copy dist\mkl_umath*.whl %WHEELS_OUTPUT_FOLDER%
2039
if errorlevel 1 exit 1
21-
) ELSE (
22-
rem Only install
23-
"%PYTHON%" setup.py install %SKBUILD_ARGS%
24-
if errorlevel 1 exit 1
2540
)

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: 23 additions & 8 deletions
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
@@ -12,14 +11,30 @@ FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
1211
)
1312
)
1413

14+
set "CC=icx"
15+
16+
set "CMAKE_GENERATOR=Ninja"
17+
:: Make CMake verbose
18+
set "VERBOSE=1"
19+
20+
set "CMAKE_ARGS=%CMAKE_ARGS%"
21+
22+
%PYTHON% -m build -w -n -x
23+
if %ERRORLEVEL% neq 0 exit 1
24+
25+
for /f %%f in ('dir /b /S .\dist') do (
26+
%PYTHON% -m pip install %%f ^
27+
--no-build-isolation ^
28+
--no-deps ^
29+
--only-binary :all: ^
30+
--no-index ^
31+
--prefix %PREFIX% ^
32+
-vv
33+
if %ERRORLEVEL% neq 0 exit 1
34+
)
35+
36+
:: Copy wheel package
1537
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
1938
copy dist\mkl_umath*.whl %WHEELS_OUTPUT_FOLDER%
2039
if errorlevel 1 exit 1
21-
) ELSE (
22-
rem Only install
23-
"%PYTHON%" setup.py install %SKBUILD_ARGS%
24-
if errorlevel 1 exit 1
2540
)

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)