Skip to content

Drop use of soversion for dpctl sycl interface #1773

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
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
29 changes: 0 additions & 29 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,6 @@ CMAKE_ARGS="${CMAKE_ARGS} -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=${PREFIX}/include/level
# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
${PYTHON} -m build -w -n -x

pushd dist
${PYTHON} -m wheel unpack -d dpctl_wheel dpctl*.whl
export lib_name=libDPCTLSyclInterface
export so_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so")
export sox_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so\.[0-9]*$")
export soxxx_full_path=$(find dpctl_wheel -regextype posix-extended -regex "^.*${lib_name}\.so\.[0-9]*\.[0-9]*$")

rm -rf ${so_full_path} ${soxxx_full_path}

export so_name=$(basename ${so_full_path})
export sox_name=$(basename ${sox_full_path})
export soxxx_name=$(basename ${soxxx_full_path})
export wheel_path=$(dirname $(dirname ${so_full_path}))

# deal with hard copies
${PYTHON} -m wheel pack ${wheel_path}

rm -rf dpctl_wheel
popd

${PYTHON} -m wheel tags --remove --build "$GIT_DESCRIBE_NUMBER" \
--platform-tag "manylinux_${GLIBC_MAJOR}_${GLIBC_MINOR}_x86_64" \
dist/dpctl*.whl
Expand All @@ -59,15 +39,6 @@ ${PYTHON} -m pip install dist/dpctl*.whl \
--prefix "${PREFIX}" \
-vv

export libdir=$(find $PREFIX -name 'libDPCTLSyclInterface*' -exec dirname \{\} \;)

# Recover symbolic links
# libDPCTLSyclInterface.so.0 -> libDPCTLSyclInterface.so.0.17
# libDPCTLSyclInterface.so -> libDPCTLSyclInterface.so.0
mv ${libdir}/${sox_name} ${libdir}/${soxxx_name}
ln -s ${libdir}/${soxxx_name} ${libdir}/${sox_name}
ln -s ${libdir}/${sox_name} ${libdir}/${so_name}

# Copy wheel package
if [[ -d "${WHEELS_OUTPUT_FOLDER}" ]]; then
cp dist/dpctl*.whl "${WHEELS_OUTPUT_FOLDER[@]}"
Expand Down
8 changes: 5 additions & 3 deletions dpctl/tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ def test_syclinterface(should_skip_syclinterface):
if should_skip_syclinterface:
pass
else:
assert len(paths) > 1 and any(
[os.path.islink(fn) for fn in paths]
), "All library instances are hard links"
len_p = len(paths)
n_symlinks = sum([int(os.path.islink(fn)) for fn in paths])
assert len_p == 1 + n_symlinks, (
"Multiple library instances are hard links",
)
elif sys.platform in ["win32", "cygwin"]:
exts = []
for fn in paths:
Expand Down
23 changes: 13 additions & 10 deletions libsyclinterface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -284,16 +284,19 @@ if(DPCTL_ENABLE_GLOG)
endif()


include(GetProjectVersion)
# the get_version function is defined in the GetProjectVersion module and
# defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
# by parsing the output of git describe.
get_version()
set_target_properties(DPCTLSyclInterface
PROPERTIES
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}
SOVERSION ${VERSION_MAJOR}
)
set(buld_so_version 0)
if (build_so_version)
include(GetProjectVersion)
# the get_version function is defined in the GetProjectVersion module and
# defines: VERSION, SEMVER, MAJOR, MINOR, PATCH. These variables are populated
# by parsing the output of git describe.
get_version()
set_target_properties(DPCTLSyclInterface
PROPERTIES
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}
SOVERSION ${VERSION_MAJOR}
)
endif()

if(DPCTL_ENABLE_L0_PROGRAM_CREATION)
target_include_directories(DPCTLSyclInterface
Expand Down
Loading