Skip to content

Use dpctl cmake config #1671

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 2 commits into from
Feb 1, 2024
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
3 changes: 1 addition & 2 deletions .github/workflows/build-sphinx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ jobs:
run: conda list

- name: Build library
run: |
CC=icx CXX=icpx python setup.py develop -G Ninja -- -DDPCTL_MODULE_PATH=$(python -m dpctl --cmakedir)
run: python scripts/build_locally.py

- name: Build docs
run: make html
Expand Down
12 changes: 1 addition & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)

if (NOT DEFINED DPCTL_MODULE_PATH)
if (DEFINED ENV{DPCTL_MODULE_PATH})
set(DPCTL_MODULE_PATH $ENV{DPCTL_MODULE_PATH})
else ()
message(FATAL_ERROR "Specify DPCTL_MODULE_PATH, either via cmake or as environment varibale")
endif()
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_MODULE_PATH})


find_package(IntelSYCL REQUIRED PATHS ${CMAKE_SOURCE_DIR}/dpnp/backend/cmake/Modules NO_DEFAULT_PATH)
find_package(TBB QUIET)
Expand Down Expand Up @@ -78,8 +68,8 @@ find_package(NumPy REQUIRED)

set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")
find_package(Cython REQUIRED)
find_package(Dpctl REQUIRED)

find_package(Dpctl REQUIRED)
message(STATUS "Dpctl_INCLUDE_DIR=" ${Dpctl_INCLUDE_DIR})
message(STATUS "Dpctl_TENSOR_INCLUDE_DIR=" ${Dpctl_TENSOR_INCLUDE_DIR})

Expand Down
4 changes: 0 additions & 4 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ set "MKLROOT=%PREFIX%/Library"
set "TBB_ROOT_HINT=%PREFIX%/Library"
set "DPL_ROOT_HINT=%PREFIX%/Library"

%PYTHON% -m dpctl --cmakedir > Output
set /p DPCTL_CMAKE_DIR= < Output

set "SKBUILD_ARGS=-G Ninja -- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DDPCTL_MODULE_PATH:PATH=%DPCTL_CMAKE_DIR% "
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

FOR %%V IN (14.0.0 14 15.0.0 15 16.0.0 16 17.0.0 17) DO @(
Expand Down
3 changes: 1 addition & 2 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ export CMAKE_GENERATOR="Ninja"
export TBB_ROOT_HINT=$PREFIX
export DPL_ROOT_HINT=$PREFIX
export MKL_ROOT_HINT=$PREFIX
SKBUILD_ARGS="-- -DDPCTL_MODULE_PATH=$($PYTHON -m dpctl --cmakedir) "
SKBUILD_ARGS="${SKBUILD_ARGS} -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
SKBUILD_ARGS="-- -DCMAKE_C_COMPILER:PATH=icx -DCMAKE_CXX_COMPILER:PATH=icpx -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"
SKBUILD_ARGS="${SKBUILD_ARGS} -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

# Build wheel package
Expand Down
6 changes: 0 additions & 6 deletions scripts/build_locally.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import subprocess
import sys

import dpctl


def run(
use_oneapi=True,
Expand Down Expand Up @@ -60,16 +58,12 @@ def run(
cmake_args += [
"--cmake-executable=" + cmake_executable,
]
dpctl_module_path = os.path.join(
dpctl.get_include(), "..", "resources", "cmake"
)
cmake_args += [
"--build-type=" + build_type,
"--generator=" + build_system,
"--",
"-DCMAKE_C_COMPILER:PATH=" + c_compiler,
"-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler,
"-DDPCTL_MODULE_PATH:PATH=" + dpctl_module_path,
]
if verbose:
cmake_args += [
Expand Down
4 changes: 0 additions & 4 deletions scripts/gen_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ def run(
)

setup_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
dpctl_cmake_dir = subprocess.check_output(
[sys.executable, "-m", "dpctl", "--cmakedir"]
)

cmake_args = [
sys.executable,
Expand All @@ -36,7 +33,6 @@ def run(
"--",
"-DCMAKE_C_COMPILER:PATH=" + c_compiler,
"-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler,
"-DDPCTL_MODULE_PATH=" + dpctl_cmake_dir.decode().rstrip(),
"-DCMAKE_VERBOSE_MAKEFILE=ON",
"-DDPNP_GENERATE_COVERAGE=ON",
]
Expand Down