Skip to content

Commit 5b37a9d

Browse files
Implement manipulation of flattened SO files
1 parent 8ebbac1 commit 5b37a9d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

conda-recipe/build.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ CMAKE_ARGS="${CMAKE_ARGS} -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=${PREFIX}/include/level
2626

2727
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
2828
${PYTHON} -m build -w -n -x
29+
pushd dist
30+
${PYTHON} -m wheel unpack -d dpctl_wheel
31+
export lib_name=libDPCTLSyclInterface
32+
export so_name=$(find dpctl -regextype posix-extended -regex '^.*${lib_name}\.so' -exec basename \{\} \;)
33+
export sox_name=$(find dpctl -regextype posix-extended -regex '^.*${lib_name}\.so\.[0-9]*$' -exec basename \{\} \;)
34+
export soxxx_name=$(find dpctl -regextype posix-extended -regex '^.*${lib_name}\.so\.[0-9]*\.[0-9]*$' -exec basename \{\} \;)
35+
rm -rf ${so_name} ${soxxx_name}
36+
# deal with hard copies
37+
${PYTHON} -m wheel pack dpctl_wheel
38+
rm -rf dpctl_wheel
39+
popd ..
2940
${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
3041
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
3142
dist/dpctl*.whl
@@ -37,11 +48,14 @@ ${PYTHON} -m pip install dist/dpctl*.whl \
3748
--prefix "${PREFIX}" \
3849
-vv
3950

51+
export libdir=$(find $PREFIX | grep libDPCTLSyclInterface | dirname)
52+
4053
# Recover symbolic links
4154
# libDPCTLSyclInterface.so.0 -> libDPCTLSyclInterface.so.0.17
4255
# libDPCTLSyclInterface.so -> libDPCTLSyclInterface.so.0
43-
find $PREFIX | grep libDPCTLSyclInterface | sort -r | \
44-
awk '{if ($0=="") ln=""; else if (ln=="") ln = $0; else system("rm " $0 ";\tln -s " ln " " $0); ln = $0 }'
56+
mv ${libdir}/${sox_name} ${libdir}/${soxxx_name}
57+
ln -s ${libdir}/${soxxx_name} ${libdir}/${sox_name}
58+
ln -s ${libdir}/${sox_name} ${libdir}/${so_name}
4559

4660
# Copy wheel package
4761
if [[ -v WHEELS_OUTPUT_FOLDER ]]; then

0 commit comments

Comments
 (0)