Skip to content

Commit 12e791e

Browse files
Merge pull request #1349 from IntelPython/use-skbuild-and-cmake
Transition dpnp build system to using scikit-build and cmake on all platforms
2 parents 650b38a + 10018ba commit 12e791e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+2201
-2233
lines changed

.coveragerc

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2+
# file Copyright.txt or https://cmake.org/licensing for details.
3+
4+
5+
# This module is shared by multiple languages; use include blocker.
6+
if(__WINDOWS_INTEL)
7+
return()
8+
endif()
9+
set(__WINDOWS_INTEL 1)
10+
11+
include(Platform/Windows-MSVC)
12+
macro(__windows_compiler_intel lang)
13+
__windows_compiler_msvc(${lang})
14+
15+
set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -link -out:<TARGET> -implib:<TARGET_IMPLIB> -pdb:<TARGET_PDB> -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
16+
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -LD -link -out:<TARGET> -implib:<TARGET_IMPLIB> -pdb:<TARGET_PDB> -version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR>${_PLATFORM_LINK_FLAGS} <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
17+
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
18+
if (NOT "${lang}" STREQUAL "Fortran") # Fortran driver does not support -fuse-ld, yet
19+
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <CMAKE_${lang}_LINK_FLAGS> <OBJECTS> ${CMAKE_START_TEMP_FILE} -fuse-ld=llvm-lib -o <TARGET> -link <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
20+
endif()
21+
set(CMAKE_DEPFILE_FLAGS_${lang} "-QMMD -QMT <DEP_TARGET> -QMF <DEP_FILE>")
22+
set(CMAKE_${lang}_DEPFILE_FORMAT gcc)
23+
24+
endmacro()

.github/workflows/build-sphinx.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,20 @@ jobs:
7474
- name: Install dpnp dependencies
7575
run: |
7676
conda install dpctl mkl-devel-dpcpp onedpl-devel tbb-devel dpcpp_linux-64 \
77-
cmake cython pytest -c dppy/label/dev -c intel -c conda-forge
77+
cmake cython pytest ninja scikit-build -c dppy/label/dev -c intel -c conda-forge
7878
7979
- name: Install cuPy dependencies
8080
run: conda install -c conda-forge cupy cudatoolkit=10.0
8181

8282
- name: Conda info
83-
run: |
84-
conda info
85-
conda list
83+
run: conda info
84+
85+
- name: Conda list
86+
run: conda list
8687

8788
- name: Build library
8889
run: |
89-
python setup.py build_clib
90-
CC=icpx python setup.py build_ext --inplace
91-
python setup.py develop
90+
CC=icx CXX=icpx python setup.py develop -G Ninja -- -DDPCTL_MODULE_PATH=$(python -m dpctl --cmakedir)
9291
9392
- name: Build docs
9493
run: make html
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Generate coverage data for dpnp
2+
on:
3+
pull_request:
4+
push:
5+
branches: [use-skbuild-and-cmake]
6+
7+
jobs:
8+
generate-coverage:
9+
name: Generate coverage and push to Coveralls.io
10+
runs-on: ubuntu-20.04
11+
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
env:
17+
python-ver: '3.10'
18+
19+
steps:
20+
- name: Cancel Previous Runs
21+
uses: styfle/[email protected]
22+
with:
23+
access_token: ${{ github.token }}
24+
25+
- name: Checkout repo
26+
uses: actions/checkout@v3
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Setup miniconda
31+
uses: conda-incubator/[email protected]
32+
with:
33+
auto-update-conda: true
34+
python-version: ${{ env.python-ver }}
35+
miniconda-version: 'latest'
36+
activate-environment: 'coverage'
37+
channels: intel, conda-forge
38+
39+
- name: Install Lcov
40+
run: |
41+
sudo apt-get install lcov
42+
- name: Install dpnp dependencies
43+
run: |
44+
conda install cython llvm cmake scikit-build ninja pytest pytest-cov coverage[toml] \
45+
dppy/label/dev::dpctl dpcpp_linux-64 mkl-devel-dpcpp tbb-devel onedpl-devel
46+
- name: Conda info
47+
run: |
48+
conda info
49+
conda list
50+
- name: Build dpnp with coverage
51+
run: |
52+
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py \
53+
--ignore tests/test_strides.py"
54+
- name: Install coverall dependencies
55+
run: |
56+
sudo gem install coveralls-lcov
57+
conda install coveralls
58+
- name: Upload coverage data to coveralls.io
59+
run: |
60+
echo "Processing pytest-coverage"
61+
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov)
62+
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json
63+
# merge file with coverage data and upload
64+
echo "Merging files with coverage data"
65+
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json
66+
env:
67+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
COVERALLS_PARALLEL: true
69+
70+
coveralls:
71+
name: Indicate completion to coveralls.io
72+
needs: generate-coverage
73+
runs-on: ubuntu-latest
74+
container: python:3-slim
75+
steps:
76+
- name: Finished
77+
run: |
78+
pip3 install --upgrade coveralls
79+
coveralls --finish
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# CMake build and local install directory
2-
build
2+
_skbuild
33
build_cython
44
dpnp.egg-info
55

0.build.sh

Lines changed: 0 additions & 73 deletions
This file was deleted.

0.env.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

1.build.bat

Lines changed: 0 additions & 11 deletions
This file was deleted.

1.env.bat

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)