Skip to content
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

Install cmake scripts #853

Merged
merged 4 commits into from
Jun 25, 2022
Merged

Install cmake scripts #853

merged 4 commits into from
Jun 25, 2022

Conversation

oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented Jun 23, 2022

This PR fixes an issue where .cmake scripts needed for CMake to find dpctl were not installed into site-packages/dpctl. It can now be found in site-packages/dpctl/resources/cmake.

  • CMakeLists.txt was modified to copy *.cmake files from cmake/ to dpctl/resources/cmake.

  • MANIFEST.in file was modified to ensure *.cmake files are copied over.

  • __main__.py was added to allow scripts to get

    • python -m dpctl --includes - prints include flags for compiling source using dpctl's include files
    • python -m dpctl --library - prints linker flags that needs to link to SyclInterface library
    • python -m dpctl --cmakdir - prints the folder where cmake scripts are which you set DPCTL_ROOT to for cmake to be able to execute find_packages(dpctl).
    • Added tests to check that __main__ works correctly
  • Have you provided a meaningful PR description?

  • Have you added a test, reproducer or referred to an issue with a reproducer?

  • Have you made sure that new changes do not introduce compiler warnings?


Also modified vendored IntelDPCPPConfig.cmake to align it with that included in oneAPI DPC++ compiler layout.

Indended usage of the main module is

```bash
python -m dpctl --includes   # prints include flags for dpctl headers
```

```bash
python -m dpctl --cmakdir   # prints directory to be used as DPCTL_ROOT \
                            # for cmake to find dpctl package
```

```bash
python -m dpctl --library   # prints linker flags for linking \
                            # to SyclInterface library
```
@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.06%) to 81.617% when pulling 6d62afb on install-cmake-scripts into 22eec72 on master.

@oleksandr-pavlyk
Copy link
Collaborator Author

With this change building a Python extension using scikit-build with open-source DPC++ from nightly sycl bundle becomes possible by doing

IntelDPCPP_DIR=$(python -m dpctl --cmakedir) CXX=$(which clang++) python setup.py develop

@oleksandr-pavlyk oleksandr-pavlyk merged commit 16ed729 into master Jun 25, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the install-cmake-scripts branch June 25, 2022 21:19
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

oleksandr-pavlyk added a commit that referenced this pull request Jul 25, 2022
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.

2 participants