Skip to content

Commit 4b5a3e2

Browse files
Conda build scripts should build wheels in the same setup invocation as install
Using ``` python setup.py cmd1 opts1 cmd2 opts ... ```
1 parent ab0faea commit 4b5a3e2

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

conda-recipe/bld.bat

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
44
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"
55

66
"%PYTHON%" setup.py clean --all
7-
"%PYTHON%" setup.py install --sycl-compiler-prefix=%BUILD_PREFIX%\Library
8-
if errorlevel 1 exit 1
7+
set "INSTALL_CMD=install --sycl-compiler-prefix=%BUILD_PREFIX%\Library"
98

10-
rem Build wheel package
119
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
12-
%PYTHON% setup.py bdist_wheel
10+
rem Install and assemble wheel package from the build bits
11+
"%PYTHON%" setup.py "%INSTALL_CMD%" bdist_wheel
1312
if errorlevel 1 exit 1
14-
copy dist\dpctl*.whl %WHEELS_OUTPUT_FOLDER%
13+
copy dist\dpctl*.whl "%WHEELS_OUTPUT_FOLDER%"
14+
if errorlevel 1 exit 1
15+
) ELSE (
16+
rem Only install
17+
"%PYTHON%" setup.py "%INSTALL_CMD%"
1518
if errorlevel 1 exit 1
1619
)

conda-recipe/build.sh

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

33
${PYTHON} setup.py clean --all
4-
${PYTHON} setup.py install --sycl-compiler-prefix=$CONDA_PREFIX
4+
INSTALL_CMD="install --sycl-compiler-prefix=$CONDA_PREFIX"
55

6-
# Build wheel package
7-
if [ "$CONDA_PY" == "36" ]; then
8-
WHEELS_BUILD_ARGS="-p manylinux1_x86_64"
9-
else
10-
WHEELS_BUILD_ARGS="-p manylinux2014_x86_64"
11-
fi
126
if [ -n "${WHEELS_OUTPUT_FOLDER}" ]; then
13-
# We need dpcpp to compile dpctl_sycl_interface
14-
if [ ! -z "${ONEAPI_ROOT}" ]; then
15-
# Suppress error b/c it could fail on Ubuntu 18.04
16-
source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh || true
7+
# Install packages and assemble wheel package from built bits
8+
if [ "$CONDA_PY" == "36" ]; then
9+
WHEELS_BUILD_ARGS="-p manylinux1_x86_64"
1710
else
18-
echo "DPCPP is needed to build DPCTL. Abort!"
19-
exit 1
11+
WHEELS_BUILD_ARGS="-p manylinux2014_x86_64"
2012
fi
21-
$PYTHON setup.py bdist_wheel ${WHEELS_BUILD_ARGS}
13+
${PYTHON} setup.py ${INSTALL_CMD} bdist_wheel ${WHEELS_BUILD_ARGS}
2214
cp dist/dpctl*.whl ${WHEELS_OUTPUT_FOLDER}
15+
else
16+
# Perform regular install
17+
${PYTHON} setup.py ${INSTALL_CMD}
2318
fi

0 commit comments

Comments
 (0)