Skip to content

Commit b07d2d8

Browse files
Merge pull request #919 from IntelPython/fix-build-breakage-with-update-of-skbuild
set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE to BOTH
2 parents 880b0c3 + 8b51053 commit b07d2d8

File tree

5 files changed

+64
-32
lines changed

5 files changed

+64
-32
lines changed

.github/workflows/conda-package.yml

Lines changed: 52 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
run: conda install conda-build
4545
- name: Build conda package
4646
run: |
47-
CHANNELS="-c defaults -c intel --override-channels"
47+
CHANNELS="-c intel -c main --override-channels"
4848
VERSIONS="--python ${{ matrix.python }}"
4949
TEST="--no-test"
5050
conda build \
@@ -89,7 +89,7 @@ jobs:
8989
- name: Install conda-build
9090
run: conda install conda-build
9191
- name: Build conda package
92-
run: conda build --no-test --python ${{ matrix.python }} -c defaults -c intel --override-channels conda-recipe
92+
run: conda build --no-test --python ${{ matrix.python }} -c intel -c main --override-channels conda-recipe
9393
- name: Upload artifact
9494
uses: actions/upload-artifact@v2
9595
with:
@@ -107,7 +107,7 @@ jobs:
107107
runner: [ubuntu-latest]
108108
continue-on-error: ${{ matrix.experimental }}
109109
env:
110-
CHANNELS: -c defaults -c intel --override-channels
110+
CHANNELS: -c intel -c main --override-channels
111111

112112
steps:
113113
- name: Download artifact
@@ -154,7 +154,7 @@ jobs:
154154
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
155155
conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
156156
# Test installed packages
157-
conda list
157+
conda list -n test_dpctl
158158
- name: Smoke test
159159
run: |
160160
. $CONDA/etc/profile.d/conda.sh
@@ -183,7 +183,8 @@ jobs:
183183
runner: [windows-latest]
184184
continue-on-error: ${{ matrix.experimental }}
185185
env:
186-
CHANNELS: -c defaults -c intel --override-channels
186+
workdir: '${{ github.workspace }}'
187+
CHANNELS: -c intel -c main --override-channels
187188

