Skip to content

Feature/build with scikit build and cmake #746

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 19 commits into from
Jan 27, 2022

Conversation

oleksandr-pavlyk
Copy link
Contributor

@oleksandr-pavlyk oleksandr-pavlyk commented Jan 14, 2022

Closes #747
Closes #743

This is PR transition dpctl to use scikit-build project to control building both libsyclinterface and python extensions via CMake. Minimum required Cmake version is 3.21 to support find_package(IntelDPCPP REQUIRED).

DPC++ is now being used to build both the library and the Python API compoenents.

To build in develop, use

python setup.py develop -- -G "Unix Makefiles" -- -DCMAKE_CXX_COMPILER:PATH=icpx  -DDPCTL_ENABLE_LO_PROGRAM_CREATION=ON

Alternatively one can use driver scripts:

python scripts/build_sycl_nightly.py --oneapi

Previous syntax of using --sycl-compiler-prefix will no longer work.

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the feature/build_with_scikit-build_and_cmake branch 11 times, most recently from db6839d to dca2ed4 Compare January 25, 2022 19:28
@coveralls
Copy link
Collaborator

coveralls commented Jan 25, 2022

Coverage Status

Coverage decreased (-1.9%) to 79.555% when pulling 9170510 on feature/build_with_scikit-build_and_cmake into a2b6a9c on master.

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the feature/build_with_scikit-build_and_cmake branch 4 times, most recently from 4ec8382 to f80e4d9 Compare January 25, 2022 20:41
@github-actions
Copy link

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the feature/build_with_scikit-build_and_cmake branch 2 times, most recently from 57b47f1 to baa09b2 Compare January 26, 2022 18:08
@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review January 26, 2022 21:20
@oleksandr-pavlyk
Copy link
Contributor Author

I am going to defer writing scripts/gen_docs.py to another PR. One can use python scripts/build_sycl_nightly.py --oneapi to build develop.

@diptorupd
Copy link
Contributor

diptorupd commented Jan 27, 2022

@oleksandr-pavlyk Thanks for the much needed changes. Can you please update the PR description with a list of changes that were done in the PR? Also, please review the commits to see if any need squashing (such as any WIP commits). Overall, let us merge the and move forth asap.

@diptorupd
Copy link
Contributor

Is the FindIntelSycl module still needed?

This is needed so that the test checking for captured cerr stream does not fail.

Removed dpcpp_kernels.cpp file (dpcpp linker fails on it)
Used -fno-sycl-use-footer to work-around a bug getting in a way of collecting profiling data
…older

Delete DPCTLSyclInterface library shared objects from dpctl/ folder from previous
runs.

Monkey-patch skbuild.setuptools._copy_file to not follows symbolic links, to ensure
that versioned DPCTLSyclInterface ends up as the proper set of symbolic links pointing
to a single physical shared object file.

If symbolic links are followed, 3 identical copies of the library end up in the installation
folder. Downstream dpctl users may end up with several instances of the library in their
process space which may end up with errors is statuful functinality (queue manager) is used.
Two reasons to do this:

   1. to allow for providing hint env variables to help cmake find
      `SYCL_INCLUDE_DIR` and `SYCL_LIBRARY_DIR` for custom layouts of
      DPC++ installed into Python environment with conda
   2. To allow use of nightly sycl bundles to build dpctl (bundle does
      not include IntelDPCPPConig.cmake)
Two variants are provided: "docs" and "coverage".
Usage:

```
python scripts/gen_coverage.py
```

Builds coverage binaries, runs both ctests and pytest

Allowed options can be retrived with `python scripts/gen_coverage.py --help`.
Only Linux is supported, dependencies are assumed to be available.
Usage:

```
python scripts/build_sycl_nightly.py --c-compiler=$(which clang) --cxx-compiler=$(which clang++) --compiler-root=$(dirname $(dirname $(which clang)))
```

Option `--cmake-executable` can be used to use newer cmake
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the feature/build_with_scikit-build_and_cmake branch from 7a2467c to c7529c6 Compare January 27, 2022 01:43
@oleksandr-pavlyk
Copy link
Contributor Author

Is the FindIntelSycl module still needed?

One can probably do away with it, but that is additional work which belongs to a separate PR.

More likely we need to streamline it to reuse what is computed in IntelDPCPPConfig.cmake.

@oleksandr-pavlyk
Copy link
Contributor Author

@oleksandr-pavlyk Thanks for the much needed changes. Can you please update the PR description with a list of changes that were done in the PR? Also, please review the commits to see if any need squashing (such as any WIP commits). Overall, let us merge the and move forth asap.

I have rebased and squashed several commits. Ready for rereview.

Removed scripts/build_for_develop* as obsolete.

Renamed scripts/build_sycl_nightly.py as scripts/build_locally.py
Updated quick start guide to account for the renaming.
@oleksandr-pavlyk oleksandr-pavlyk merged commit 8b17f1c into master Jan 27, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the feature/build_with_scikit-build_and_cmake branch January 27, 2022 20:18
@github-actions
Copy link

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

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.

Move build system to CMake + skbuild Use oneAPI's IntelDPCPPConfig.cmake
3 participants