Skip to content

Commit 50979ea

Browse files
authored
Use dpcpp compiler package for Linux (#514)
* Keep using oneAPI for wheel * Pass CONDA_PREFIX as path to SYCL compiler prefix
1 parent 7bcbc2f commit 50979ea

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

conda-recipe/build.sh

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

3-
# We need dpcpp to compile dpctl_sycl_interface
4-
if [ ! -z "${ONEAPI_ROOT}" ]; then
5-
# Suppress error b/c it could fail on Ubuntu 18.04
6-
source ${ONEAPI_ROOT}/compiler/latest/env/vars.sh || true
7-
else
8-
echo "DPCPP is needed to build DPCTL. Abort!"
9-
exit 1
10-
fi
11-
123
${PYTHON} setup.py clean --all
13-
${PYTHON} setup.py install
4+
${PYTHON} setup.py install --sycl-compiler-prefix=$CONDA_PREFIX
145

156
# Build wheel package
167
if [ "$CONDA_PY" == "36" ]; then
@@ -19,6 +10,14 @@ else
1910
WHEELS_BUILD_ARGS="-p manylinux2014_x86_64"
2011
fi
2112
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
17+
else
18+
echo "DPCPP is needed to build DPCTL. Abort!"
19+
exit 1
20+
fi
2221
$PYTHON setup.py bdist_wheel ${WHEELS_BUILD_ARGS}
2322
cp dist/dpctl*.whl ${WHEELS_OUTPUT_FOLDER}
2423
fi

conda-recipe/meta.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
{% set name = "dpctl" %}
2-
31
package:
4-
name: {{ name|lower }}
2+
name: dpctl
53
version: {{ GIT_DESCRIBE_TAG }}
64

75
source:
@@ -10,12 +8,13 @@ source:
108
build:
119
number: {{ GIT_DESCRIBE_NUMBER }}
1210
script_env:
13-
- ONEAPI_ROOT
11+
- ONEAPI_ROOT # for wheel on Linux
1412
- WHEELS_OUTPUT_FOLDER
1513

1614
requirements:
1715
build:
1816
- {{ compiler('cxx') }}
17+
- {{ compiler('dpcpp') }} # [linux]
1918
host:
2019
- setuptools
2120
- cython

0 commit comments

Comments
 (0)