188189
steps:
189190
- name: Download artifact
@@ -192,30 +193,41 @@ jobs:
192193
name: ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
193194
- uses: conda-incubator/setup-miniconda@v2
194195
with:
195-
auto-activate-base: true
196-
activate-environment: ""
196+
use-only-tar-bz2: true
197+
auto-update-conda: true
198+
miniconda-version: 'latest'
199+
activate-environment: "dpctl_test"
197200
- name: Install conda-build
201+
shell: cmd /C CALL {0}
198202
# Needed to be able to run conda index
199203
run: conda install conda-build
200204
- name: Create conda channel
205+
shell: cmd /C CALL {0}
201206
run: |
202-
mkdir ${{ env.GITHUB_WORKSPACE }}\channel\win-64
203-
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.GITHUB_WORKSPACE }}\channel\win-64
204-
conda index ${{ env.GITHUB_WORKSPACE }}/channel
207+
echo ${{ env.workdir }}
208+
mkdir ${{ env.workdir }}\channel\win-64
209+
move ${{ env.PACKAGE_NAME }}-*.tar.bz2 ${{ env.workdir }}\channel\win-64
210+
conda index ${{ env.workdir }}/channel
205211
# Test channel
206-
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.GITHUB_WORKSPACE }}/channel --override-channels --info --json > ${{ env.GITHUB_WORKSPACE }}\ver.json
207-
more ${{ env.GITHUB_WORKSPACE }}\ver.json
212+
conda search ${{ env.PACKAGE_NAME }} -c ${{ env.workdir }}/channel --override-channels --info --json > ${{ env.workdir }}\ver.json
213+
type ${{ env.workdir }}\ver.json
208214
- name: Collect dependencies
209-
shell: cmd
215+
shell: cmd /C CALL {0}
210216
run: |
211217
@ECHO ON
212-
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
218+
if not exist ver.json (
219+
copy /Y ${{ env.workdir }}\ver.json .
220+
)
213221
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
214222
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
215223
SET PACKAGE_VERSION=%%F
216224
)
217-
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
218-
more lockfile
225+
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }} --only-deps --dry-run > lockfile
226+
- name: Display lockfile content
227+
shell: cmd /C CALL {0}
228+
run: |
229+
echo "Outputting content of lockfile:"
230+
type lockfile
219231
- name: Cache conda packages
220232
uses: actions/cache@v3
221233
env:
@@ -228,22 +240,28 @@ jobs:
228240
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-python-${{ matrix.python }}-
229241
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-
230242
- name: Install opencl_rt
243+
shell: cmd /C CALL {0}
231244
run: conda install opencl_rt -c intel --override-channels
232245
- name: Install dpctl
233-
shell: cmd
246+
shell: cmd /C CALL {0}
234247
run: |
235248
@ECHO ON
236-
copy /Y ${{ env.GITHUB_WORKSPACE }}\ver.json .
249+
copy /Y ${{ env.workdir }}\ver.json .
237250
set "SCRIPT=%VER_SCRIPT1% %VER_SCRIPT2%"
238251
FOR /F "tokens=* USEBACKQ" %%F IN (`python -c "%SCRIPT%"`) DO (
239252
SET PACKAGE_VERSION=%%F
240253
)
241-
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.GITHUB_WORKSPACE }}/channel ${{ env.CHANNELS }}
242-
# Test installed packages
254+
conda install ${{ env.PACKAGE_NAME }}=%PACKAGE_VERSION% pytest python=${{ matrix.python }} -c ${{ env.workdir }}/channel ${{ env.CHANNELS }}
255+
- name: Report content of test environemtn
256+
shell: cmd /C CALL {0}
257+
run: |
258+
echo "Value of CONDA enviroment variable was: " %CONDA%
243259
conda list
244260
- name: Add library
261+
shell: pwsh
245262
run: |
246-
echo "OCL_ICD_FILENAMES=C:\Miniconda\Library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
263+
$conda_env_library = "$env:CONDA_PREFIX\Library"
264+
echo "OCL_ICD_FILENAMES=$conda_env_library\lib\intelocl64.dll" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
247265
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
248266
if ($list.count -eq 0) {
249267
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos)) {
@@ -255,12 +273,12 @@ jobs:
255273
if (-not (Test-Path -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)) {
256274
New-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors
257275
}
258-
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name C:\Miniconda\Library\lib\intelocl64.dll -Value 0
276+
New-ItemProperty -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors -Name $conda_env_library\lib\intelocl64.dll -Value 0
259277
try {$list = Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors | Select-Object -ExpandProperty Property } catch {$list=@()}
260278
Write-Output $(Get-Item -Path HKLM:\SOFTWARE\Khronos\OpenCL\Vendors)
261279
# Now copy OpenCL.dll into system folder
262280
$system_ocl_icd_loader="C:\Windows\System32\OpenCL.dll"
263-
$python_ocl_icd_loader="C:\Miniconda\Library\bin\OpenCL.dll"
281+
$python_ocl_icd_loader="$conda_env_library\bin\OpenCL.dll"
264282
Copy-Item -Path $python_ocl_icd_loader -Destination $system_ocl_icd_loader
265283
if (Test-Path -Path $system_ocl_icd_loader) {
266284
Write-Output "$system_ocl_icd_loader has been copied"
@@ -270,19 +288,24 @@ jobs:
270288
Write-Output "OCL-ICD-Loader was not copied"
271289
}
272290
# Variable assisting OpenCL CPU driver to find TBB DLLs which are not located where it expects them by default
273-
echo "TBB_DLL_PATH=C:\Miniconda\Library\bin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
291+
$cl_cfg="$conda_env_library\lib\cl.cfg"
292+
Write-Output $cl_cfg
293+
(Get-Content $cl_cfg) -replace '^CL_CONFIG_TBB_DLL_PATH =', "CL_CONFIG_TBB_DLL_PATH = $conda_env_library\bin" | Set-Content $cl_cfg
294+
Get-Content -Tail 5 -Path $cl_cfg
274295
}
275296
- name: Smoke test
297+
shell: cmd /C CALL {0}
276298
run: |
299+
python -c "import sys; print(sys.executable)"
277300
set SYCL_ENABLE_HOST_DEVICE=1
278-
& { [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Miniconda\Library\bin\", [EnvironmentVariableTarget]::Machine) }
279301
python -c "import dpctl; dpctl.lsplatform()"
280302
python -c "import dpctl; print(dpctl.get_devices(backend='opencl', device_type='gpu'))"
281303
python -c "import dpctl; print(dpctl.get_num_devices(backend='opencl', device_type='gpu'))"
282304
- name: Run tests
305+
shell: cmd /C CALL {0}
283306
run: |
284307
set SYCL_ENABLE_HOST_DEVICE=1
285-
& { [Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Miniconda\Library\bin\", [EnvironmentVariableTarget]::Machine) }
308+
python -c "import sys; print(sys.executable)"
286309
python -m pytest -p no:faulthandler --pyargs ${{ env.MODULE_NAME }}
287310
288311
upload_linux:
@@ -346,7 +369,7 @@ jobs:
346369
runner: [ubuntu-latest]
347370
continue-on-error: ${{ matrix.experimental }}
348371
env:
349-
CHANNELS: -c defaults -c intel --override-channels
372+
CHANNELS: -c intel -c main --override-channels
350373

351374
steps:
352375
- name: Install conda-build
@@ -404,7 +427,7 @@ jobs:
404427
shell: bash -l {0}
405428
run: |
406429
source $CONDA/etc/profile.d/conda.sh
407-
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c defaults --override-channels"
430+
CHANNELS="-c $GITHUB_WORKSPACE/channel -c dppy/label/dev -c intel -c main --override-channels"
408431
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
409432
conda install -n examples -y ${CHANNELS} dpctl=${PACKAGE_VERSION} dpnp">=0.10.1" || exit 1
410433
- name: Build and run examples with native extensions
@@ -488,7 +511,7 @@ jobs:
488511
runner: [ubuntu-latest]
489512
continue-on-error: ${{ matrix.experimental }}
490513
env:
491-
CHANNELS: -c intel -c defaults --override-channels
514+
CHANNELS: -c intel -c main --override-channels
492515
steps:
493516
- name: Cache array API tests
494517
id: cache-array-api-tests

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ project(dpctl
77

88
set(CMAKE_CXX_STANDARD 17)
99
set(CMAKE_CXX_STANDARD_REQUIRED True)
10+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
11+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)
1012

1113
# Option to generate code coverage report using llvm-cov and lcov.
1214
option(DPCTL_GENERATE_COVERAGE

examples/pybind11/onemkl_gemv/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ find_library(mkl_sycl NAMES mkl_sycl PATHS ${MKL_LIBRARY_DIR} REQUIRED)
3030
find_library(mkl_intel_ilp64 NAMES mkl_intel_ilp64 PATHS ${MKL_LIBRARY_DIR} REQUIRED)
3131
find_library(mkl_tbb_thread NAMES mkl_tbb_thread PATHS ${MKL_LIBRARY_DIR} REQUIRED)
3232
find_library(tbb NAMES tbb PATHS ${TBB_LIBRARY_DIR} REQUIRED)
33+
find_library(OpenCL NAMES OpenCL REQUIRED)
3334

3435
set(py_module_name _onemkl)
3536

@@ -64,7 +65,7 @@ target_include_directories(standalone_cpp
6465
PUBLIC ${MKL_INCLUDE_DIR} ${TBB_INCLUDE_DIR} sycl_gemm
6566
)
6667
target_link_libraries(standalone_cpp
67-
PRIVATE ${mkl_sycl} ${mkl_intel_ilp64} ${mkl_tbb_thread} ${mkl_core} ${tbb}
68+
PRIVATE ${mkl_sycl} ${mkl_intel_ilp64} ${mkl_tbb_thread} ${mkl_core} ${tbb} ${OpenCL}
6869
)
6970

7071
set(ignoreMe "${SKBUILD}")

libsyclinterface/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ if(DPCTL_ENABLE_L0_PROGRAM_CREATION)
6767
OUTPUT_VARIABLE LIBZE_LOADER_FILENAME
6868
OUTPUT_STRIP_TRAILING_WHITESPACE
6969
ERROR_STRIP_TRAILING_WHITESPACE
70-
)
70+
)
71+
set(LIBZE_LOADER_FILENAME ${LIBZE_LOADER_FILENAME} PARENT_SCOPE)
7172
endif()
73+
set(LIBZE_LOADER_FILENAME ${LIBZE_LOADER_FILENAME} PARENT_SCOPE)
7274
endif()
7375

7476
if (UNIX)
@@ -86,8 +88,12 @@ if (UNIX)
8688
OUTPUT_STRIP_TRAILING_WHITESPACE
8789
ERROR_STRIP_TRAILING_WHITESPACE
8890
)
91+
set(LIBCL_LOADER_FILENAME ${LIBCL_LOADER_FILENAME} PARENT_SCOPE)
8992
endif()
9093

94+
message(STATUS "LIB_ZE: ${LIBZE_LOADER_FILENAME}")
95+
message(STATUS "LIB_CL: ${LIBCL_LOADER_FILENAME}")
96+
9197
configure_file(
9298
${CMAKE_CURRENT_SOURCE_DIR}/include/Config/dpctl_config.h.in
9399
${CMAKE_CURRENT_SOURCE_DIR}/include/Config/dpctl_config.h

libsyclinterface/include/Config/dpctl_config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
/* Defined when dpctl was built with level zero program creation enabled. */
2929
#cmakedefine DPCTL_ENABLE_L0_PROGRAM_CREATION \
30-
@DPCTL_ENABLE_L0_PROGRAM_CREATION @
30+
@DPCTL_ENABLE_L0_PROGRAM_CREATION@
3131

3232
/* The DPCPP version used to build dpctl */
3333
#define DPCTL_DPCPP_VERSION "@IntelSycl_VERSION@"

0 commit comments

Comments
 (0)