Skip to content

Conda build scripts should build wheels in the same setup invocation … #538

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

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

rem Build wheel package
if NOT "%WHEELS_OUTPUT_FOLDER%"=="" (
%PYTHON% setup.py bdist_wheel
rem Install and assemble wheel package from the build bits
"%PYTHON%" setup.py %INSTALL_CMD% bdist_wheel
if errorlevel 1 exit 1
copy dist\dpctl*.whl %WHEELS_OUTPUT_FOLDER%
if errorlevel 1 exit 1
) ELSE (
rem Only install
"%PYTHON%" setup.py %INSTALL_CMD%
if errorlevel 1 exit 1
)
23 changes: 9 additions & 14 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
#!/bin/bash

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

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