Skip to content

Commit

Permalink
Add sycl config to conda build
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzEeKkAa committed Nov 7, 2023
1 parent 71f24ec commit c021c16
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
14 changes: 14 additions & 0 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@
@REM used BUILD_PREFIX as compiler installed in build section of meta.yml
set "PATH=%BUILD_PREFIX%\Library\bin-llvm;%PATH%"

REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
SET "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

REM Since the 60.0.0 release, setuptools includes a local, vendored copy
REM of distutils (from late copies of CPython) that is enabled by default.
REM It breaks build for Windows, so use distutils from "stdlib" as before.
REM @TODO: remove the setting, once transition to build backend on Windows
REM to cmake is complete.
SET "SETUPTOOLS_USE_DISTUTILS=stdlib"

set "CC=icx"
set "CXX=icx"

set "SKBUILD_ARGS=-G Ninja --"
set "SKBUILD_ARGS=%SKBUILD_ARGS% -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON"

Expand Down
10 changes: 10 additions & 0 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

set -euxo pipefail

# Intel LLVM must cooperate with compiler and sysroot from conda
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:${BUILD_PREFIX}/lib"

echo "--gcc-toolchain=${BUILD_PREFIX} --sysroot=${BUILD_PREFIX}/${HOST}/sysroot -target ${HOST}" > icpx_for_conda.cfg
export ICPXCFG="$(pwd)/icpx_for_conda.cfg"
export ICXCFG="$(pwd)/icpx_for_conda.cfg"

export CC=icx
export CXX=icpx

# new llvm-spirv location
# starting from dpcpp_impl_linux-64=2022.0.0=intel_3610
export PATH=$CONDA_PREFIX/bin-llvm:$PATH
Expand Down
4 changes: 4 additions & 0 deletions numba_dpex/core/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ project(_dpexrt_python
DESCRIPTION "A Python C extension for numba-dpex runtime."
)

# Help conda build find path from both host and build env.
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)

# Get numba include path
if(NOT DEFINED Numba_INCLUDE_DIRS)
execute_process(
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,5 @@ def to_cmake_format(version: str):
),
"-DIS_INSTALL:BOOL={0:s}".format("TRUE" if is_install else "FALSE"),
"-DIS_DEVELOP:BOOL={0:s}".format("TRUE" if is_develop else "FALSE"),
"-DCMAKE_C_COMPILER=icx",
"-DCMAKE_CXX_COMPILER=icpx",
],
)

0 comments on commit c021c16

Please sign in to comment.