Skip to content

Use readelf on pi_level_zero library to find exact name of ze_loader - #617

Merged
oleksandr-pavlyk merged 1 commit into
masterfrom
ze-loader-name
Oct 4, 2021
Merged

oleksandr-pavlyk merged 1 commit into
masterfrom
ze-loader-name

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Oct 3, 2021 •

Copy link
Copy Markdown
Contributor

Store that in include/Config/dpctl_config.h and use the define in
dpctl_sycl_program_interface.cpp

CMake is running the equivalent of the following

readelf -d $DPCPP_ROOT/lib/libpi_level_zero.so | grep libze_loader | grep -Po "libze_loader[^\]]*"
libze_loader.so.1

This change, together with #603 and #616 make project buildable with OS compiler.

@coveralls

coveralls commented Oct 4, 2021 •

Copy link
Copy Markdown
Collaborator

Coverage Status

Coverage increased (+0.4%) to 74.199% when pulling 55a532e on ze-loader-name into 1b713d2 on master.

Comment thread dpctl-capi/CMakeLists.txt Resolved
Comment thread dpctl-capi/CMakeLists.txt Outdated
find_program(READELF_PROG readelf)
find_program(GREP_PROG grep)
execute_process(
COMMAND ${READELF_PROG} -d ${PI_LEVEL_ZERO_LIB}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation is off.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed the indentation.

@diptorupd diptorupd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this done. Except for the minor indentation issues that need to be addressed, the PR is good to go.

Store that in include/Config/dpctl_config.h and use the define in
dpctl_sycl_program_interface.cpp

CMake is running the equivalent of the following

```
readelf -d $DPCPP_ROOT/lib/libpi_level_zero.so | grep libze_loader | grep -Po "libze_loader[^\]]*"
libze_loader.so.1
```

@diptorupd diptorupd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@oleksandr-pavlyk
oleksandr-pavlyk merged commit a8f4254 into master Oct 4, 2021
@oleksandr-pavlyk
oleksandr-pavlyk deleted the ze-loader-name branch October 4, 2021 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants