-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·45 lines (34 loc) · 1.37 KB
/
build.sh
File metadata and controls
executable file
·45 lines (34 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
# This is necessary to help DPC++ find Intel libraries such as SVML, IRNG, etc in build prefix
export LIBRARY_PATH="$LIBRARY_PATH:${BUILD_PREFIX}/lib"
# Intel LLVM must cooperate with compiler and sysroot from conda
echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"
export ICXCFG="$(pwd)/icpx_for_conda.cfg"
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"
if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi
export CC=icx
export CXX=icpx
export CMAKE_GENERATOR=Ninja
# Make CMake verbose
export VERBOSE=1
CMAKE_ARGS="${CMAKE_ARGS} -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=${PREFIX}/include/level_zero -DDPCTL_WITH_REDIST=ON"
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
${PYTHON} -m build -w -n -x
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
dist/dpctl*.whl
${PYTHON} -m pip install dist/dpctl*.whl \
--no-build-isolation \
--no-deps \
--only-binary :all: \
--no-index \
--prefix "${PREFIX}" \
-vv
# Copy wheel package
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
cp dist/dpctl*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
fi